votParseP.h File Reference

Internal LIBVOTABLE definitions. More...

#include <expat.h>

Go to the source code of this file.

Data Structures

struct  AttrList
 Information for an attribute. More...
struct  AttrBlock
 Information for a block of attributes. More...
struct  elem_t
struct  node
struct  Stack
 This is a structure that holds the information for a stack. More...

Defines

#define VOT_DOC_VERSION   "1.2"
#define VOT_XSI   "http://www.w3.org/2001/XMLSchema-instance"
#define VOT_SCHEMA_LOC   "http://www.ivoa.net/xml/VOTable/v1.1 http://www.ivoa.net/xml/VOTable/v1.1"
#define VOT_XMLNS   "http://www.ivoa.net/xml/VOTable/v1.1"
#define SZ_ATTRNAME   32
#define SZ_ATTRVAL   2048
#define SZ_FNAME   255
#define SZ_XMLTAG   1024
#define SZ_LINE   4096
#define MAX_ATTR   100
#define HANDLE_INCREMENT   1024000
#define min(a, b)   ((a<b)?a:b)
#define max(a, b)   ((a>b)?a:b)
#define handle_t   int
 Handle type definition.

Typedefs

typedef struct elem_t Element
typedef struct node Node

Functions

int vot_attrSet (AttrBlock *ablock, char *name, char *value)
 Set/Create an attributes (private method).
char * vot_attrGet (AttrBlock *ablock, char *name)
 Get an attribute's value (private method).
char * vot_attrXML (AttrBlock *ablock)
 Get the attributes for an XML tag (private method).
int vot_eType (char *name)
 Get the integer value (ID) of the name (private method).
char * vot_elemName (Element *e)
 Get the name of the Element (private method).
int vot_elemType (Element *e)
 Get the integer value (ID) of the Element (private method).
char * vot_elemXML (Element *e)
 Builds a string of the opening XML Tag (private method).
char * vot_elemXMLEnd (Element *e)
 Build a string of the ending XML Tag (private method).
Elementvot_newElem (unsigned int type)
 Allocate a new structure of the given type (private method).
handle_t vot_setHandle (Element *elem)
 Assign the Element a handle_t (private method).
handle_t vot_lookupHandle (Element *elem)
 Lookup the handle_t to an Element (private method).
void vot_freeHandle (handle_t handle)
 Free a handle for use (private method).
Elementvot_getElement (handle_t handle)
 Get the Element refered to by handle_t (private method).
void vot_newHandleTable (void)
 Initialize a handle table (private method).
int vot_handleCount (void)
 Get the number of handle_t used (private method).
void vot_handleCleanup (void)
 Free all the handle nodes (private method).
void vot_handleError (char *msg)
 Print an error message.
void vot_endElement (void *userData, const char *name)
 CB whenever an end tag is seen (private method).
void vot_startElement (void *userData, const char *name, const char **atts)
 CB whenever a start tag is seen (private method).
void vot_charData (void *userData, const XML_Char *s, int len)
 Handle non-element character strings (private method).
void vot_startCData (void *userData)
 Handle the start of CDATA strings (private method).
void vot_endCData (void *userData)
 Handle the end of CDATA strings (private method).
void votPush (Stack *st, Element *elem)
 Push a Node to the top of the stack (private method).
ElementvotPop (Stack *st)
 Return a Node from the top of the stack (private method).
ElementvotPeek (Stack *st)
 Peek at Element on top of the Stack (private method).
Stackvot_newStack (void)
 Makes a new stack (private method).
int vot_isEmpty (Stack *st)
 Checks to see if the stack is empty (private method).
void vot_clearStack (Stack *st)
 Clear the stack (private method).
void vot_printStack (Stack *st)
 Print the name of all the stack elements (private method).


Detailed Description

Internal LIBVOTABLE definitions.

VOTPARSEP.H -- Internal LIBVOTABLE definitions.

Author:
Mike Fitzpatrick and Eric Timmermann
Date:
8/03/09

Function Documentation

char* vot_attrGet ( AttrBlock ablock,
char *  name 
)

Get an attribute's value (private method).

vot_attrGet -- Get an attribute's value (private method).

Parameters:
*ablock An AttrBlock to insert these attributes
*name A string that hold the name of an attribute
Returns:
Value of the attribute or NULL

int vot_attrSet ( AttrBlock ablock,
char *  name,
char *  value 
)

Set/Create an attributes (private method).

***************************************************************************

Public Internal Methods. The procedures are used to implement the library, however are not part of the public interface.

vot_attrSet -- Set/Create an attributes (private method).

Parameters:
ablock An AttrBlock to insert these attributes.
name A string that hold the name of an attribute.
value A string that hold the value of an attribute.
Returns:
The status of the request. 1 Success, 0=FAIL.
Warning:
If an attribute has no name/value, this will not create it.

char* vot_attrXML ( AttrBlock ablock  ) 

Get the attributes for an XML tag (private method).

vot_attrXML -- Get the attributes for an XML tag (private method).

Parameters:
*ablock An AttrBlock to insert these attributes
Returns:
A string containing the attributes for an XML tag

void vot_charData ( void *  user,
const XML_Char *  s,
int  len 
)

Handle non-element character strings (private method).

vot_charData -- Handle non-element character strings (private method)

Parameters:
user User data (not used)
s content string
len length of string
Returns:
nothing

vot_clearStack ( Stack st  ) 

Clear the stack (private method).

vot_clearStack -- Clear the stack (private method)

Parameters:
st A pointer to a Stack
Returns:
nothing

