8.3
general documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_gui_util.h
Go to the documentation of this file.
1#ifndef __CS_GUI_UTIL_H__
2#define __CS_GUI_UTIL_H__
3
4/*============================================================================
5 * Management of the GUI parameters file: xpath request and utilities
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "cs_base.h"
35#include "cs_tree.h"
36
37/*----------------------------------------------------------------------------*/
38
40
41/*=============================================================================
42 * Public function prototypes
43 *============================================================================*/
44
45/*----------------------------------------------------------------------------
46 * Load the XML file in memory.
47 *
48 * parameter:
49 * filename <-- XML file containing the parameters
50 *
51 * returns:
52 * error code (0 in case of success)
53 *----------------------------------------------------------------------------*/
54
55int
56cs_gui_load_file(const char *filename);
57
58/*-----------------------------------------------------------------------------
59 * Check the xml file version.
60 *----------------------------------------------------------------------------*/
61
62void
64
65/*-----------------------------------------------------------------------------
66 * Return the number of characters needed to print an integer number
67 *
68 * parameters:
69 * num <-- integer number
70 *
71 * returns:
72 * number of characters required
73 *----------------------------------------------------------------------------*/
74
75int
77
78/*-----------------------------------------------------------------------------
79 * Compare two strings.
80 *
81 * parameters:
82 * s1 <-- first string
83 * s2 <-- second string
84 *
85 * returns:
86 * 1 if the strings are equal, 0 otherwise.
87 *----------------------------------------------------------------------------*/
88
89int
90cs_gui_strcmp(const char *s1,
91 const char *s2);
92
93/*-----------------------------------------------------------------------------
94 * Test if 2 real values are equal (avoiding compiler warnings)
95 *
96 * parameters:
97 * v1 <-- first value to compare
98 * v2 <-- second value to compare
99 *
100 * returns:
101 * 1 if values are equal, 0 otherwise
102 *----------------------------------------------------------------------------*/
103
104int
106 cs_real_t v2);
107
108/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120void
121cs_gui_node_get_int(cs_tree_node_t *node,
122 int *value);
123
124/*----------------------------------------------------------------------------*/
134/*----------------------------------------------------------------------------*/
135
136void
137cs_gui_node_get_real(cs_tree_node_t *node,
138 cs_real_t *value);
139
140/*----------------------------------------------------------------------------*/
150/*----------------------------------------------------------------------------*/
151
152void
153cs_gui_node_get_status_int(cs_tree_node_t *node,
154 int *status);
155
156/*----------------------------------------------------------------------------*/
166/*----------------------------------------------------------------------------*/
167
168void
169cs_gui_node_get_status_bool(cs_tree_node_t *node,
170 bool *status);
171
172/*----------------------------------------------------------------------------*/
184/*----------------------------------------------------------------------------*/
185
186const char *
187cs_gui_node_get_tag(cs_tree_node_t *node,
188 const char *tag_name);
189
190/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
203void
204cs_gui_node_get_child_int(cs_tree_node_t *node,
205 const char *child_name,
206 int *value);
207
208/*----------------------------------------------------------------------------*/
219/*----------------------------------------------------------------------------*/
220
221void
222cs_gui_node_get_child_real(cs_tree_node_t *node,
223 const char *child_name,
224 cs_real_t *value);
225
226/*----------------------------------------------------------------------------*/
238/*----------------------------------------------------------------------------*/
239
240void
241cs_gui_node_get_child_status_int(cs_tree_node_t *node,
242 const char *child_name,
243 int *status);
244
245/*----------------------------------------------------------------------------*/
257/*----------------------------------------------------------------------------*/
258
259void
260cs_gui_node_get_child_status_bool(cs_tree_node_t *node,
261 const char *child_name,
262 bool *status);
263
264/*-----------------------------------------------------------------------------
265 * Add timing increment to global MEI time counter.
266 *
267 * parameters:
268 * t <-- timing increment to add
269 *----------------------------------------------------------------------------*/
270
271void
272cs_gui_add_mei_time(double t);
273
274/*-----------------------------------------------------------------------------
275 * Get cumulative global MEI time counter.
276 *
277 * returns:
278 * cumulative global MEI time counter
279 *----------------------------------------------------------------------------*/
280
281double
283
284/*----------------------------------------------------------------------------*/
285
287
288#endif /* __CS_GUI_UTIL_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
@ t
Definition: cs_field_pointer.h:94
void cs_gui_node_get_status_bool(cs_tree_node_t *node, bool *status)
Update an bool-valued status value based on a node's status tag.
Definition: cs_gui_util.cpp:346
void cs_gui_node_get_child_status_bool(cs_tree_node_t *node, const char *child_name, bool *status)
Update a bool-valued status value based on a node child's status tag.
Definition: cs_gui_util.cpp:514
void cs_gui_node_get_int(cs_tree_node_t *node, int *value)
Update an integer value based on a tree node.
Definition: cs_gui_util.cpp:253
int cs_gui_is_equal_real(cs_real_t v1, cs_real_t v2)
Definition: cs_gui_util.cpp:223
void cs_gui_node_get_child_int(cs_tree_node_t *node, const char *child_name, int *value)
Update an integer value based on a tree's child node.
Definition: cs_gui_util.cpp:405
void cs_gui_node_get_real(cs_tree_node_t *node, cs_real_t *value)
Update an real value based on a tree node.
Definition: cs_gui_util.cpp:286
void cs_gui_check_version(void)
Check the XML file version.
Definition: cs_gui_util.cpp:122
void cs_gui_node_get_child_real(cs_tree_node_t *node, const char *child_name, cs_real_t *value)
Update an integer value based on a tree's child node.
Definition: cs_gui_util.cpp:442
int cs_gui_load_file(const char *filename)
Load the XML file in memory.
Definition: cs_gui_util.cpp:102
const char * cs_gui_node_get_tag(cs_tree_node_t *node, const char *tag_name)
Return a string value associated with a "tag" child node and whose presence should be guaranteed.
Definition: cs_gui_util.cpp:375
void cs_gui_add_mei_time(double t)
Definition: cs_gui_util.cpp:541
void cs_gui_node_get_child_status_int(cs_tree_node_t *node, const char *child_name, int *status)
Update an integer-valued status value based on a node child's status tag.
Definition: cs_gui_util.cpp:480
int cs_gui_strcmp(const char *s1, const char *s2)
Definition: cs_gui_util.cpp:202
double cs_gui_get_mei_times(void)
Definition: cs_gui_util.cpp:554
void cs_gui_node_get_status_int(cs_tree_node_t *node, int *status)
Update an integer-valued status value based on a node's status tag.
Definition: cs_gui_util.cpp:319
int cs_gui_characters_number(int num)
Definition: cs_gui_util.cpp:174