My Project
programmer's documentation
Functions
cs_gui_util.c File Reference
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_parameters.h"
#include "cs_tree.h"
#include "cs_tree_xml.h"
#include "cs_gui_util.h"
Include dependency graph for cs_gui_util.c:

Functions

int cs_gui_file_is_loaded (void)
 Indicate if an XML file has been loaded. More...
 
int cs_gui_load_file (const char *filename)
 Load the XML file in memory. More...
 
void cs_gui_check_version (void)
 Check the XML file version. More...
 
int cs_gui_characters_number (int num)
 
int cs_gui_strcmp (const char *s1, const char *s2)
 
int cs_gui_is_equal_real (cs_real_t v1, cs_real_t v2)
 
void cs_gui_node_get_int (cs_tree_node_t *node, int *value)
 Update an integer value based on a tree node. More...
 
void cs_gui_node_get_real (cs_tree_node_t *node, cs_real_t *value)
 Update an real value based on a tree node. More...
 
void cs_gui_node_get_status_int (cs_tree_node_t *tn, int *status)
 Update an integer-valued status value based on a node's status tag. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void cs_gui_node_get_child_status_int (cs_tree_node_t *tn, const char *child_name, int *status)
 Update an integer-valued status value based on a node child's status tag. More...
 
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. More...
 
void cs_gui_add_mei_time (double t)
 
double cs_gui_get_mei_times (void)
 

Function Documentation

◆ cs_gui_add_mei_time()

void cs_gui_add_mei_time ( double  t)

◆ cs_gui_characters_number()

int cs_gui_characters_number ( int  num)

◆ cs_gui_check_version()

void cs_gui_check_version ( void  )

Check the XML file version.

◆ cs_gui_file_is_loaded()

int cs_gui_file_is_loaded ( void  )

Indicate if an XML file has been loaded.

Returns
1 if an XML file has been loaded, 0 otherwise

◆ cs_gui_get_mei_times()

double cs_gui_get_mei_times ( void  )

◆ cs_gui_is_equal_real()

int cs_gui_is_equal_real ( cs_real_t  v1,
cs_real_t  v2 
)

◆ cs_gui_load_file()

int cs_gui_load_file ( const char *  filename)

Load the XML file in memory.

Parameters
[in]filenameXML file containing the parameters
Returns
error code (0 in case of success)

◆ cs_gui_node_get_child_int()

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.

If no node is present, the initial value is unchanged. If the node is present but the value missing, an error is returne.

Parameters
[in]nodenode whose value is queried
[in]child_namename of child node
[in,out]valuequeried value

◆ cs_gui_node_get_child_real()

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.

If no node is present, the initial value is unchanged. If the node is present but the value missing, an error is returne.

Parameters
[in]nodenode whose value is queried
[in]child_namename of child node
[in,out]valuequeried value

◆ cs_gui_node_get_child_status_bool()

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.

The status is defined in a string-valued child (tag) node. If no such child and tag is present, the initial status is unchanged.

Parameters
[in]nodenode whose value is queried
[in]child_namename of child node
[in,out]valuequeried value

◆ cs_gui_node_get_child_status_int()

void cs_gui_node_get_child_status_int ( cs_tree_node_t *  tn,
const char *  child_name,
int *  status 
)

Update an integer-valued status value based on a node child's status tag.

The status is defined in a string-valued child (tag) node. If no such child and tag is present, the initial status is unchanged.

Parameters
[in]nodenode whose value is queried
[in]child_namename of child node
[in,out]valuequeried value

◆ cs_gui_node_get_int()

void cs_gui_node_get_int ( cs_tree_node_t *  node,
int *  value 
)

Update an integer value based on a tree node.

If no node is present, the initial value is unchanged. If the node is present but the value missing, an error is returne.

Parameters
[in]nodenode whose value is queried
[in,out]valuequeried value

◆ cs_gui_node_get_real()

void cs_gui_node_get_real ( cs_tree_node_t *  node,
cs_real_t value 
)

Update an real value based on a tree node.

If no node is present, the initial value is unchanged. If the node is present but the value missing, an error is returne.

Parameters
[in]nodenode whose value is queried
[in,out]valuequeried value

◆ cs_gui_node_get_status_bool()

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.

The status is defined in a string-valued child (tag) node. If no such tag is present, the initial status is unchanged.

Parameters
[in]nodenode whose status is queried
[in,out]statusstatus value (0 or 1)

◆ cs_gui_node_get_status_int()

void cs_gui_node_get_status_int ( cs_tree_node_t *  tn,
int *  status 
)

Update an integer-valued status value based on a node's status tag.

The status is defined in a string-valued child (tag) node. If no such tag is present, the initial status is unchanged.

Parameters
[in]tnnode whose status is queried
[in,out]statusstatus value (0 or 1)

◆ cs_gui_node_get_tag()

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.

If the matching child node is not present, an error is produced

Parameters
[in]nodetree node which should have a "tag" child
[in]tag_namename of tag child node
Returns
pointer to matching child string

◆ cs_gui_strcmp()

int cs_gui_strcmp ( const char *  s1,
const char *  s2 
)