char* vot_elemName ( Element e  ) 

Get the name of the Element (private method).

vot_elemName -- Get the name of the Element (private method).

Parameters:
*e A pointer to the Element that you want the name of
Returns:
A string pointer to the name of the element

int vot_elemType ( Element e  ) 

Get the integer value (ID) of the Element (private method).

vot_elemType -- Get the integer value (ID) of the Element (private method)

Parameters:
e A pointer to the Element that you want the type of
Returns:
An integer corresponding to the type of the element

char* vot_elemXML ( Element e  ) 

Builds a string of the opening XML Tag (private method).

vot_elemXML -- Builds a string of the opening XML Tag (private method)

Parameters:
*e A pointer to an Element
Returns:
A string that contains the opening XML tag for e

char* vot_elemXMLEnd ( Element e  ) 

Build a string of the ending XML Tag (private method).

vot_elemXMLEnd -- Build a string of the ending XML Tag (private method)

Parameters:
*e A pointer to an Element
Returns:
A string that contains the ending XML tag for e

void vot_endCData ( void *  user  ) 

Handle the end of CDATA strings (private method).

vot_endCData -- Handle the end of CDATA strings (private method)

Parameters:
user User data (not used)
Returns:
nothing

void vot_endElement ( void *  user,
const char *  name 
)

CB whenever an end tag is seen (private method).

vot_endElement -- CB whenever an end tag is seen (private method)

Parameters:
user User data (not used)
name The name in the XML tag
Returns:
nothing

int vot_eType ( char *  name  ) 

Get the integer value (ID) of the name (private method).

vot_eType -- Get the integer value (ID) of the name (private method).

Parameters:
name Name of the desired type
Returns:
An integer corresponding to the type of the element

void vot_freeHandle ( handle_t  handle  ) 

Free a handle for use (private method).

vot_freeHandle -- Free a handle for use (private method)

Parameters:
handle A handle_t to the Element you wish to free
Returns:
nothing

Element* vot_getElement ( handle_t  handle  ) 

Get the Element refered to by handle_t (private method).

vot_getElement -- Get the Element refered to by handle_t (private method)

Parameters:
handle A handle_t to the Element.
Returns:
A pointer to the requested Element.

void vot_handleCleanup ( void   ) 

Free all the handle nodes (private method).

vot_handleCleanup -- Free all the handle nodes (private method)

Returns:
nothing

int vot_handleCount ( void   ) 

Get the number of handle_t used (private method).

count of current used handles vot_handleCount -- Get the number of handle_t used (private method)

Returns:
The number of handle_t types currently stored

void vot_handleError ( char *  msg  ) 

Print an error message.

vot_handleError -- Print an error message.

Returns:
nothing

int vot_isEmpty ( Stack st  ) 

Checks to see if the stack is empty (private method).

vot_isEmpty -- Checks to see if the stack is empty (private method)

Parameters:
st A pointer to a Stack
Returns:
1 if true, 0 if false.

handle_t vot_lookupHandle ( Element elem  ) 

Lookup the handle_t to an Element (private method).

vot_lookupHandle -- Lookup the handle_t to an Element (private method)

Parameters:
*elem A pointer to an Element
Returns:
A handle_t to the Element

Element* vot_newElem ( unsigned int  type  ) 

Allocate a new structure of the given type (private method).

vot_newElem -- Allocate a new structure of the given type (private method)

Parameters:
type An integer that defines the type of Element
Returns:
An new Element structure

void vot_newHandleTable ( void   ) 

Initialize a handle table (private method).

vot_newHandleTable -- Initialize a handle table (private method)

Returns:
nothing

Stack * vot_newStack ( void   ) 

Makes a new stack (private method).

vot_newStack -- Makes a new stack (private method)

Returns:
A pointer to a new Stack.

vot_printStack ( Stack st  ) 

Print the name of all the stack elements (private method).

vot_printStack -- Print the name of all the stack elements (private method)

Parameters:
st A pointer to a Stack
Returns:
nothing

handle_t vot_setHandle ( Element elem  ) 

Assign the Element a handle_t (private method).

vot_setHandle -- Assign the Element a handle_t (private method)

Parameters:
elem A pointer to an Element to be assigned a handle_t.
Returns:
A handle_t refering to elem

void vot_startCData ( void *  user  ) 

Handle the start of CDATA strings (private method).

vot_startCData -- Handle the start of CDATA strings (private method)

Parameters:
user User data (not used)
Returns:
nothing

void vot_startElement ( void *  user,
const char *  name,
const char **  atts 
)

CB whenever a start tag is seen (private method).

vot_startElement -- CB whenever a start tag is seen (private method)

Parameters:
user User data (not used)
name The name in the XML tag.
atts An array of attributes.
Returns:
nothing

Element * votPeek ( Stack st  ) 

Peek at Element on top of the Stack (private method).

votPeek -- Peek at Element on top of the Stack (private method)

Parameters:
st A pointer to a Stack
Returns:
A pointer to the head Element, or NULL if empty

Element * votPop ( Stack st  ) 

Return a Node from the top of the stack (private method).

votPop -- Return a Node from the top of the stack (private method)

Parameters:
st A pointer to a Stack
Returns:
A pointer to the popped Element.

votPush ( Stack st,
Element elem 
)

Push a Node to the top of the stack (private method).

votPush -- Push a Node to the top of the stack (private method)

Parameters:
st A pointer to a Stack
elem A pointer to an element to be put on the stack
Returns:
nothing


Generated on Wed Feb 27 21:10:09 2013 for libVOTable by  doxygen 1.5.9