Scroll to navigation

MS_LOOKUP(3) Library Functions Manual MS_LOOKUP(3)

NAME

ms_lookup - Look up libmseed and Mini-SEED related information

SYNOPSIS

#include <libmseed.h>
char    *ms_errorstr ( int errorcode );
uint8_t  ms_samplesize ( const char sampletype );
char    *ms_encodingstr ( const char encoding );
char    *ms_blktdesc ( uint16_t blkttype );
uint16_t ms_blktlen ( uint16_t blkttype, const char *blktdata,
                      flag swapflag );

DESCRIPTION

ms_errorstr returns a pointer to a string describing the specified libmseed error code. The error codes are defined in libmseed.h and returned by various functions.

ms_samplesize returns the sample size based on the specified sampletype. In general libmseed uses the following character sample types:

"a" = 1 byte (ASCII)
"i" = 4 bytes (integer)
"f" = 4 bytes (float)
"d" = 8 bytes (double)

ms_encoding returns a pointer to a string describing the specified data encoding format. If the encoding format is unknown an appropriate string is return stating just that.

ms_blktdesc returns a pointer to a string describing the specified blockette type (blkttype). If the blockette type is unknown NULL is returned.

ms_blktlen returns the total length of the specified blockette type (blkttype) in bytes. A pointer to the blockette itself (blkt) should also be provided along with a swapflag that should be set to 1 when the blockette is known to have a different byte order than the host computer. The length returned includes both the blockette "header" (type and next fields) and "body".

Technically a pointer to blockette and the swapflag only need to be supplied when the blockette type is a variable length blockette and the length is contained within the blockette itself (e.g. blockette type 2000). For blockettes of known fixed length (most of them) the blkt pointer and swapflag are not used.

In the case of blockette type 405 that is variable length and not self describing 0 will be returned. In the case of blockette type 2000 that is variable length and self describing the length will be read from a known offset into the blockette data.

RETURN VALUES

ms_errorstr returns a pointer to a static string.

ms_samplesize returns the sample size in bytes or 0 for unknown sample type.

ms_encoding returns a pointer to a static string.

ms_blktdesc returns a pointer to a static string or NULL if the blockette type is unknown.

ms_blktlen returns the total length of the specified blockette type or 0 for unknown type.

AUTHOR

Chad Trabant
IRIS Data Management Center
2006/12/12 Libmseed API