|
libmseed 3.4.1
The miniSEED data format library
|
General utilities. More...
Macros | |
| #define | ms_dabs(val) |
Functions | |
| uint8_t | ms_samplesize (char sampletype) |
| Determine data sample size for each type. | |
| int | ms_encoding_sizetype (uint8_t encoding, uint8_t *samplesize, char *sampletype) |
| Return sample size and/or type for given encoding value. | |
| const char * | ms_encodingstr (uint8_t encoding) |
| Descriptive string for data encodings. | |
| const char * | ms_errorstr (int errorcode) |
| Descriptive string for library Return codes. | |
| nstime_t | ms_sampletime (nstime_t time, int64_t offset, double samprate) |
| Calculate the time of a sample in an array. | |
| int | ms_bigendianhost (void) |
| Runtime test for host endianess. | |
| int64_t | lmp_ftell64 (FILE *stream) |
| int | lmp_fseek64 (FILE *stream, int64_t offset, int whence) |
| uint64_t | lmp_nanosleep (uint64_t nanoseconds) |
| Sleep for a specified number of nanoseconds. | |
| nstime_t | lmp_systemtime (void) |
| Return the current system time. | |
| int | lmp_strncasecmp (const char *s1, const char *s2, size_t n) |
| Case-insensitive, ASCII-only string comparison. | |
| uint32_t | ms_crc32c (const uint8_t *input, int length, uint32_t previousCRC32C) |
General utilities.
| #define ms_dabs | ( | val | ) |
DEPRECATED legacy implementation of fabs(), now a macro
|
extern |
Determine data sample size for each type.
| [in] | sampletype | Library sample type code:
|
|
extern |
Return sample size and/or type for given encoding value.
Determine the decoded sample size and/or type based on data encoding. The samplesize and sampletype values will only be set if not NULL, allowing lookup of either value or both.
| [in] | encoding | Data sample encoding code |
| [out] | samplesize | Size of sample, pointer that will be set |
| [out] | sampletype | Sample type, pointer to char that will be set |
|
extern |
Descriptive string for data encodings.
| [in] | encoding | Data sample encoding code |
|
extern |
Descriptive string for library Return codes.
| [in] | errorcode | Library error code |
Calculate the time of a sample in an array.
Given a time, sample offset and sample rate/period calculate the time of the sample at the offset.
If samprate is negative the negated value is interpreted as a sample period in seconds, otherwise the value is assumed to be a sample rate in Hertz.
If leap seconds have been loaded into the internal library list: when a time span, from start to offset, completely contains a leap second, starts before and ends after, the calculated sample time will be adjusted (reduced) by one second.
| [in] | time | Time value for first sample in array |
| [in] | offset | Offset of sample to calculate time of |
| [in] | samprate | Sample rate (when positive) or period (when negative) |
|
externinline |
Runtime test for host endianess.
|
extern |
Portable version of POSIX ftello() to get file position in large files
|
extern |
Portable version of POSIX fseeko() to set position in large files
|
extern |
Sleep for a specified number of nanoseconds.
Portable version of POSIX nanosleep() to sleep for nanoseconds
Sleep for a given number of nanoseconds. Under WIN use SleepEx() and is limited to millisecond resolution. For all others use the POSIX.4 nanosleep(), which can be interrupted by signals.
| nanoseconds | Nanoseconds to sleep |
|
extern |
Return the current system time.
Portable function to return the current system time
Current system time is returned as an nstime_t value. Under Windows this has millisecond precision as returned by _ftime_s() and for all other platforms the precision returned by gettimeofday() up to microseconds.
|
extern |
Case-insensitive, ASCII-only string comparison.
Portable function for case-insensitive, ASCII-only string comparison
Compare two strings up to n characters, ignoring case. This function is ASCII-only and does not handle multibyte characters.
| [in] | s1 | First string to compare |
| [in] | s2 | Second string to compare |
| [in] | n | Maximum number of characters to compare |
|
extern |
Return CRC32C value of supplied buffer, with optional starting CRC32C value