Functions | |
int | dl_splitstreamid (char *streamid, char *w, char *x, char *y, char *z, char *type) |
Split a stream ID into separate components: "W_X_Y_Z/TYPE". More... | |
int | dl_bigendianhost () |
Determine byte order of host machine. More... | |
double | dl_dabs (double value) |
Return absolute value of double value. More... | |
int | dl_readline (int fd, char *buffer, int buflen) |
Read a line from a file stream. More... | |
General utility functions.
Version: 2008.192
int dl_bigendianhost | ( | void | ) |
Determine byte order of host machine.
Determine the byte order of the host machine. Due to the lack of portable defines to determine host byte order this run-time test is provided. The code actually tests for little-endianess, the only other alternative is assumed to be big endian.
double dl_dabs | ( | double | value) |
Return absolute value of double value.
Determine the absolute value of an input double, actually just test if the input double is positive multiplying by -1.0 if not and return it.
int dl_readline | ( | int | fd, |
char * | buffer, | ||
int | buflen | ||
) |
Read a line from a file stream.
Read characters from a stream (specified as a file descriptor) until a newline character '
' is read and place them into the supplied buffer. Reading stops when either a newline character is read or buflen-1 characters have been read. The buffer will always contain a NULL-terminated string.
int dl_splitstreamid | ( | char * | streamid, |
char * | w, | ||
char * | x, | ||
char * | y, | ||
char * | z, | ||
char * | type | ||
) |
Split a stream ID into separate components: "W_X_Y_Z/TYPE".
Split stream ID into separate components from the composite form: "W_X_Y_Z/TYPE" where the underscores and slash separate the components. Memory for each component must already be allocated. If a specific component is not desired set the appropriate argument to NULL.
While the stream name components are completely generic the (strongly) suggested form for geophysical data is "NET_STA_LOC_CHAN/TYPE" where NETwork, STAtion, LOCation and CHANnel follow the FDSN SEED conventions.