The C VOTable Parser Library.

[Introduction]- [Download]- [Tutorial]- [Reference]

Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

votable.h File Reference

libVOTable header file More...

#include <stdio.h>
#include <stdlib.h>
#include <libxml/xmlmemory.h>
#include <libxml/xmlreader.h>

Data Structures

struct  _list_field
 Structure dedicated to FIELD tag. More...

struct  _list_table
 Structure dedicated to TABLE tag. More...

struct  _list_tabledata
 Structure dedicated to TABLEDATA tag. More...

struct  _VOTable
 Main structure. More...


Defines

#define DEBUG(x)   printf(x)
#define RETURN_OK   0
 One of Codes returned by functions.

#define RETURN_ERROR   1
 One of Codes returned by functions.

#define EXIT_MEMORY   2
 One of Codes returned by functions.

#define EXIT_READING   3
 Can't open file.

#define QMALLOC(ptr, typ, nel)
 Macro for memory allocation.


Typedefs

typedef _list_field list_field
typedef _list_tabledata list_tabledata
typedef _list_table list_table
typedef _VOTable VOTable

Functions

xmlTextReaderPtr Init_VO_Parser (const char *filename, VOTable *votablePtr)
 Parser initialization
PURPOSE : Initializing of VOTable structure and creating xmlTextReader pointer.

int Free_VO_Parser (xmlTextReaderPtr reader, VOTable *votablePtr, int **column)
 VO_Parser memory free
PURPOSE : Free VOTable structure, column and xmlTextReader.

void Extract_VO_Fields (xmlTextReaderPtr reader, VOTable *votablePtr, int *nbFields, int **columns)
 Procedure to extract FIELD attribute
PURPOSE : Free field linking list if needed, extracts FIELD attributes from VOTABLE file and stores them in VOTable structure.

int Extract_VO_TableData (xmlTextReaderPtr reader, VOTable *votablePtr, int nbcolumns, int *columns)
 Procedure to extract TD tag attributes and values
PURPOSE : Free tabledata linking list if needed, Extracts TD attributes and values from VOTABLE file and stores them in VOTable structure.

void Extract_Att_VO_Table (xmlTextReaderPtr reader, VOTable *votablePtr)
 Procedure extracting TABLE tag attributes
PURPOSE : Free table linking list if needed, extracts TABLE attributes from VOTABLE file and stores them in VOTable structure.

int Move_to_Next_VO_Fields (xmlTextReaderPtr reader)
 Move reader to the first FIELD tag contained in the next TABLE tag
PURPOSE : Try to move to the first FIELD tag embedded in the next TABLE tag.

int Move_to_Next_VO_Table (xmlTextReaderPtr reader)
 Try to move to the next TABLE tag
PURPOSE : Try to move to the next TABLE tag.


Detailed Description

libVOTable header file


Define Documentation

#define DEBUG  )     printf(x)
 

#define EXIT_MEMORY   2
 

One of Codes returned by functions.

is return when there is not enough memory

#define EXIT_READING   3
 

Can't open file.

exit with EXIT_MEMORY value when xmlReaderForFile function failed

#define QMALLOC ptr,
typ,
nel   ) 
 

Value:

{if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
                  error(EXIT_MEMORY, "Not enough memory for ", \
                        #ptr " (" #nel " elements) !");;}
Macro for memory allocation.

#define RETURN_ERROR   1
 

One of Codes returned by functions.

is returned when the function failed

#define RETURN_OK   0
 

One of Codes returned by functions.

is returned when the function successed


Typedef Documentation

typedef struct _list_field list_field
 

typedef struct _list_table list_table
 

typedef struct _list_tabledata list_tabledata
 

typedef struct _VOTable VOTable