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

  param | parameter to read the value from

References GWENHYWFAR_API.

## 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

  param | parameter to read the value from

References GWENHYWFAR_API.

## 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

  pl | list of parameters
  name | name of the parameter
  defVal | default value (returned if param has no value or no valid value).

References GWENHYWFAR_API.

## 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

  pl | list of parameters
  name | name of the parameter
  defVal | default value (returned if param has no value or no valid value).

References GWENHYWFAR_API.

## 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

  pl | list of parameters to read values for
  xn | XML node to read values for the parameters

References GWENHYWFAR_API.

## 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

  pl | list to store parameters read
  xn | XML node to read the parameters from

References GWENHYWFAR_API.

## 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

  pl | list of parameters
  name | name of the parameter
  v | value to set.

References GWENHYWFAR_API.

## 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

  pl | list of parameters
  name | name of the parameter
  v | value to set.

References GWENHYWFAR_API.

## 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

  pl | list of parameters to write
  xn | XML node to store the parameters

References GWENHYWFAR_API.

## 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

  pl | list of parameters to write
  xn | XML node to store the parameters

References GWENHYWFAR_API.

## 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

  param | parameter to change
  v | value to set

References GWENHYWFAR_API.

## 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

  param | parameter to change
  v | value to set

References GWENHYWFAR_API.