1MS_FIND_RECLEN(3) Library Functions Manual MS_FIND_RECLEN(3)
2
3
4
6 ms_find_reclen - Determine SEED record data length
7
8
10 #include <libmseed.h>
11
12 int ms_find_reclen ( const char *recbuf, int recbuflen,
13 FILE *fileptr );
14
15
17 ms_find_reclen verifies that the specified recbuf buffer contains a
18 SEED data record by looking for data record signatures in the fixed
19 section data header and determines the data record length by 1) search‐
20 ing the buffer up to recbuflen bytes for a Blockette 1000 and, failing
21 that, 2) if fileptr is not NULL reading the next 48 bytes from the file
22 and looking for a data record signature (with detection of the next
23 data record implying the length of the current record). If data is
24 read from fileptr the read position is returned to it's position prior
25 to this function call.
26
27 The MS_ISVALIDHEADER macro is used to verify that the buffer contains a
28 valid SEED data record. When searching for the next record header to
29 determine record length one of the macros MS_ISVALIDHEADER or
30 MS_ISVALIDBLANK must test positively for a record to be detected.
31 Blank/noise records are records with a valid SEED sequence number fol‐
32 lowed by ASCII space characters to the end of the record.
33
34 ms_find_reclen will return 0 when it detects that the buffer contains a
35 SEED data record but cannot determine the record length. This happens
36 when no Blockette 1000 is not found within recbuflen bytes and, assum‐
37 ing a valid fileptr is supplied, no record header is detected in the
38 next 48 bytes of the file. The idea is to then read more data from the
39 file (i.e. the next larger, valid record length) and call
40 ms_find_reclen again and so on until the record length can be deter‐
41 mined.
42
43
45 ms_find_reclen returns the length of the Mini-SEED record in bytes or 0
46 if a data record was detected but the length could not be determined or
47 -1 when no data record was detected.
48
49
51 ms_readmsr(3), ms_readtraces(3) and msr_unpack(3).
52
53
55 Chad Trabant
56 IRIS Data Management Center
57
58
59
60Libmseed API 2006/11/08 MS_FIND_RECLEN(3)