Crewes Seismic I/O Library File Index. Function Documentation. Functions to access seimic header definitions, страница 11

Compares two header definition nodes based on the header name.

·  SeisioHdrDefnTree* seisioHdrDefn_newTree ()

Creates a new empty AVL tree typecast to a SeisioHdrDefn tree.

Detailed Description

seismic file header-word-definition object.

Soon to be using avlmap: http://phil.ipal.org/freeware/avlmap/avlmap-0.9.15/html/index.html

Function Documentation

int seisioHdrDefn_close (int id)

Deallocates memory for the corresponding seismic header definition instance.

If no other instances are using the associated definition file, it is closed.

id identification number of the seismic definition instance to access

int seisioHdrDefn_compareNodes (SeisioHdrDefnNode * a, SeisioHdrDefnNode * b, void * param)

Compares two header definition nodes based on the header name.

Parameters:

a   left-side of comparison

b   right-side of comparison

param   not used

Returns:

positive if a > b, negative if a < b and 0 if a==b

int seisioHdrDefn_get (int id, const char * hdrName, char hdrType, int * type, int * byte)

Find header definition corresponding to a name and type (file or header).

Sets type and byte to -1 if header name/type does not exist. Returns non-zero on error (see seisio.h for error definitions).

Parameters:

id   identification number of the seismic definition instance to access 

hdrName   name of the header to lookup

hdrType   type of header ('F' or 'T')

type   output argument for type of header definition data (see seisio.h for definitions)

byte   output argument for byte index of header definition

char ** seisioHdrDefn_getHdrDescriptions (int id, char hdrType, int * numHdrDescriptions, int * errNum)

Returns an array of strings containing all the current header descriptions.

Parameters:

id   identification number of the seismic definition instance to access

hdrType   header type to access ('F' or 'T')

numHdrNames   number of header descriptions (length of returned array)

errNum   non-zero on error (see seisio.h for error definitions)

char ** seisioHdrDefn_getHdrNames (int id, char hdrType, int * numHdrNames, int * errNum)

Returns an array of strings containing all the current header names.

Parameters:

id   identification number of the seismic definition instance to access

hdrType   which class of header to access 'F' for file headers, 'T' for trace headers.

numHdrNames   number of header names (length of returned array)

errNum   non-zero on error (see seisio.h for error definitions)

Returns:

An array of strings containing all the current header names. The caller is responsible for deallocating the each of the strings AND the array. In other words, loop through each element of the array, calling free() on each element. Finish by calling free() on the array itself.

int * seisioHdrDefn_getHdrValueTypes (int id, char hdrType, int * numHdrValueTypes, int * errNum)

Returns an array of integers containing all the current header value types.

Possible header value types are I2, I4, SEISIO_FMT_F4IEEE, SEISIO_FMT_F4IBM.

Parameters:

id   identification number of the seismic definition instance to access

hdrType   header type to access ('F' or 'T')

numHdrNames   number of header names (length of returned array)

errNum   non-zero on error (see seisio.h for error definitions)

Returns:

an array of integer containing all the current header value types.

int seisioHdrDefn_loadDefaults (int id)

Initializes the seismic header definition instance from defaults.

Parameters:

id   identification number of the seismic definition instance to access

int seisioHdrDefn_new ()

Creates a new seismic header definition instance.

This new instance has no headers defined. seisioHdrDef_loadDefaults() or seisioHdrDef_loadFile(filename) are typically used to add definitions. Returns non-zero if failed. See seisio.h for error definitions.

Returns:

id Id of new header definition. Negative on error.