gwenhywfar 5.14.1
param_fns.h File Reference

Go to the source code of this file.

Functions

GWENHYWFAR_API double GWEN_Param_GetCurrentValueAsDouble (const GWEN_PARAM *param)
GWENHYWFAR_API int GWEN_Param_GetCurrentValueAsInt (const GWEN_PARAM *param)
GWENHYWFAR_API double GWEN_Param_List_GetCurrentValueAsDouble (const GWEN_PARAM_LIST *pl, const char *name, double defVal)
GWENHYWFAR_API int GWEN_Param_List_GetCurrentValueAsInt (const GWEN_PARAM_LIST *pl, const char *name, int defVal)
GWENHYWFAR_API void GWEN_Param_List_ReadValuesFromXml (GWEN_PARAM_LIST *pl, GWEN_XMLNODE *xn)
GWENHYWFAR_API void GWEN_Param_List_ReadXml (GWEN_PARAM_LIST *pl, GWEN_XMLNODE *xn)
GWENHYWFAR_API void GWEN_Param_List_SetCurrentValueAsDouble (GWEN_PARAM_LIST *pl, const char *name, double v)
GWENHYWFAR_API void GWEN_Param_List_SetCurrentValueAsInt (GWEN_PARAM_LIST *pl, const char *name, int v)
GWENHYWFAR_API void GWEN_Param_List_WriteValuesToXml (const GWEN_PARAM_LIST *pl, GWEN_XMLNODE *xn)
GWENHYWFAR_API void GWEN_Param_List_WriteXml (const GWEN_PARAM_LIST *pl, GWEN_XMLNODE *xn)
GWENHYWFAR_API void GWEN_Param_SetCurrentValueAsDouble (GWEN_PARAM *param, double v)
GWENHYWFAR_API void GWEN_Param_SetCurrentValueAsInt (GWEN_PARAM *param, int v)

Function Documentation

◆ GWEN_Param_GetCurrentValueAsDouble()

GWENHYWFAR_API double GWEN_Param_GetCurrentValueAsDouble ( const GWEN_PARAM * param)

Returns the current value of the given param converted to floating point.

Returns
current value as floating point
Parameters
paramparameter to read the value from

Definition at line 79 of file param_fns.c.

References GWEN_Text_StringToDouble().

Referenced by GWEN_Param_List_GetCurrentValueAsDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Param_GetCurrentValueAsInt()

GWENHYWFAR_API int GWEN_Param_GetCurrentValueAsInt ( const GWEN_PARAM * param)

Returns the current value of the given param converted to integer.

Returns
current value as integer
Parameters
paramparameter to read the value from

Definition at line 35 of file param_fns.c.

Referenced by GWEN_Param_List_GetCurrentValueAsInt().

Here is the caller graph for this function:

◆ GWEN_Param_List_GetCurrentValueAsDouble()

GWENHYWFAR_API double GWEN_Param_List_GetCurrentValueAsDouble ( const GWEN_PARAM_LIST * pl,
const char * name,
double defVal )

Find param with the given name and return its current value. If there is no value (or no valid value) then a default value is returned. This is for floating point values.

Returns
value
Parameters
pllist of parameters
namename of the parameter
defValdefault value (returned if param has no value or no valid value).

Definition at line 149 of file param_fns.c.

References GWEN_Param_GetCurrentValueAsDouble(), and GWEN_Param_List_GetByName().

Here is the call graph for this function:

◆ GWEN_Param_List_GetCurrentValueAsInt()

GWENHYWFAR_API int GWEN_Param_List_GetCurrentValueAsInt ( const GWEN_PARAM_LIST * pl,
const char * name,
int defVal )

Find param with the given name and return its current value. If there is no value (or no valid value) then a default value is returned. This is for integer values.

Returns
value
Parameters
pllist of parameters
namename of the parameter
defValdefault value (returned if param has no value or no valid value).

Definition at line 126 of file param_fns.c.

References GWEN_Param_GetCurrentValueAsInt(), and GWEN_Param_List_GetByName().

Here is the call graph for this function:

◆ GWEN_Param_List_ReadValuesFromXml()

GWENHYWFAR_API void GWEN_Param_List_ReadValuesFromXml ( GWEN_PARAM_LIST * pl,
GWEN_XMLNODE * xn )

Read the current values for a list of parameters from XML.

The XML tree is expected to have been created by GWEN_Param_List_WriteValuesToXml. Every "param" node below the given XML node is expected to have an attribute "name" with the name of the param and a data node which holds the current value to set. Entries for non-existing params are ignored.

Parameters
pllist of parameters to read values for
xnXML node to read values for the parameters

Definition at line 237 of file param_fns.c.

References DBG_WARN, GWEN_LOGDOMAIN, GWEN_Param_List_GetByName(), GWEN_Param_SetCurrentValue(), GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetProperty(), and NULL.

Here is the call graph for this function:

◆ GWEN_Param_List_ReadXml()

GWENHYWFAR_API void GWEN_Param_List_ReadXml ( GWEN_PARAM_LIST * pl,
GWEN_XMLNODE * xn )

Read a list of parameters from XML.

Parameters
pllist to store parameters read
xnXML node to read the parameters from

Definition at line 191 of file param_fns.c.

References GWEN_Param_fromXml(), GWEN_Param_List_Add(), GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), and NULL.

Here is the call graph for this function:

◆ GWEN_Param_List_SetCurrentValueAsDouble()

GWENHYWFAR_API void GWEN_Param_List_SetCurrentValueAsDouble ( GWEN_PARAM_LIST * pl,
const char * name,
double v )

Find param with the given name and change its current value. If there is no param of that name is found this function does nothing. This is for floating point values.

Returns
value
Parameters
pllist of parameters
namename of the parameter
vvalue to set.

Definition at line 161 of file param_fns.c.

References GWEN_Param_List_GetByName(), and GWEN_Param_SetCurrentValueAsDouble().

Here is the call graph for this function:

◆ GWEN_Param_List_SetCurrentValueAsInt()

GWENHYWFAR_API void GWEN_Param_List_SetCurrentValueAsInt ( GWEN_PARAM_LIST * pl,
const char * name,
int v )

Find param with the given name and change its current value. If there is no param of that name is found this function does nothing. This is for integer values.

Returns
value
Parameters
pllist of parameters
namename of the parameter
vvalue to set.

Definition at line 138 of file param_fns.c.

References GWEN_Param_List_GetByName(), and GWEN_Param_SetCurrentValueAsInt().

Here is the call graph for this function:

◆ GWEN_Param_List_WriteValuesToXml()

GWENHYWFAR_API void GWEN_Param_List_WriteValuesToXml ( const GWEN_PARAM_LIST * pl,
GWEN_XMLNODE * xn )

Write the current values of a list of parameters to XML.

For every member of the given list an XML node "param" is created below the given XML node which only contains the attribute "name" (parameter name) and the param's "currentValue" (the current value) as data node. Example:

<param name="var1">data1</param>
<param name="var2">data2</param>
Parameters
pllist of parameters to write
xnXML node to store the parameters

Definition at line 210 of file param_fns.c.

References GWEN_Param_GetCurrentValue(), GWEN_Param_GetName(), GWEN_Param_List_First(), GWEN_Param_List_Next(), GWEN_XMLNode_AddChild(), GWEN_XMLNode_new(), GWEN_XMLNode_SetCharValue(), GWEN_XMLNode_SetProperty(), GWEN_XMLNodeTypeTag, and NULL.

Here is the call graph for this function:

◆ GWEN_Param_List_WriteXml()

GWENHYWFAR_API void GWEN_Param_List_WriteXml ( const GWEN_PARAM_LIST * pl,
GWEN_XMLNODE * xn )

Write the list of parameters to XML.

Parameters
pllist of parameters to write
xnXML node to store the parameters

Definition at line 172 of file param_fns.c.

References GWEN_Param_List_First(), GWEN_Param_List_Next(), GWEN_Param_WriteXml(), GWEN_XMLNode_AddChild(), GWEN_XMLNode_new(), and GWEN_XMLNodeTypeTag.

Here is the call graph for this function:

◆ GWEN_Param_SetCurrentValueAsDouble()

GWENHYWFAR_API void GWEN_Param_SetCurrentValueAsDouble ( GWEN_PARAM * param,
double v )

Changes the current value of the given param (converted from floating point). The given value is converted to char and stored.

Parameters
paramparameter to change
vvalue to set

Definition at line 111 of file param_fns.c.

References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Param_SetCurrentValue(), and GWEN_Text_DoubleToBuffer().

Referenced by GWEN_Param_List_SetCurrentValueAsDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Param_SetCurrentValueAsInt()

GWENHYWFAR_API void GWEN_Param_SetCurrentValueAsInt ( GWEN_PARAM * param,
int v )

Changes the current value of the given param (converted from integer). The given value is converted to char and stored.

Parameters
paramparameter to change
vvalue to set

Definition at line 67 of file param_fns.c.

References GWEN_Param_SetCurrentValue().

Referenced by GWEN_Param_List_SetCurrentValueAsInt().

Here is the call graph for this function:
Here is the caller graph for this function: