mxml_ufoai.c File Reference

UFO:AI interface functions to mxml. More...

#include "mxml_ufoai.h"
Include dependency graph for mxml_ufoai.c:

Go to the source code of this file.

Functions

void mxml_AddString (mxml_node_t *parent, const char *name, const char *value)
 add a String attribute to the XML Node
void mxml_AddStringValue (mxml_node_t *parent, const char *name, const char *value)
 add a non-empty String attribute to the XML Node
void mxml_AddBool (mxml_node_t *parent, const char *name, qboolean value)
 add a Boolean attribute to the XML Node
void mxml_AddBoolValue (mxml_node_t *parent, const char *name, qboolean value)
 add a non-false Boolean attribute to the XML Node
void mxml_AddFloat (mxml_node_t *parent, const char *name, float value)
 add a Float attribute to the XML Node
void mxml_AddFloatValue (mxml_node_t *parent, const char *name, float value)
 add a non-zero Float attribute to the XML Node
void mxml_AddDouble (mxml_node_t *parent, const char *name, double value)
 add a Double attribute to the XML Node
void mxml_AddDoubleValue (mxml_node_t *parent, const char *name, double value)
 add a non-zero Double attribute to the XML Node
void mxml_AddByte (mxml_node_t *parent, const char *name, byte value)
 add a Byte attribute to the XML Node
void mxml_AddByteValue (mxml_node_t *parent, const char *name, byte value)
 add a non-zero Byte attribute to the XML Node
void mxml_AddShort (mxml_node_t *parent, const char *name, short value)
 add a Short attribute to the XML Node
void mxml_AddShortValue (mxml_node_t *parent, const char *name, short value)
 add a non-zero Short attribute to the XML Node
void mxml_AddInt (mxml_node_t *parent, const char *name, int value)
 add an Int attribute to the XML Node
void mxml_AddIntValue (mxml_node_t *parent, const char *name, int value)
 add a non-zero Int attribute to the XML Node
void mxml_AddLong (mxml_node_t *parent, const char *name, long value)
 add a Long attribute to the XML Node
void mxml_AddLongValue (mxml_node_t *parent, const char *name, long value)
 add a non-zero Long attribute to the XML Node
void mxml_AddPos3 (mxml_node_t *parent, const char *name, const vec3_t pos)
 add a Pos3 data to the XML Tree
void mxml_AddPos2 (mxml_node_t *parent, const char *name, const vec2_t pos)
void mxml_AddDate (mxml_node_t *parent, const char *name, const int day, const int sec)
mxml_node_tmxml_AddNode (mxml_node_t *parent, const char *name)
 add a new node to the XML tree
qboolean mxml_GetBool (mxml_node_t *parent, const char *name, const qboolean defaultval)
 retrieve a Boolean attribute from an XML Node
int mxml_GetInt (mxml_node_t *parent, const char *name, const int defaultval)
 retrieve an Int attribute from an XML Node
short mxml_GetShort (mxml_node_t *parent, const char *name, const short defaultval)
 retrieve a Short attribute from an XML Node
long mxml_GetLong (mxml_node_t *parent, const char *name, const long defaultval)
 retrieve a Long attribute from an XML Node
const char * mxml_GetString (mxml_node_t *parent, const char *name)
 retrieve a String attribute from an XML Node
float mxml_GetFloat (mxml_node_t *parent, const char *name, const float defaultval)
 retrieve a Float attribute from an XML Node
double mxml_GetDouble (mxml_node_t *parent, const char *name, const double defaultval)
 retrieve a Double attribute from an XML Node
mxml_node_tmxml_GetPos2 (mxml_node_t *parent, const char *name, vec2_t pos)
 retrieve the first Pos2 data from an XML Node
mxml_node_tmxml_GetNextPos2 (mxml_node_t *actual, mxml_node_t *parent, const char *name, vec2_t pos)
 retrieve the next Pos2 data from an XML Node
mxml_node_tmxml_GetPos3 (mxml_node_t *parent, const char *name, vec3_t pos)
 retrieve the first Pos3 data from an XML Node
mxml_node_tmxml_GetNextPos3 (mxml_node_t *actual, mxml_node_t *parent, const char *name, vec3_t pos)
 retrieve the next Pos3 data from an XML Node
mxml_node_tmxml_GetDate (mxml_node_t *parent, const char *name, int *day, int *sec)
 retrieve the date data from an XML Node
mxml_node_tmxml_GetNode (mxml_node_t *parent, const char *name)
 Get first Node of the XML tree by name.
mxml_node_tmxml_GetNextNode (mxml_node_t *current, mxml_node_t *parent, const char *name)
 Get next Node of the XML tree by name.
mxml_type_t mxml_ufo_type_cb (mxml_node_t *node)
 callback function for parsing the node tree

Detailed Description

UFO:AI interface functions to mxml.

Definition in file mxml_ufoai.c.


Function Documentation

void mxml_AddBool ( mxml_node_t parent,
const char *  name,
qboolean  value 
)

add a Boolean attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 59 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by CP_SaveMissionsXML(), and CP_SaveXML().

void mxml_AddBoolValue ( mxml_node_t parent,
const char *  name,
qboolean  value 
)

add a non-false Boolean attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is qfalse nothing will be added

Definition at line 71 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by AC_SaveXML(), AIR_SaveAircraftXML(), AIRFIGHT_SaveXML(), B_SaveBaseSlotsXML(), B_SaveXML(), BS_SaveXML(), CP_SaveMissionsXML(), MS_MessageSaveXML(), MSO_SaveXML(), and RS_SaveXML().

void mxml_AddByte ( mxml_node_t parent,
const char *  name,
byte  value 
)

add a Byte attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 136 of file mxml_ufoai.c.

References mxml_AddLong().

void mxml_AddByteValue ( mxml_node_t parent,
const char *  name,
byte  value 
)

add a non-zero Byte attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is zero nothing will be added

Definition at line 148 of file mxml_ufoai.c.

References mxml_AddLongValue().

Referenced by B_SaveStorageXML().

void mxml_AddDate ( mxml_node_t parent,
const char *  name,
const int  day,
const int  sec 
)
void mxml_AddDouble ( mxml_node_t parent,
const char *  name,
double  value 
)

add a Double attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 106 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by mxml_AddFloat().

void mxml_AddDoubleValue ( mxml_node_t parent,
const char *  name,
double  value 
)

add a non-zero Double attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is zero nothing will be added

Definition at line 120 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by BS_SaveXML(), and mxml_AddFloatValue().

void mxml_AddFloat ( mxml_node_t parent,
const char *  name,
float  value 
)

add a Float attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 83 of file mxml_ufoai.c.

References mxml_AddDouble().

Referenced by AIRFIGHT_SaveXML(), B_SaveXML(), CP_SaveXML(), INS_SaveXML(), mxml_AddPos2(), mxml_AddPos3(), NAT_SaveXML(), and US_SaveXML().

void mxml_AddFloatValue ( mxml_node_t parent,
const char *  name,
float  value 
)

add a non-zero Float attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is zero nothing will be added

Definition at line 95 of file mxml_ufoai.c.

References mxml_AddDoubleValue().

Referenced by AB_SaveXML(), AIR_SaveRouteXML(), PR_SaveXML(), and RS_SaveXML().

void mxml_AddInt ( mxml_node_t parent,
const char *  name,
int  value 
)

add an Int attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 182 of file mxml_ufoai.c.

References mxml_AddLong().

Referenced by AB_SaveXML(), AC_SaveXML(), AIR_SaveAircraftXML(), AIRFIGHT_SaveXML(), B_SaveBaseSlotsXML(), B_SaveXML(), CL_SaveCharacterXML(), CL_SaveItemXML(), CP_SaveMapDefStatXML(), CP_SaveMissionsXML(), E_SaveXML(), INS_SaveXML(), mxml_AddDate(), NAT_SaveXML(), PR_SaveXML(), RS_SaveXML(), SAV_GameSave(), TR_SaveXML(), US_SaveXML(), and XVI_SaveXML().

void mxml_AddIntValue ( mxml_node_t parent,
const char *  name,
int  value 
)

add a non-zero Int attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is zero nothing will be added

Definition at line 194 of file mxml_ufoai.c.

References mxml_AddLongValue().

Referenced by AB_SaveXML(), AC_SaveXML(), AII_SaveOneSlotXML(), AIR_SaveAircraftXML(), B_SaveStorageXML(), B_SaveXML(), BS_SaveXML(), CL_SaveCharacterXML(), CL_SaveItemXML(), CP_SaveXML(), INS_SaveXML(), MP_SaveTeamMultiplayer(), RS_SaveXML(), STATS_SaveXML(), and TR_SaveXML().

void mxml_AddLong ( mxml_node_t parent,
const char *  name,
long  value 
)

add a Long attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 205 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by AIR_SaveAircraftXML(), CP_SaveXML(), mxml_AddByte(), mxml_AddInt(), and mxml_AddShort().

void mxml_AddLongValue ( mxml_node_t parent,
const char *  name,
long  value 
)

add a non-zero Long attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is zero nothing will be added

Definition at line 219 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by mxml_AddByteValue(), mxml_AddIntValue(), and mxml_AddShortValue().

mxml_node_t* mxml_AddNode ( mxml_node_t parent,
const char *  name 
)
void mxml_AddPos2 ( mxml_node_t parent,
const char *  name,
const vec2_t  pos 
)
void mxml_AddPos3 ( mxml_node_t parent,
const char *  name,
const vec3_t  pos 
)

add a Pos3 data to the XML Tree

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the node to add
[in] pos Pos3 structure with position data
Note:
it creates a new node and adds coordinate(s) to the node as attributes

Definition at line 236 of file mxml_ufoai.c.

References mxml_AddFloat(), and mxmlNewElement().

Referenced by AIR_SaveAircraftXML(), AIRFIGHT_SaveXML(), B_SaveXML(), and INS_SaveXML().

void mxml_AddShort ( mxml_node_t parent,
const char *  name,
short  value 
)

add a Short attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute

Definition at line 159 of file mxml_ufoai.c.

References mxml_AddLong().

Referenced by CP_SaveInterestsXML(), CP_SaveMissionsXML(), and CP_SaveXML().

void mxml_AddShortValue ( mxml_node_t parent,
const char *  name,
short  value 
)

add a non-zero Short attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is zero nothing will be added

Definition at line 171 of file mxml_ufoai.c.

References mxml_AddLongValue().

Referenced by CP_SaveInterestsXML(), and CP_SaveXML().

void mxml_AddString ( mxml_node_t parent,
const char *  name,
const char *  value 
)
void mxml_AddStringValue ( mxml_node_t parent,
const char *  name,
const char *  value 
)

add a non-empty String attribute to the XML Node

Parameters:
[out] parent XML Node structure to add to
[in] name Name of the attribute
[in] value Value of the attribute
Note:
if the value is empty nothing will be added

Definition at line 47 of file mxml_ufoai.c.

References mxmlElementSetAttr().

Referenced by AII_SaveOneSlotXML(), and MS_MessageSaveXML().

qboolean mxml_GetBool ( mxml_node_t parent,
const char *  name,
const qboolean  defaultval 
)

retrieve a Boolean attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
[in] defaultval Default value to return if no such attribute defined

Definition at line 293 of file mxml_ufoai.c.

References mxmlElementGetAttr(), qfalse, and qtrue.

Referenced by AC_LoadXML(), AIR_LoadAircraftXML(), AIRFIGHT_LoadXML(), B_LoadBaseSlotsXML(), B_LoadXML(), BS_LoadXML(), CP_LoadMissionsXML(), CP_LoadXML(), MS_LoadXML(), MSO_LoadXML(), and RS_LoadXML().

mxml_node_t* mxml_GetDate ( mxml_node_t parent,
const char *  name,
int *  day,
int *  sec 
)

retrieve the date data from an XML Node

Parameters:
[in] parent XML Node structure to get child from
[in] name Name of the pos node
[out] day Day part of the date to fill
[out] sec Second part of the date to fill
Returns:
pointer to the node the data was retrieved from
NULL if no node with name found

Definition at line 482 of file mxml_ufoai.c.

References mxml_GetInt(), and mxml_GetNode().

Referenced by AIR_LoadAircraftXML(), CP_LoadMissionsXML(), CP_LoadXML(), MS_LoadXML(), RS_LoadXML(), and US_LoadXML().

double mxml_GetDouble ( mxml_node_t parent,
const char *  name,
const double  defaultval 
)

retrieve a Double attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
[in] defaultval Default value to return if no such attribute defined

Definition at line 388 of file mxml_ufoai.c.

References mxmlElementGetAttr().

Referenced by BS_LoadXML().

float mxml_GetFloat ( mxml_node_t parent,
const char *  name,
const float  defaultval 
)

retrieve a Float attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
[in] defaultval Default value to return if no such attribute defined

Definition at line 373 of file mxml_ufoai.c.

References mxmlElementGetAttr().

Referenced by AB_LoadXML(), AIR_LoadRouteXML(), AIRFIGHT_LoadXML(), B_LoadXML(), CP_LoadXML(), INS_LoadXML(), mxml_GetNextPos2(), mxml_GetNextPos3(), mxml_GetPos2(), mxml_GetPos3(), NAT_LoadXML(), PR_LoadXML(), RS_LoadXML(), and US_LoadXML().

int mxml_GetInt ( mxml_node_t parent,
const char *  name,
const int  defaultval 
)

retrieve an Int attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
[in] defaultval Default value to return if no such attribute defined

Definition at line 314 of file mxml_ufoai.c.

References mxmlElementGetAttr().

Referenced by AB_LoadXML(), AC_LoadXML(), AII_LoadOneSlotXML(), AIR_LoadAircraftXML(), AIRFIGHT_LoadXML(), B_LoadBaseSlotsXML(), B_LoadStorageXML(), B_LoadXML(), BS_LoadXML(), CL_LoadCharacterXML(), CL_LoadItemXML(), CP_LoadInterestsXML(), CP_LoadMapDefStatXML(), CP_LoadMissionsXML(), CP_LoadXML(), E_LoadXML(), INS_LoadXML(), MP_LoadTeamMultiplayer(), mxml_GetDate(), NAT_LoadXML(), PR_LoadXML(), RS_LoadXML(), STATS_LoadXML(), TR_LoadXML(), US_LoadXML(), and XVI_LoadXML().

long mxml_GetLong ( mxml_node_t parent,
const char *  name,
const long  defaultval 
)

retrieve a Long attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
[in] defaultval Default value to return if no such attribute defined

Definition at line 344 of file mxml_ufoai.c.

References mxmlElementGetAttr().

Referenced by AIR_LoadAircraftXML(), and CP_LoadXML().

mxml_node_t* mxml_GetNextNode ( mxml_node_t current,
mxml_node_t parent,
const char *  name 
)
mxml_node_t* mxml_GetNextPos2 ( mxml_node_t actual,
mxml_node_t parent,
const char *  name,
vec2_t  pos 
)

retrieve the next Pos2 data from an XML Node

Parameters:
[in] actual XML Node pointer of the previous pos data
[in] parent XML Node structure to get child from
[in] name Name of the pos node
[out] pos vec2_t structure to fill
Returns:
pointer to the node the data was retrieved from
NULL if no Node with name found

Definition at line 424 of file mxml_ufoai.c.

