MS_FIND_RECLEN(3)
π MS_FIND_RECLEN(3) π
okay so bestie, welcome to ms_find_reclen(3) β it lives in the Library Functions Manual and it's literally the girl who figures out how big a SEED record is. no cap.
β¨ NAME β¨
ms_find_reclen β figure out the data length of a SEED record π
π¦ SYNOPSIS π¦
#include <libmseed.h>
int ms_find_reclen ( const char *recbuf, int recbuflen,
FILE *fileptr );
πΈ DESCRIPTION πΈ
so like, ms_find_reclen checks that the recbuf buffer you handed it actually contains a SEED data record β it does this by looking for data record signatures in the fixed section data header. and then it figures out the data record length. the way it does that is lowkey a two-step:
- it searches the buffer up to
recbuflenbytes looking for a Blockette 1000, and if that doesn't work out, - if
fileptris notNULL, it reads the next 48 bytes from the file and goes looking for a data record signature (because spotting the next data record implies the length of the current one π).
and super important: if any data gets read from fileptr, the read position gets put right back to where it was before this function was ever called. we respect boundaries here π
the MS_ISVALIDHEADER macro is what verifies the buffer has a valid SEED data record in it. and when you're searching for the next record header to determine record length, one of the macros MS_ISVALIDHEADER or MS_ISVALIDBLANK has to test positively for a record to actually be detected.
oh and blank/noise records? those are records with a valid SEED sequence number followed by ASCII space characters all the way to the end of the record. iconic behavior honestly.
ms_find_reclen will return 0 when it detects the buffer contains a SEED data record but it just cannot determine the record length. this happens when no Blockette 1000 is not found within recbuflen bytes and β assuming a valid fileptr was supplied β no record header is detected in the next 48 bytes of the file.
the whole idea here is that you then read more data from the file (i.e. the next larger, valid record length) and call ms_find_reclen again. and again. and again. until the record length can finally be determined. it's giving patience, fr fr π§
π RETURN VALUES π
- the length of the Mini-SEED record in bytes, or
0if a data record was detected but the length could not be determined, or-1when no data record was detected at all π
β SEE ALSO β
ms_readmsr(3), ms_readtraces(3) and msr_unpack(3) β go read your sisters, they're all slaying π«Ά
π AUTHOR π
Chad Trabant IRIS Data Management Center
that's the whole vibe, bestie β stay valid, stay detected, and may your Blockette 1000 always show up on the first try πβ¨
Libmseed API Β· 2006/11/08 Β· mwah π thanks for reading, ily, bye!! ππ¦π
π¦ where this page comes from
- debian bookworm: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- debian trixie: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libmseed-doc 2.19.6-3 Β· LGPL-3.0-or-later
- ubuntu noble: libmseed-doc 2.19.8-1ubuntu2 Β· LGPL-3.0-or-later
- ubuntu questing: libmseed-doc 2.19.8-1ubuntu2
- ubuntu resolute: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- ubuntu stonking: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms