7.2
general documentation
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-2022 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 
55 int
56 cs_gui_load_file(const char *filename);
57 
58 /*-----------------------------------------------------------------------------
59  * Check the xml file version.
60  *----------------------------------------------------------------------------*/
61 
62 void
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 
75 int
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 
89 int
90 cs_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 
104 int
106  cs_real_t v2);
107 
108 /*----------------------------------------------------------------------------*/
118 /*----------------------------------------------------------------------------*/
119 
120 void
121 cs_gui_node_get_int(cs_tree_node_t *node,
122  int *value);
123 
124 /*----------------------------------------------------------------------------*/
134 /*----------------------------------------------------------------------------*/
135 
136 void
137 cs_gui_node_get_real(cs_tree_node_t *node,
138  cs_real_t *value);
139 
140 /*----------------------------------------------------------------------------*/
150 /*----------------------------------------------------------------------------*/
151 
152 void
153 cs_gui_node_get_status_int(cs_tree_node_t *node,
154  int *status);
155 
156 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 void
169 cs_gui_node_get_status_bool(cs_tree_node_t *node,
170  bool *status);
171 
172 /*----------------------------------------------------------------------------*/
184 /*----------------------------------------------------------------------------*/
185 
186 const char *
187 cs_gui_node_get_tag(cs_tree_node_t *node,
188  const char *tag_name);
189 
190 /*----------------------------------------------------------------------------*/
201 /*----------------------------------------------------------------------------*/
202 
203 void
204 cs_gui_node_get_child_int(cs_tree_node_t *node,
205  const char *child_name,
206  int *value);
207 
208 /*----------------------------------------------------------------------------*/
219 /*----------------------------------------------------------------------------*/
220 
221 void
222 cs_gui_node_get_child_real(cs_tree_node_t *node,
223  const char *child_name,
224  cs_real_t *value);
225 
226 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 void
241 cs_gui_node_get_child_status_int(cs_tree_node_t *node,
242  const char *child_name,
243  int *status);
244 
245 /*----------------------------------------------------------------------------*/
257 /*----------------------------------------------------------------------------*/
258 
259 void
260 cs_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 
271 void
272 cs_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 
281 double
283 
284 /*----------------------------------------------------------------------------*/
285 
287 
288 #endif /* __CS_GUI_UTIL_H__ */
int cs_gui_strcmp(const char *s1, const char *s2)
Definition: cs_gui_util.c:202
int cs_gui_load_file(const char *filename)
Load the XML file in memory.
Definition: cs_gui_util.c: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.c:375
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
int cs_gui_is_equal_real(cs_real_t v1, cs_real_t v2)
Definition: cs_gui_util.c:223
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.c:253
void cs_gui_node_get_status_int(cs_tree_node_t *node, int *status)
Update an integer-valued status value based on a node&#39;s status tag.
Definition: cs_gui_util.c:319
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&#39;s child node.
Definition: cs_gui_util.c:405
void cs_gui_add_mei_time(double t)
Definition: cs_gui_util.c:541
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
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&#39;s status tag.
Definition: cs_gui_util.c:480
void cs_gui_check_version(void)
Check the XML file version.
Definition: cs_gui_util.c:122
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&#39;s status tag.
Definition: cs_gui_util.c:514
double cs_gui_get_mei_times(void)
Definition: cs_gui_util.c:554
int cs_gui_characters_number(int num)
Definition: cs_gui_util.c:174
#define END_C_DECLS
Definition: cs_defs.h:511
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&#39;s child node.
Definition: cs_gui_util.c:442
Definition: cs_field_pointer.h:92
void cs_gui_node_get_status_bool(cs_tree_node_t *node, bool *status)
Update an bool-valued status value based on a node&#39;s status tag.
Definition: cs_gui_util.c:346
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.c:286