GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / dev > latc_host / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

XML.c File Reference

XML parser for the LATC pkg. More...

#include <LATC/LATC_msgs.h>
#include <LATC/XML.h>
#include <consume.h>
#include <create.h>
#include <imm.h>
#include <data.h>
#include <parser_state_p.h>
#include <msg_init_p.h>
#include <AG_addr_s.h>
#include <AG_xml_tags_s.h>
#include <AG_map_tags_s.h>
#include <MSG/MSG_pubdefs.h>
#include <XLX/XLX.h>
#include <LEM/msg_macros.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Defines

#define INITIAL_STACK_LIMIT   8
 Size of the stack within the state structure on initialisation.

Functions

unsigned LATC_parse (const char **filelist, unsigned filecount, const char *stub, unsigned filter, unsigned verb)
 Parse a set of XML files and spit out the binary configuration files.
unsigned LATC_parseMap (const char **filelist, unsigned filecount, const char *outname, unsigned verb)

Variables

static XLX_parent_tag lat
 Tag structure for the LAT element.
static XLX_basic_tag * docChild []
 Array of pointers to named structures that are children on the DOC (pseudo) element.
static XLX_parent_tag doc
 Tag structure for the (pseudo) element DOC.
static XLX_parent_tag mapTag
 Tag structure for the mapTag element.
static XLX_basic_tag * mapDocChild []
 Array of pointers to named structures that are children on the mapDoc (pseudo) element.
static XLX_parent_tag mapDoc
 Tag structure for the (pseudo) element mapDoc.


Detailed Description

XML parser for the LATC pkg.

Author:
James Swain -- jswain@slac.stanford.edu

Function Documentation

unsigned LATC_parse ( const char **  filelist,
unsigned  filecount,
const char *  stub,
unsigned  filter,
unsigned  verb 
)

Parse a set of XML files and spit out the binary configuration files.

Parameters:
filelist List of strings containing the names of XML files to parse
filecount Number of XML files to parse
stub Filename stub to use a basis for output filenames
filter Bit mask of the components to create output files for
verb 1 for verbose, 0 for quiet
Return values:
LATC_SUCCESS If all goes well
LATC_BADALLOC If there is an error allocating memory for the IMM structure
LATC_BADFOPEN if the configuration master file or any of the configuration binary files cannot be opened.
LATC_BADWRITE If one of the file write operations failed
LATC_BADCLOSE If one of the files failed to close
XLX_FOPEN If one of the XML files cannot be opened
XLX_MEMERR If there is an error creating a parser control structure
XLX_FREAD If there is an error reading an XML file
XLX_PARSE If there is an error parsing the XML

References LATC_state::addr, doc, LATC_state::excptn, INITIAL_STACK_LIMIT, LATC_state::latc, LATC_createCfg(), readField(), and LATC_state::xState.

unsigned LATC_parseMap ( const char **  filelist,
unsigned  filecount,
const char *  outname,
unsigned  verb 
)

Parameters:
filelist List of strings containing the names of XML files to parse
filecount Number of XML files to parse
outname Output filename
verb 1 for verbose, 0 for quiet
Return values:
LATC_SUCCESS If all goes well
LATC_BADALLOC If there is an error allocating memory for the map structure
LATC_BADFOPEN if the output file cannot be opened
LATC_BADWRITE If the file write operation failed
LATC_BADCLOSE If the output file failed to close
XLX_FOPEN If one of the XML files cannot be opened
XLX_MEMERR If there is an error creating a parser control structure
XLX_FREAD If there is an error reading an XML file
XLX_PARSE If there is an error parsing the XML

References LATC_state::addr, LATC_state::excptn, INITIAL_STACK_LIMIT, LATC_state::latc, LATC_createMap(), mapChar(), mapDoc, and LATC_state::xState.


Variable Documentation

XLX_parent_tag doc [static]

Initial value:

 {
  {"", XLX_PARENT, XLX_character_noop},
  XLX_NON_RECURSIVE,
  docChild,
  NULL,
  NULL
}
Tag structure for the (pseudo) element DOC.

Referenced by LATC_parse().

XLX_basic_tag* docChild[] [static]

Initial value:

 {
  (XLX_basic_tag*)(&lat), 
  NULL
}
Array of pointers to named structures that are children on the DOC (pseudo) element.

XLX_parent_tag lat [static]

Initial value:

 {
  {"LATC_XML", XLX_PARENT, XLX_character_noop},
  XLX_NON_RECURSIVE,
  latChild,
  NULL,
  NULL
}
Tag structure for the LAT element.

XLX_parent_tag mapDoc [static]

Initial value:

 {
  {"", XLX_PARENT, XLX_character_noop},
  XLX_NON_RECURSIVE,
  mapDocChild,
  NULL,
  NULL
}
Tag structure for the (pseudo) element mapDoc.

Referenced by LATC_parseMap().

XLX_basic_tag* mapDocChild[] [static]

Initial value:

 {
  (XLX_basic_tag*)(&mapTag), 
  NULL
}
Array of pointers to named structures that are children on the mapDoc (pseudo) element.

XLX_parent_tag mapTag [static]

Initial value:

 {
  {"LATC_MAP_XML", XLX_PARENT, XLX_character_noop},
  XLX_NON_RECURSIVE,
  mapChild,
  NULL,
  NULL
}
Tag structure for the mapTag element.


Generated on Thu Apr 7 17:31:52 2011 by  doxygen 1.5.8