Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALMetaIO 4.0.6.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LIGOLwXMLRead.c File Reference

Routines to read tabular data from LIGO lightweight XML files. More...

Prototypes

int XLALLIGOLwHasTable (const char *filename, const char *table_name)
 Test a LIGO Light Weight XML file for the presence of a specific table. More...
 
int XLALLIGOLwFindColumn (struct MetaioParseEnvironment *env, const char *name, unsigned int type, int required)
 Convenience wrapper for MetaioFindColumn(), translating to XLAL-style error reporting and printing useful error messages on failure. More...
 
long long XLALLIGOLwParseIlwdChar (const struct MetaioParseEnvironment *env, int column_number, const char *ilwd_char_table_name, const char *ilwd_char_column_name)
 Convenience function to extract the integer part of an ilwd:char ID string with some error checking. More...
 

Detailed Description

Routines to read tabular data from LIGO lightweight XML files.

Author
Cannon, K. C. and Brown, D. A. and Fairhurst, S.

Description

Algorithm

None.

Uses

Notes

%% Any relevant notes.

Definition in file LIGOLwXMLRead.c.

Go to the source code of this file.

Function Documentation

◆ XLALLIGOLwHasTable()

int XLALLIGOLwHasTable ( const char *  filename,
const char *  table_name 
)

Test a LIGO Light Weight XML file for the presence of a specific table.

Returns > 0 if the document contains the table, 0 if the document does not contain the table, and < 0 on error.

BUGS:

  • This function can't tell the difference between a missing table and an unparseable document. This is a limitation in libmetaio.
  • This function parses the entire file to determine if the table is present, which is slow.
  • This entire approach to XML I/O is the wrong way to go. What's needed is a "load document" function, and a "save document" function. DO NOT attempt to write such functions by using this function to test for every possible table one-by-one and loading the ones that are found. Put the time into writing a proper XML I/O layer!!

Definition at line 85 of file LIGOLwXMLRead.c.

◆ XLALLIGOLwFindColumn()

int XLALLIGOLwFindColumn ( struct MetaioParseEnvironment *  env,
const char *  name,
unsigned int  type,
int  required 
)

Convenience wrapper for MetaioFindColumn(), translating to XLAL-style error reporting and printing useful error messages on failure.

Returns the integer index of the column, or a negative integer if the column is not found or has the wrong type. If required is non-zero, then an XLAL error is reported if the column is missing, but if required is zero then no error is generated for missing columns. When a column is found, it's type is checked and an XLAL error is reported if it does not match the requested type. Passing METAIO_TYPE_UNKNOWN disables the column type test.

Definition at line 136 of file LIGOLwXMLRead.c.

◆ XLALLIGOLwParseIlwdChar()

long long XLALLIGOLwParseIlwdChar ( const struct MetaioParseEnvironment *  env,
int  column_number,
const char *  ilwd_char_table_name,
const char *  ilwd_char_column_name 
)

Convenience function to extract the integer part of an ilwd:char ID string with some error checking.

If either of ilwd_char_table_name or ilwd_char_column_name is not NULL, then the corresponding portion of the ilwd:char string must match it exactly. The return value is the recovered integer suffix or < 0 on failure.

Definition at line 168 of file LIGOLwXMLRead.c.