21#define XML_START_ID "Start"
26typedef struct ndata_start_s {
61 node = doc->xmlChildrenNode;
63 ERR( _(
"Malformed '%s' file: missing root element '%s'"), START_DATA_PATH,
XML_START_ID );
67 node = node->xmlChildrenNode;
69 ERR( _(
"Malformed '%s' file: does not contain elements"), START_DATA_PATH );
77 if (xml_isNode(node,
"player")) {
78 xmlNodePtr cur = node->children;
87 if (xml_isNode(cur,
"ship")) {
92 else if (xml_isNode(cur,
"system")) {
93 xmlNodePtr tmp = cur->children;
101 WARN(_(
"'%s' has unknown system node '%s'."), START_DATA_PATH, tmp->name);
102 }
while (xml_nextNode(tmp));
105 WARN(_(
"'%s' has unknown player node '%s'."), START_DATA_PATH, cur->name);
106 }
while (xml_nextNode(cur));
110 if (xml_isNode(node,
"date")) {
111 int cycles, periods, seconds;
112 xmlr_attr_int( node,
"scu", cycles );
113 xmlr_attr_int( node,
"stp", periods );
114 xmlr_attr_int( node,
"stu", seconds );
124 WARN(_(
"'%s' has unknown node '%s'."), START_DATA_PATH, node->name);
125 }
while (xml_nextNode(node));
131#define MELEMENT(o,s) \
132 if (o) WARN(_("Module start data missing/invalid '%s' element"), s)
138 MELEMENT( !date_set,
"date" );
Header file with generic functions and naev-specifics.
ntime_t ntime_create(int scu, int stp, int stu)
Creates a time structure.
xmlDocPtr xml_parsePhysFS(const char *filename)
Analogous to xmlParseMemory/xmlParseFile.
static ndata_start_t start_data
const char * start_acquired(void)
Gets the module's starting ship was acquired.
const char * start_event(void)
Gets the starting event of the player.
void start_cleanup(void)
Cleans up after the module start data.
int start_load(void)
Loads the module start data.
const char * start_mission(void)
Gets the starting mission of the player.
void start_position(double *x, double *y)
Gets the starting position of the player.
const char * start_chapter(void)
Gets the player's starting chapter.
const char * start_name(void)
Gets the module name.
const char * start_ship(void)
Gets the module player starting ship.
ntime_t start_date(void)
Gets the starting date.
const char * start_spob_lua_default(void)
Gets the default spob Lua file.
const char * start_shipname(void)
Gets the module's starting ship's name.
const char * start_system(void)
Gets the starting system name.
unsigned int start_credits(void)
Gets the player's starting credits.
The start data structure.