References mxml_GetFloat(), and mxml_GetNextNode().

Referenced by AIR_LoadRouteXML(), and AIRFIGHT_LoadXML().

mxml_node_t* mxml_GetNextPos3 ( mxml_node_t actual,
mxml_node_t parent,
const char *  name,
vec3_t  pos 
)

retrieve the next Pos3 data from an XML Node

Parameters:
[in] actual XML Node pointer of the previous pos data
[in] parent XML Node structure to get child from
[in] name Name of the pos node
[out] pos vec3_t structure to fill
Returns:
pointer to the node the data was retrieved from
NULL if no Node with name found

Definition at line 462 of file mxml_ufoai.c.

References mxml_GetFloat(), and mxml_GetNextNode().

mxml_node_t* mxml_GetNode ( mxml_node_t parent,
const char *  name 
)
mxml_node_t* mxml_GetPos2 ( mxml_node_t parent,
const char *  name,
vec2_t  pos 
)

retrieve the first Pos2 data from an XML Node

Parameters:
[in] parent XML Node structure to get child from
[in] name Name of the pos node
[out] pos vec2_t structure to fill
Returns:
pointer to the node the data was retrieved from
NULL if no node with name found

Definition at line 405 of file mxml_ufoai.c.

References mxml_GetFloat(), and mxml_GetNode().

Referenced by AB_LoadXML(), AIR_LoadRouteXML(), AIRFIGHT_LoadXML(), B_LoadXML(), and CP_LoadMissionsXML().

mxml_node_t* mxml_GetPos3 ( mxml_node_t parent,
const char *  name,
vec3_t  pos 
)

retrieve the first Pos3 data from an XML Node

Parameters:
[in] parent XML Node structure to get child from
[in] name Name of the pos node
[out] pos vec3_t structure to fill
Returns:
pointer to the node the data was retrieved from
NULL if no node with name found

Definition at line 442 of file mxml_ufoai.c.

References mxml_GetFloat(), and mxml_GetNode().

Referenced by AIR_LoadAircraftXML(), AIRFIGHT_LoadXML(), B_LoadXML(), and INS_LoadXML().

short mxml_GetShort ( mxml_node_t parent,
const char *  name,
const short  defaultval 
)

retrieve a Short attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
[in] defaultval Default value to return if no such attribute defined

Definition at line 329 of file mxml_ufoai.c.

References mxmlElementGetAttr().

const char* mxml_GetString ( mxml_node_t parent,
const char *  name 
)

retrieve a String attribute from an XML Node

Parameters:
[in] parent XML Node structure to get from
[in] name Name of the attribute
Returns:
empty string if no such attribute defined

Definition at line 359 of file mxml_ufoai.c.

References mxmlElementGetAttr().

Referenced by AC_LoadXML(), AII_LoadOneSlotXML(), AIR_LoadAircraftXML(), AIRFIGHT_LoadXML(), B_LoadStorageXML(), B_LoadXML(), BS_LoadXML(), CL_LoadCharacterXML(), CL_LoadItemXML(), CP_LoadInterestsXML(), CP_LoadMapDefStatXML(), CP_LoadMissionsXML(), CP_LoadXML(), E_LoadXML(), INS_LoadXML(), MP_LoadTeamMultiplayer(), MS_LoadXML(), MSO_LoadXML(), NAT_LoadXML(), PR_LoadXML(), RS_LoadXML(), TR_LoadXML(), and US_LoadXML().

mxml_type_t mxml_ufo_type_cb ( mxml_node_t node  ) 

callback function for parsing the node tree

Definition at line 518 of file mxml_ufoai.c.

References mxml_value_u::element, MXML_INTEGER, MXML_OPAQUE, MXML_REAL, MXML_TEXT, mxmlElementGetAttr(), mxml_element_s::name, type, and mxml_node_s::value.

Referenced by MP_LoadTeamMultiplayer(), and SAV_GameLoad().


Generated by  doxygen 1.6.2