torcs - 1.2.2

Parameters Data manipulation.
[Parameters file management.]


Detailed Description

Read, write, merge parameters files.


Functions

tdble GfParmUnit2SI (char *unit, tdble val)
 Convert a value in "units" into SI.

tdble GfParmSI2Unit (char *unit, tdble val)
 Convert a value in SI to "units".

char * GfParmGetName (void *handle)
 Get the pararmeters name.

char * GfParmGetStr (void *parmHandle, char *path, char *key, char *deflt)
 Get string parameter value.

tdble GfParmGetNum (void *handle, char *path, char *key, char *unit, tdble deflt)
 Get a numerical parameter in a config file.

int GfParmSetStr (void *handle, char *path, char *key, char *val)
 Set a string parameter in a config file.

int GfParmSetNum (void *handle, char *path, char *key, char *unit, tdble val)
 Set a numerical parameter in a config file.

int GfParmSetNumEx (void *handle, char *path, char *key, char *unit, tdble val, tdble min, tdble max)
 Set a numerical parameter in a config file.

int GfParmGetNumBoundaries (void *handle, char *path, char *key, tdble *min, tdble *max)
 Get the min and max of a numerical parameter.


Function Documentation

char* GfParmGetName void *  handle  ) 
 

Get the pararmeters name.

Parameters:
handle Handle on the parameters
Returns:
Name

tdble GfParmGetNum void *  handle,
char *  path,
char *  key,
char *  unit,
tdble  deflt
 

Get a numerical parameter in a config file.

Parameters:
handle handle of parameters
path path of param
key key name
unit unit to convert the result to (NULL if SI wanted)
deflt default string
Returns:
parameter value

Here is the call graph for this function:

int GfParmGetNumBoundaries void *  handle,
char *  path,
char *  key,
tdble min,
tdble max
 

Get the min and max of a numerical parameter.

Parameters:
handle handle of parameters
path path of the attribute
key key name
min Receives the min value
max Receives the max value
Returns:
0 Ok
-1 Parameter not existing

Here is the call graph for this function:

char* GfParmGetStr void *  parmHandle,
char *  path,
char *  key,
char *  deflt
 

Get string parameter value.

Parameters:
parmHandle Configuration handle
path Parameter section name
key Parameter name
deflt Default value if parameter not existing
Returns:
Parameter value
deflt if Error or not found
Note:
The pointer returned is for immediate use, if you plan to keep the value for a long time, it is necessary to copy it elsewhere, because removing the attribute will produce incoherent pointer.

int GfParmSetNum void *  handle,
char *  path,
char *  key,
char *  unit,
tdble  val
 

Set a numerical parameter in a config file.

Parameters:
handle handle of parameters
path path of param
key key name
unit unit to convert the result to (NULL if SI wanted)
val value to set
Returns:
0 ok
-1 error
Warning:
The key is created is necessary

Here is the call graph for this function:

int GfParmSetNumEx void *  handle,
char *  path,
char *  key,
char *  unit,
tdble  val,
tdble  min,
tdble  max
 

Set a numerical parameter in a config file.

Parameters:
handle handle of parameters
path path of param
key key name
unit unit to convert the result to (NULL if SI wanted)
val value to set
min min value
max max value
Returns:
0 ok
-1 error
Warning:
The key is created is necessary

Here is the call graph for this function:

int GfParmSetStr void *  handle,
char *  path,
char *  key,
char *  val
 

Set a string parameter in a config file.

Parameters:
handle handle of parameters
path path of param
key key name
val value (NULL or empty string to remove the parameter)
Returns:
0 ok
-1 error
Warning:
The key is created is necessary

tdble GfParmSI2Unit char *  unit,
tdble  val
 

Convert a value in SI to "units".

Parameters:
unit unit name to convert to
val value in SI units to be converted to units
Returns:
converted value to units
See also:
GfParmUnit2SI

tdble GfParmUnit2SI char *  unit,
tdble  val
 

Convert a value in "units" into SI.

Parameters:
unit unit name
val value in units
Returns:
the value in corresponding SI unit
Warning:
The supported units are:
  • feet or ft converted to m
  • inches or in converted to m
  • lbs converted to kg
  • slug or slugs converted to kg
  • h or hours converted to s
  • day or days converted to s
  • km converted to m
  • cm converted to m
  • mm converted to m
  • kPa converted to Pa
  • deg converted to rad
  • rpm or RPM converted to rad/s
  • percent or divided by 100
See also:
GfParmSI2Unit


Generated at Thu Feb 26 21:54:22 2004 for torcs by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-1999
TORCS © Eric Espié 1999, 2002.