-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathChangeLog
More file actions
1812 lines (1534 loc) · 80.1 KB
/
Copy pathChangeLog
File metadata and controls
1812 lines (1534 loc) · 80.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2026.217: v3.5.4
- Trace list packing optimization and improvement:
* Reuse the record packer and its buffers across trace-list segments.
* Skip speculative allocation when not enough samples for a v3 record.
* Resume the trace-list pack scan where it left off.
* Reduce system time calls.
- Resolve year and month in ms_gmtime64_r() with closed-form arithmetic.
- Return MS_ENDOFFILE instead of MS_NOTSEED when selections skip every record
in a stream.
2026.211: v3.5.3
- Optimize segment searches by tracking recently-active segments per trace ID,
a significant improvement for creating trace lists from near time ordered
input data.
- End the segment search early once a segment starts beyond the record
end plus tolerance, as no later segment can match in the sorted list.
- Search backward from the last segment for zero sample rate records,
which can only match a following segment, avoiding a full list scan.
- Avoid FP division in sample rate comparisons: short-circuit identical
rates and use a multiplicative form of MS_ISRATETOLERABLE().
2026.208: v3.5.2
- Add MSF_RECORDLIST_NOEXTRAS to skip copying extra headers into
MS3RecordList entries when building a record list.
- Reject a blockette offset within the fixed header as fatal.
- Break ms_parse_raw2() blockette walk on unknown length, treat a
self-referential next offset as fatal, add Blockette 405 length.
- Reject sample count that would overflow size_t when converting to
doubles in mstl3_convertsamples(), avoiding undersized malloc on 32-bit.
- Reject size_t overflow in libmseed_memory_prealloc() growth loop,
avoiding an infinite hang on huge allocation requests.
- Free duplicated MS3Record when record-list entry allocation fails.
- Reject out-of-range leap-second epochs in ms_readleapsecondfile().
2026.206: v3.5.1
- Set MS3RecordPtr.msr->record to NULL when the raw record is not available,
instead of leaving it dangling to a source buffer that may be freed or
reused.
- Accept a /FDSN/Calibration/Sequence/Type of ABORT when packing miniSEED v2,
so a Blockette 395 read from a v2 record can be written back out.
- Reject a /FDSN/Calibration/Sequence with a missing or non-string /EndTime
when a Blockette 395 is the only representation, instead of silently
writing no blockette.
- Add msr3_duplicate_extra() to allow independent control of extra header
duplication, with msr3_duplicate() now a thin wrapper that preserves its
original always-copy behavior.
- Export ms3_msfp_init(), msr3_duplicate_extra(), ms_rlog_pop() and
libmseed_memory_prealloc() in libmseed.def, so they are available from
Windows DLL builds as they already are elsewhere.
2026.205: v3.5.0
Important fixes and changes:
- Fix v2 miniSEED time encoding to use the carried second when 100 µs rounding
rolls over, so continuation records and BTIME-encoded blockette times are no
longer written one second early.
- Fix cumulative start-time rounding drift when repeatedly packing partial
trace segments by projecting new start times using the apparent rate
implied by segment start and end times.
- Add Blockette 1001 to v2 records whenever the sample period is not an
integer number of 100 µs units.
- Write Blockette 100 sample rate as Hz via msr3_sampratehz() instead of raw
msr->samprate, so period-notation rates are not stored as negative Hz.
- Fix msr3_repack_mseed2() fit check to use the original record length
instead of the destination buffer length, avoiding silent truncation of
encoded data when the destination buffer is larger than the record.
- Fix out-of-bounds write in msr3_repack_mseed2() by checking the destination
buffer size before zero-filling padding ahead of Steim-encoded data.
- Fix invalid free of a caller-owned extra-headers buffer when packing
multiple trace list segments with mstl3_pack_next().
- Fix mstl3_pack_next() silently dropping the sample remainder of a
MSF_MAINTAINMSTL segment that could not fill a full record; each
segment is now packed completely (MSF_FLUSHDATA implied) the first
time it is visited, since the trace list is not trimmed and a partial
record cannot be completed on a later call.
- A field was added to the LMIO struct, ABI-compatible, documented as internal.
Minor fixes, hardening, cleanup:
Reading and I/O:
- Fix possible infinite loop in msio_fread() by clearing the curl pause flag
before unpausing, since curl_easy_pause() may synchronously invoke the
write callback and re-pause before the flag is cleared.
- Fix msio_fopen() to reset CURLOPT_HEADERFUNCTION along with CURLOPT_HEADERDATA
after reading response headers, so a later header callback invoked for HTTP
trailers cannot abort the transfer or dereference a stale pointer.
- Add connection and stall timeouts for URL transfers, configurable with
ms3_url_timeout() or the LIBMSEED_URL_TIMEOUT environment variable, so a
server that stops responding mid-transfer no longer hangs indefinitely.
- Detect failed URL transfers instead of reporting them as end-of-file.
- Fail when an HTTP server ignores a requested byte Range and returns the
full body, instead of silently relabeling the start offset and returning
records outside the requested range.
- Enforce the end offset of a byte range on local file reads so a record
extending past the end offset is reported as truncated (MS_ENDOFFILE),
matching the existing behavior for URL byte-range reads.
- Reject byte range values above INT64_MAX in path name suffixes and HTTP
Content-Range headers, and reject a negative start or end offset when
opening a stream, instead of silently wrapping to a negative offset.
- Reject a path or URL longer than the internal buffer in ms3_readmsr()
instead of silently truncating it and opening the wrong resource.
Record parsing and decoding:
- Fix out-of-bounds reads on truncated Blockette 2000 in ms_parse_raw2().
- Fix one-byte stack overflow when decoding the Blockette 500 timing
exception type and clock status, and serialize them by bounded length
so full-width values are neither truncated nor concatenated.
- Fix msr3_resize_buffer() and msr3_unpack_data() to use a temporary pointer
for realloc(), avoiding a leak of the original data buffer and a NULL
datasamples pointer left with a non-zero sample count on allocation
failure.
- Fix msr3_data_bounds() Steim trailing-empty-frame scan to inspect the
payload's actual final frame instead of bytes offset by the header size.
- Fix Blockette 500 microsecond precision from being added to an unset or
invalid decoded time, which fabricated a timing-exception time. Also stop
invalid blockette times from being written to extra headers as the
literal string "ERROR".
- Fix GEOSCOPE 24-bit decoding to assemble the 3-byte sample using the
record's actual byte order instead of a host-order union read-back, which
corrupted amplitudes for little-endian-declared GEOSCOPE24 payloads.
This is only for completeness, such data may not exist.
- Reject v2 records with an unset (year 0) start time instead of applying
time corrections to the sentinel and producing a fabricated ~1901 time.
- Reject miniSEED v3 records with a non-finite fixed-header sample rate,
and ignore an invalid Blockette 100 sample rate instead of applying it.
- Fix leak of the extra-headers JSON parse state on error returns from the
v2 blockette loop in msr3_unpack_mseed2(), and avoid orphaning the first
allocation when a record contains two Blockette 1001s.
Trace lists:
- Fix NULL dereference in mstl3_free() when the trace list pointer is NULL.
- Reject a decoded sample buffer size that overflows size_t in
mstl3_unpack_recordlist(), avoiding a heap overflow on 32-bit hosts
when a segment holds close to 4 GiB of samples.
- Fix mstl3_addmsr() to honor a sample rate tolerance callback returning 0.0
as an exact match instead of falling back to the default tolerance, and warn
and use the default when a time or sample rate tolerance callback returns a
negative value.
- Update MS3TraceID.earliest/latest after packing consumes or removes trace
segment data so they no longer report stale extents.
- Reject unrecognized target sample types in mstl3_convertsamples() instead of
returning success with the data left unconverted.
- Fix mstl3_convertsamples() silently converting NaN and out-of-range float
and double samples to garbage integer values, and leaving the samples
partially converted when a value is rejected.
Packing and writing:
- Fix mstl3_pack_next() to re-sync its segment data pointer before packing,
avoiding a stale pointer when mstl3_addmsr() reallocates the buffer
between calls, and reject a segment prepend during active packing.
- Reject a non-positive record length in msr3_repack_mseed2(), avoiding a
large out-of-bounds write when repacking a record with an unset reclen.
- Fix data-offset overflow in msr3_repack_mseed2() that could hang on
Steim-encoded input or corrupt non-Steim output when an oversized header
pushed the data offset past 65535.
- Prevent overflow on sample-count when writing miniSEED v2.
- Fix mstl3_writemseed() to detect output write, flush, and close
failures and return -1 instead of reporting a false success count
on a full or read-only filesystem.
- Fix negative /FDSN/Time/Correction values rounding toward zero instead of
to the nearest 100 µs unit when written to miniSEED v2.
- Fix mstl3_pack_free() to include samples from an active segment packing
session in the returned packed sample count instead of discarding them,
and to not under-report packed samples when mstl3_pack_next() aborts
because the actively-packed segment was merged or removed.
- Reject an unset or error start time in msr3_pack_init() instead of
silently packing v2/v3 records dated 1902-001T00:00:00.
- Warn when packing miniSEED 2 with a start year outside 1900-2100.
- Reject a sample rate beyond the representable miniSEED 2 nominal rate,
and NaN, before converting it to an integer when reducing the rate to a
factor and multiplier, instead of converting it out of range.
Extra headers:
- Fix mseh_set_ptr_r() to avoid deleting the existing header value at a JSON
Pointer and reporting success when a value allocation fails (e.g. OOM).
- Fix mseh_get_ptr_type() and mseh_get_ptr_r() to consult a supplied
parsestate before reporting "not found" on a record with no serialized
extra headers, so a set-then-get through the same parsestate works on a
fresh record.
- Fix mseh_get_ptr_r() returning a bit-reinterpreted negative value for type
'i' requests on extra header integers that are unsigned and out of range
for int64_t, instead of the wrong-type indicator.
- Limit extra-header float precision per-value instead of document-wide, so
large or pre-existing values are not lost or rejected.
Time handling:
- Fix ms_sampletime() to adjust for every leap second contained in a span
instead of only the first.
- Parse fractional seconds in time strings locale-independently so
period-decimal fractions are not silently dropped under comma-decimal
locales (LC_NUMERIC).
- Fix sign loss for negative sub-second epoch times (e.g. -0.5) when printing
and parsing UNIXEPOCH/NANOSECONDEPOCH time strings.
- Fix ms_mdtimestr2nstime() and ms_seedtimestr2nstime() to carry a fractional
second that rounds up to 1.0 into the next second instead of rejecting the
time string as invalid.
- Fix ms_nstime2timestr_n() detection of a truncated output buffer.
- Fix ms_sampletime() to reject a non-finite or out-of-range time span
instead of casting it to an nstime_t and returning a garbage time.
- Fix ms_sampletime() to reject a negative sample offset instead of
silently returning the input time unchanged.
- Reject epoch-time strings beyond the representable nstime range.
- Reject epoch-time strings whose fractional seconds overflow the nstime
range even though the integer seconds are in range.
- Fix FILE* leak on error paths in ms_readleapsecondfile().
- Fix ms_timestr2nstime() to include the input string, instead of an
empty string, in the epoch conversion error message.
Selections:
- Fix selection file parsing to reject invalid start/end times instead of
silently treating them as open-ended selections.
- Reject a "Network Station Location Channel" selection line with a date in
the Pubversion field instead of silently dropping it and misreading the
following Starttime/Endtime fields.
- Fix ms3_readselectionsfile() to reject a 4-field SourceID selection line
with a non-integer publication version instead of silently misparsing it
as a network/station/location/channel selection.
- Reject over-long lines in ms3_readselectionsfile() instead of silently
parsing the truncated tail as a new selection line.
- Reject selection time windows whose start is later than end in
ms3_addselect().
- Fix off-by-one in selection file reading that rejected a selection line of
the documented maximum length as too long.
- Fix ms3_readselectionsfile() to count only selections actually added,
instead of also counting skipped/unrecognized lines.
- Fix FILE* leak in ms3_readselectionsfile() on error returns from the
parse loop.
Documentation:
- Document that ISO month-day time strings conform to the RFC 3339 profile.
Build:
- Discover test and example programs with globbing in the CMake test suite,
matching the Makefile, so added programs are built without editing lists.
2026.167: v3.4.1
- Improve correctness of internal glob matching routines.
- Fix inverted sample rate comparison with custom tolerance for trace lists.
- Fix selection matching for open-ended query time windows.
- Always return error from msr3_writemseed() on write or packing failure.
- Fix ms3_msfp_init() to seek the dup'd descriptor to startoffset and
set streampos accordingly.
- Avoid spurious read error when record buffer is full.
- Detect precision loss for negative samples in mstl3_convertsamples().
- Fix buffer overflow in B201 MEDSNR packing.
- Fix out-of-bounds access on long or failed log messages.
- Fix out-of-bounds read in v2 blockette chain traversal.
- Fix out-of-bounds write truncating long path with byte range suffix.
- Fix NULL dereference in msio_fopen() byte range handling.
- Use libmseed_memory.free for log registry entries.
- Fix data size truncation for large fixed-length-encoded records.
- Fix integer overflow computing v3 record length in ms3_detect().
- Fix out-of-bounds read in msr3_data_bounds() from unvalidated v2 data offset.
- Fix dangling stack pointer retained by libcurl header callback.
- Fix resource leaks on msio_fopen() error paths.
- Fix lookup for v2 Blockette lengths for uncommon blockettes for bounds checks.
- Validate input payload size against sample count in ms_decode_data().
- Propagate extra-header serialization failures in mseh_set_ptr_r().
- Fix size_t underflow in ms_sid2nslc_n() on zero-size buffers.
- Limit samples per record to 16-bit limit when packing miniSEED 2.
- Accept value 255 for B201 MEDLookback and MEDPickAlgorithm.
- Avoid undefined shift from Blockette 1000 record length exponent.
- Reject Blockette 1000 record length larger than supplied buffer.
- Guard NULL Xnp pointer in Steim byte-swap.
- Reject day-of-month 0 in VALIDMONTHDAY check.
- Fix memory leaks on error paths in extraheaders.c and tracelist.c.
- Pass unsigned char to ctype functions.
- Fix buffer overflow in msr3_repack_mseed3() from undersized buffer check.
- Limit indent in mseh_print() to avoid negative field width.
- Build: force "lib" prefix on Windows CMake library output for consistency.
- Fix tutorial example code, thanks to P. Schmidt for reporting.
2026.094: v3.4.0
- Support writing header-only records and add tests for header-only records.
2026.088: v3.3.0
- Add `ms3_msfp_init()` to initialized MS3FileParam with start/end offsets.
- Avoid closing I/O streams not opened by the library when reading or
writing miniSEED, specifically stdin and stdout or a provided descriptor.
- Update GitHub Actions dependencies for Node 24 changes.
NOTE Behavior change: I/O streams provided by the caller, such as stdin
and stdout, are no longer closed by the library.
2026.024: v3.2.4
- Add ms_rlog_pop() to return messages from the error/warning log registry
- Fix return value from ms_rlog_emit()
- Fix tracking of message count in log registry.
- Add tests for logging facility.
- Add example/lm_extraheaders.c to demonstrate extra header functionality.
2026.001: v3.2.3
- Add mseh_get_ptr_type() to determine type of an extra header.
- Add unsigned integer (uint64_t) support to `mseh_set_ptr_r()` and `mseh_get_ptr_r()`.
2025.369: v3.2.2
- Allow mseh_set_ptr_r() to create extra headers when none exist for a merge patch
using the root pointer (""). Pointers to non-root locations still must exist.
2025.354: v3.2.1
- Rename ms3_mstl_init_fd() to ms3_msfp_init_fd() and add backward compatibility.
- Add -fPIC to the build options for the static library target.
- Update internal selection matching to support `!` in addition to `^` for
character class negation and handle edge cases more robustly.
- Avoid modifying record buffer during v3 CRC check and add CRC validation to testing.
- Add v3 parsing test for ensuring header-indicated lengths are sane.
- Small fixes of logic errors and increased portability.
- Add GitHub action to build and test on multiple platforms.
- Fix Windows symbol issues and CMake configuration.
2025.315: v3.2.0
- Add generator-style packing interfaces for MS3Record and MS3TraceList.
Specifically msr3_pack_init(), msr_pack_next(), msr_pack_free() and
mstl3_pack_init(), mstl3_pack_next(), mstl_pack_free().
- Fix mstl3_pack_ppupdate_flushidle() logic to flush only idle streams.
- Fix memory leak in mseh_replace().
- Addition of a CMake build system contributed by @lsawade, thank you!
2025.303: v3.1.11
- Fix byte swapping in ms3_detect() for v3 records for big-endian systems.
- Add MSF_SKIPADJACENTDUPLICATES to skip adjacent duplicate records while
populating a MS3TraceList.
2025.298: v3.1.10
- Add MSF_SPLITISVERSION flag to control using the splitversion value as the
version instead the record publication version for mstl3_addmsr() and variants.
- Add missing functions to libmseed.def for Windows library exports.
2025.267: v3.1.9
- Add mstl3_pack_ppupdate_flushidle() for packing idle streams in combination
with the use of MSF_PPUPDATETIME during trace list additions.
- Convert mstl3_addmsr() from a macro to a real (thin) function.
2025.257: v3.1.8
- Fix segment removal from MS3TraceList when packing
2025.239:
- Add mstl3_pack_segment()
- Deprecate mstraceseg3_pack()
- mstl3_addmsr()/mstl3_addmsr_recordptr(): Ensure segments represent time
coverage before adding new samples.
2025.234: 3.1.7
- Add ms_nstime2timestr_n() with string size limit, deprecate ms_nstime2timestr().
- With ms_nstime2timestr_n() print "ERROR" for NSTERROR and "UNSET" for NSTUNSET.
- Avoid fatal errors when v2 record blockettes contain invalid time stamps.
When invalid SEED "btime" values are encountered they are now set to NSTERROR and
serialized in extra headers as "ERROR".
- Limit float point values in extra headers to single precision to avoid
unrealistically high precision values in the output
- Update yyjson to v0.12.0
2025.227:
- Properly round negative values when converting floats to integers
in mstl3_convertsamples().
2025.207: 3.1.6
- Properly propagate sub-fractional microseconds to v2 blockette 1001
when packing more than one record.
- Round sub-fractional and sub-microsecond times for v2 record fields
to retain accuracy.
- Ensure microsecond offsets in v2 record fields are -50 to +49, which
matches previous major library version behavior and SEED recommendation.
- Add msr3_repack_mseed2() to repack v2 records efficiently.
- Add -s and -R options to example/lm_pack.c.
- Fix some pedantic compiler warnings in msio.c.
2025.114: 3.1.5
- Add new functions to libmseed.map and libmseed.def for public use.
2025.113: 3.1.4
- Fix msr3_duplicate() to properly terminate duplicated extra headers.
- Add mstraceseg3_pack() to individually packet MS3TraceSeg entries.
- Add lmp_systemtime() to return current system time as nstime_t.
- Add MS3Record_INITIALIZER for efficient heap initialization of an MS3Record.
- Change the default initialization for MS3Record.starttime to NSTUNSET.
Previously this was a value of 0, corresponding to 1970-01-01T00:00:00Z.
- msr3_print(): do not force high resolution printing of sample rate.
- Add MSF_PPUPDATETIME flag to store update time (as nstime_t) at MS3TraceSeg.prvtptr.
- Add support for generating SourceIDs from SEED codes with (illegal) spaces.
- Add ms_sid2nslc_n() with destination buffer sizes for memory safety.
- Deprecate ms_sid2nslc(), supports max buffers needed for SEED codes.
- Fix some potential undefined behavior due to load of unaligned values.
2024.165: 3.1.3
- Use sequence number from extra headers (/FDSN/Sequence) if present when writing format v2.
2024.148: 3.1.2
- Update yyjson to v0.9.0.
- Simplify mstl3_addmsr_recordptr() a bit.
2024.146:
- Replace ms_dabs() with macro to use system fabs(), document as deprecated.
- Add CRC values to diagnostic message when header values does not match calculated.
2024.137:
- Add msr3_nsperiod() to calculate the sample period in nanoseconds.
- Add tests for msr3 utility functions.
2024.106:
- When writing v2 derive the quality code from the publication version when the
extra-header "/FDSN/DataQuality" is not present. Use quality indicator 'D' when
the publication version cannot be mapped, e.g. > 4.
2024.024: 3.1.1
- Change library compatibility version in Makefile to MAJOR.1.0, as this is now
incompatible with the x.0.0 releases.
2024.024: 3.1.0
BREAKING CHANGES, data structure and an API changes:
- `MS3Record.encoding` now int16_t instead of int8_t.
- `MS3Record.datalength` now uint32_t instead of uint16_t (change in 3.0.18).
- `MS3Record.datasize` and `MS3TraceSeg.datasize` now uint64_t instead of size_t.
- `ms3_detect()` now returns int64_t instead of int.
- `mstl3_unpack_recordlist()`'s `outputsize` argument is now uint64_t instead of size_t.
- `mseh_get_ptr_r()`'s `maxlength` is now uint32_t instead of size_t.
- Fix to handle full range of allowed encoding values from 0-255.
- Fix to handle detection of huge record lengths beyond MAXRECLEN gracefully.
- Add more checks to avoid writing impossible values to miniSEED v2 blockette fields.
- Fix all compiler warnings at level -Wextra for clang, gcc, and \W3 for MSVC.
2024.015:
- Fix build of DLL target on Windows by defining exports in libmseed.def.
2024.007:
- Improve formatting of gap list produced by mstl3_printgaplist().
2024.006: 3.0.18
- ms_nslc2sid() requires all codes except location to be set to reduce misuse.
- Fix raw, diagnostic generation of SIDs from miniSEED v2 when full codes are used.
- Fix handling of data length field in miniSEED v3 as 32-bits instead of 16-bits.
- Increase MAXRECLEN from 131172 to 10485760 (10 MiB) for v3 records.
- Define MAXRECLENv2 as 131172 (131+ KiB) to limit miniSEED v2 records and add
test for sample counts beyond the 16-bit field limit in v2 records when packing.
- Update yyjson to release 0.8.0.
2023.335:
- Add LMIO_FD type of reading IO via arbitrary file descriptor and hooks for setting.
- Add mseh_replace() to replace extra headers.
- Consistently initialize header values to 0, fixing edge cases like header-only records.
- Update link in documentation of ms_readleapsecondfile() for sources of leap-seconds.list.
2023.206: 3.0.17
- Add tests for default record length and encoding.
- Document versioning schema as semantic versioning.
- Add const qualifiers to packing routines that do not modify the
passed MS3Record structure.
2023.204: 3.0.16
- Additional Steim 1 & 2 decoder optimization.
- Add more const qualifiers to pointer values. Thanks @damb.
2023.185:
- Fix logic in `msr3_duplicate()` for certain cases.
- Add many const qualifiers to pointer values where the library
interface does not modify the data. Thanks @damb
2023.180:
- Add const qualifier to record pointer declarations where the
library interface does not modify the data.
2023.177:
- Incorporate ms_gswapX() functions into libmseed.h to promote inlining.
- Optimize Steim 1 & 2 decoders.
- Change test for environment variable DECODE_DEBUG to compile-time define
- Change test for environment variable ENCODE_DEBUG to compile-time define
2023.162: 3.0.15
- Print sample rate in Hz consistently in msr3_print()
- Fix writing of SNR values field 9 of Blockette 201 (v2)
- Read and write microsecond offsets to/from Blockette 500 (v2)
- Fix addition of Clock Model field 9 of Blocketee 500 (v2)
2023.160: 3.0.14
- Add FAQ to documentation and update example code to match API changes.
- Change sample type for text encoding to 't', value 'a' still supported.
2023.159:
WARNING: API change as follows:
The `fpos` and `last` arguments of ms3_readmsr(), ms3_readmsr_r(),
and ms3_readmsr_selection() have been removed. The same capabilities
is avaiable and details are included in the porting guide.
- Add JSON Merge Patch capability to mseh_set_ptr_r().
- Fix zero-padding of empty bytes following data in miniSEED v2 creation.
- Rename DE_ASCII to DE_TEXT to generalize to UTF-8, legacy mapping provided.
- Add MS3Tolerance_INITIALIZER for MS3Tolerance values.
2023.155:
WARNING: API change as follows:
The `MS3TraceList.numtraces` was renamed `MS3TraceList.numtraceids`.
- New test suite based on Tau :https://github.com/jasmcaus/tau.
Many tests were added and the suite now works on MS-Windows.
- Update example/lm_pack.c:
* Use improved test sinusuoid that contains all differences for
Steim1 and Steim2 encoding.
* Add `-2` option to generate miniSEED v2 instead of default v3.
2023.105:
- Handle special case of year 0 when parsing version 2 blockettes. These
are now treated as "unset" and not included in the extra headers.
- Add nstime_t special value of NSTUNSET for use as "unset" meaning.
2023.099:
WARNING: API change as follows:
The `path` argument to mseh_get and mseh_set routines is now in
JSON Pointer (RFC 6901) format. This is a more appropriate, and
standardized, format than the pseudo-JSON Path, dotted string style
previously used. It also allows more flexibility such as specification
of an array element.
- `mseh_get_path_r()` and `mseh_set_path_r()`, previously named without
the `_r` suffix, now take a additional `parsestate` argument. This
functionality allows the parsed extra headers to be retained between
calls to avoid re-parsing. For advanced usage, this allows more efficient
getting or setting of multiple extraheader values. If used, this state
information must be free'd with `mseh_free_parsestate()`. If used
with `mseh_set_path_r()` the headers must also be serialized with
`mseh_serialize()`.
- `mseh_get_path_r()` and `mseh_set_path_r()` accept a value type of `i`
that is used with int64_t values.
- Replace JSON library with yyjson (https://github.com/ibireme/yyjson).
Benefits include performance, shortest accurate real number representation,
JSON Pointer support, and UTF-8 support.
2023.082:
WARNING: API changes as follows:
1. mstl3_printtracelist() now takes an additional `versions` argument.
When non-zero the routine will decorate SIDs with publication versions.
1. The MS3TraceID structure is no longer a simple linked list. Instead
it is a skip list, slightly changing the syntax for traversing the list
as illustrated in the examples.
- Significant optimization for the case of constructing trace lists with
large numbers of differnt source IDs, by using a skip list. Implementation
inspired by: https://github.com/tdeck/c-skiplist, thanks @tdeck!
- Add new mstl3_findID() function for searching a trace list for specific
SourceID and, optionally, publication version.
2023.068:
- Optimize trace construction in mstl3_addmsr_recordptr() for the case
of duplicate records.
- Add 'const' declarations to ms_sid2nslc() and ms_nslc2sid() to guarantee
input will not be modified.
- Add cURL detection and full build support to example/Makefile.
- Fix logic test for LIBMSEED_NO_THREADING declaration.
2023.029: 3.0.13
- Embed current leap second list, used by default and replaced by
ms_readleapsecondfile().
2023.028:
- Add ISOMONTHDAY_DOY time string variant, with day-of-year.
- Add '_Z' variants of time string formats for trailing Z versions.
- Print record timestamp in new ISOMONTHDAY_DOY_Z format.
- Deprecated the ms_nstime2timestrz() function.
- Re-brand to EarthScope.
2022.338: 3.0.12
- Change printing of bit flag sets to print each bit flag in
most-significant-bit first order to match binary number representation.
2022.156: 3.0.11
- Generate proper HTTP Range header by always including a start value,
defaulting to 0, when a range end is specified.
- When time correction value is present always set the time correction
applied bit when creating V2 records. Thanks @nicoleroy-ipgp.
- mseedview example: always emit accumulated log messages, and print
basic summary correctly.
2022.103: 3.0.10
- Fix uninitialized file position in ms3_readtracelist_selection() (#80)
by @anowacki.
- Fix array index warning in crc32c.c.
- Update emmbedded Parson to 1.4.0.
- Simplify byte swapping routines (#75) by @QuLogic.
- Initialize selection.pubversion to 0 in ms3_readtracelist_timewin()
by @Cuda-Chen.
- Make logging facility thread safe, with per-thread parameters.
- Add lm_pararead.c example to illustrate reading miniSEED in parallel
using re-entrant interfaces and POSIX threading.
- Add Add MS_HPTIME2NSTIME and MS_NSTIME2HPTIME macros to convert
to/from version 2.x time values.
2021.234: 3.0.9
- Update Source Identifier handling to the adopted specification of:
FDSN:NET_STA_LOC_BAND_SOURCE_POSITION
2020.156: 3.0.8
- Add error/warning log registry for accumulation of messages.
- Log and diagnostic printing callbacks now require 'const char *'.
- Verbose-triggered messages are now sent to stdout instead of stderr.
2020.137:
- Add capability to read data from URLs. This feature is optional,
enabled at build time with LIBMSEED_URL and requires libcurl to be
available on the system.
2019.216:
- Copy only UTF-8 characters in ms_strncpclean(), ms_strncpcleantail(),
and ms_strncpopen().
2019.172: 3.0.7
- Add conversion of epoch values via ms_timestr2nstime().
- Allow trailing 'Z' in date-times in ms_timestr2nstime().
2019.170: 3.0.6
- Generalize ms_timestr2nstime() to detect all supported time formats.
- Rename old ms_timestr2nstime() to ms_mdtimestr2nstime().
- Change minimum valid year from 1000 to 1678 to avoid wrap-around.
- ms_nstime2timestr(): fix printing of pre-epoch values for UNIXEPOCH.
- Add test for time string parsing and conversion.
2019.166: 3.0.5
- Allow trace list packing with multiple data sample types.
2019.163:
- Portable printing of size_t values.
2019.162:
- Re-license all libmseed code under the Apache License V2.0.
2019.161: 3.0.4
- Add record record list capability, replacing segment-level record metadata.
2019.142:
- Add ability to pack miniSEED version 2 records.
2019.137:
- Allow packing records with no payload, i.e. header-only.
2019.135:
- Add pre-allocation of data buffers, enable on Windows and disable otherwise.
2019.123: 3.0.3
- Fix version splitting, clarify behavior
- Fix publication version filtering, thanks @krischer
- Allow selections without time ranges, thanks @krischer
- Normalize encoding string lookups, the SEED manual values are messy no need to perpetuate them
- Add option to build PDF manual and clarifications in documentation
- Remove steps in install target of Makefile that no longer function, thanks @senshu
2019.103: 3.0.2
- mstl3_pack() can be called without modifying the Trace List with MSF_MAINTAINMSTL flag.
- Add lm_pack_rollingbuffer.c example of generating records with a rolling buffer.
- Consistently provide extra headers as terminated string from MS3Record.extra.
- Fix segment start time tracking in mstl3_pack().
2019.102: 3.0.1
- Add mstl3_readbuffer_selection() and fix selection-based ms3_readmsr_selection().
- Use callback functions for time and sample rate tolerance instead of fixed values.
- Fix progression of record start time when packing records.
- Optionally store record-level metadata, header flags and extra headers, in a MS3TraceList.
- More documentation and examples.
2019.094: 3.0.0
- A new major version refactored to support the next generation miniSEED
Documentation including porting guide avilable at:
https://iris-edu.github.io/libmseed/
Almost all core data structures and functions have been modified,
often mostly in name (due to structure changes), so porting is required.
Major new features and changes of note:
- Support for reading/writing of miniSEED 3 and read support of miniSEED 2.
- Support for nanosecond time resolution:
The HPTMODULUS is renamed NSTMODULUS and changed for nanoseconds.
Related change of HTPERROR to NSTPERROR value.
hptime_t changed to nstime_t and all time functions changed accordingly.
The hptime2XYZtimestr() function is combined into single nstime2timestr()
function with format flag.
- Added mstl3_readbuffer() to read all records in a data buffer into a Trace List.
- Add global libmseed_memory that contains user-definable function pointers to
malloc(), realloc() and free(). This allows all memory management from the library
to be performed with user-defined functions.
- Data structure change and rename:
Rename MSRecord to MS3Record and restructure for miniSEED 3.
Rename MSTrace[ID,Seg,List] to MS3Trace[ID,Seg,List] and restructure for miniSEED 3.
Rename Selections and SelectTime to MS3Selections and MS3SelectTime.
- Remove MSTrace_s and MSTraceGroup and related functions, use MS3Trace[ID,Seg,List] instead.
- Remove all platform defines (LWP_*) except LWP_WIN for MS Windows.
- Rename all library structs by removing the "_s" suffix so they match their typedef names
- Rename macros and functions specific to miniSEED 2.x by adding "2".
- Remove packheaderbyteorder and packdatabyteorder handling and related
envrionment variables. Byte order is either detected or fixed.
- Decrease MINRECLEN from 256 to 40, decrease MAXRECLEN from 1MB to 128 KiB.
- Increase 'recbuflen' to msr3_parse[_selection]() to uint64_t to work with very large buffers.
- Remove record length specifier from many parsing routines, always autodetermined.
- Remove MS_ISVALIDBLANK macro, was only used for notification of archaic structure.
- Add JSON handling and general wrapper functions to support extra headers
- Add CRC-32C calculation, new ms_crc32c() function.
- Set msr->swapflag bit flags to indicate if header and payload need swapping during parsing.
- Selection file format allows two selection listing variants
If the "quality" field is an integer it is assumed to be a publication version,
otherwise it is ignored.
- Remove capability to read the deprecated "pack" file format used at IRIS DMC.
- Remove StreamState tracking, effectively dropping the compression history capability
between records. Not worth the complexity.
2017.283: 2.19.5
- msr_endtime(): calculate correct end time during a leap second.
- Fixed signedness comparison warning.
2017.125:
- Export LM_SIZEOF_OFF_T on Windows via libmseed.def.
2017.118: 2.19.4
- Add global LM_SIZEOF_OFF_T variable that is set to the size of
the off_t data type as determined at compile time.
2017.075: 2.19.3
- Add missing public, global symbols to libmseed.map, thanks
to Elliott Sales de Andrade.
2017.061: 2.19.2
- Provide install target in Makefile thanks to by Pierre Duperray.
- Deprecate dynamic build target, the shared target will now build
shared or dynamic (Darwin) libraries depending on the system.
- Limit symbols exported in shared libraries to public interfaces
as defined in libmseed.map, thanks again to Pierre Duperray.
- Allow tests to work on Darwin with dynamic libraries.
2017.060: 2.19.1
- Derive versioning of shared/dynamic library from canonical version
defined as LIBMSEED_VERSION in libmseed.h.
- Apply updates to more standardized use of NAME and typos in man pages,
submitted by Pierre Duperray.
2017.053: 2.19
- Incorporate lmplatform.h details into libmseed.h for improved usage.
All that is needed is the static/shared/dynamic library and libmseed.h.
- Avoid undefined left shifts of signed values that would go out of
range and specify the types of some constants.
2016.290:
- Remove dependency on ntwin32.mak for Windows nmake makefiles, now
building works in plain MSVC development environments.
2016.286: 2.18
- Remove limitation on sample rate before calling ms_genfactmult()
in the normal path of packing records. Previously generating the
factor and multiplier was not attempted for rates higher than
32,767.
2016.281: 2.18rc4
- ms_genfactmult() now support a much larger range of integer
sample rates and periods.
- ms_genfactmult() now sets the factor and multiplier using the
SECONDS/SAMPLE notation for sample rates less than 1.0 to retain
precision for low rates.
- ms_genfactmult() now assumes the specified rate is a sample
period in seconds if the samprate value is negative.
- Add ms_rsqrt64() as a general use reciprocal sqrt for doubles.
- Use memcpy() instead of assignment when unpacking float32 and
float64 samples to avoid problems with NaN's. Thanks Lion Krischer.
- Add test for reading records without Blockette 1000.
- Reformat all source code using included clang-format profile.
2016.277:
- A more elegant sanity check for output length in packing by mbyt.
2016:276: 2.18rc3
- Improvements for test suite, more consistency.
- Remove msr_decode_steim? from libmseed.def, they are internal.
- Add sanity to length check before memset calls in packing functions.
2016:274: 2.18rc2
- Check for environment variables ENCODE_DEBUG and DECODE_DEBUG
and set debugging output, at this point it is Steim frame details
and differences being encoded/decoded.
- Fix padding in steim[12] encoding routines.
- Remove unneeded output buffer checks in steim[12] decoding routines.
2016.272: 2.18rc1
- Replace data sample packing and unpacking routines from qlib2 with
new routines developed from scratch. All code is now LGPL licensed.
- Add test suite with tests for encoding, decoding, parsing, etc.
- Update licensing to GNU-LGPL version 3 and include (L)GPL licenses
in LICENSE.txt.
2015.053:
- Define needed C99 int types for MSVC 2012 or earlier. Previously
this was only done for versions earlier than MSVC 2010.
2015.213: 2.17
- Round Fixed Section Data Header start time values to the nearest
tenth of millisecond and restrict the microsecond offset value
to a range between -50 and +49 as recommended in SEED. Previously
start times were truncated at tenths of millisecond resolution
and the microsecond offset value was between 0 and +99. This also
addresses a bug where microsecond offsets were off by 100ms for times
before Jan 1 1970. Thanks to Lion Krischer for reporting.
Note to future hackers: the definition of HPTMODULUS governing the
time tick interval for high precision time values implies that this
tick interval may be changed. In reality, this should not be changed
from the default, microsecond tick value without thorough testing.
Some logic is know to be dependent on the microsecond tick.
2015.134: 2.16m
- Add defines for needed integer types and macros from inttypes.h
missing in older MSVC versions. MSVC 2010 and later appear to have
enough C99 support.
- Add define tests for _WIN32 and _WIN64 to cover all WINs.
- ms_fread(): Add cast to quiet warning for conversion from size_t
to int. In this case the read will always be <= MAXRECLEN, much
smaller than int, making the conversion safe.
2015.113: 2.16
- Update minor release version in Makefile.
2015.108:
- Cleanup of lmplatform.h removing unneeded headers and using C99
standard headers except for a few platform specific cases.
- Convert all printf() and scanf() usage of %lld for 64-bit integers
to use the C99 PRId64 and SCNd64 macros for portability (MinGW).
- Change detection of Linux/Cygwin to set global define LMP_LINUX
instead of LMP_GLIB2 (now marked as deprecated).
- Change detection of Windows to set global define LMP_WIN instead
of LMP_WIN32 (now marked as deprecated).
- Add detection of __MINGW64__ define.
- Tested building on Win7 with: Open Watcom 1.9, MinGW gcc 4.8.1 and
Cygwin 1.7.35 (gcc 2.9.2).
2015.074:
- Define NTP-Posix time epoch conversion constant specifically as
a long long integer to avoid warnings on some compilers.
2015.070: 2.15
- Fix infinite loop if blockette chain is corrupt. Patch submitted
by Elliott Sales de Andrade.
2015.062: 2.14
- Fix memory leak when msr_pack() returns after an error. Patch
contributed by Larry Baker and Eric Thomas.
- Change casting of values passed to isdigit() to int intead of
unsigned character. Apparently this was consufing on ARM archs.
2015.061:
- Add ms_readleapseconds() and ms_readleapsecondfile() routines to
read a leap seconds file into an internal list.
- Modify msr_endtime() to check for an internal leap second list,
check for overlap with the record and adjust the end time as needed
when leap seconds are present. When a leap second list is present
any indication of positive leap seconds in the fixed section data
header are ignored.
2014.248:
- Add casting to size_t and int to avoid build warnings on certain
build systems (e.g. older MS Visual Studio).
The effective maximum sample buffer and record buffer size is ~2GB.
2014.234: 2.13
- Clean up Makefile and example/Makefile, remove all GCC-specific and
debug targets. Makefiles are compatible with both GNU and BSD make.
As before, the shared target works only for GCC-compatible compilers.
Thanks to Elliott Sales de Andrade for pointing out that shared library
targets did not work with parallel builds, prompting this clean up.
2014.197: 2.13rc
- Support 128-byte record length by changing MINRECLEN to 128 (was 256).
The current SEED specification is a minimum record length of 256-bytes,
but there are cases (e.g. low latency data flow) using 128-byte records.
- Add declarations, casting and string truncation to clear warnings
uncovered in ObsPy testing (thanks to Elliott Sales de Andrade).
2014.074:
- Add __CYGWIN__ defined test to Linux section of lmplatform.h.
2013.273: 2.12
- Add mst_convertsamples() and mstl_convertsamples() to convert sample
types. When converting from float & double types to integer type
a simple rounding is employed to compensate for machine representation
of floating point numbers.
2013.267:
- msr_endtime(): Check activity flags in fixed section of data header,
if bit 4 is set then a positive leap occurred during the record and
the end time should be reduced by one second to properly match the now
shifted UTC time. As long as the next record in the series is
properly marked with the correct UTC time no artificial time tear
will be generated when reconstructing the time series.
2013.137:
- Update docs for transition to 64-bit sample counts done in 2011!
2013.117: 2.11
- Initialize internal counters in mst_pack() to avoid their use
in error conditions. Thanks to D. Ketchum and M. Potter for help.
- Add 'const' qualifier to the msfile argument of the file reading and
writing family of routines to stop compiler warnings resulting from
generated binding functions. Thanks to M. Bach for reporting.
2013.056: 2.10
- Add more sanity checks to msr_unpack_data() to catch bad/corrupted
data records and avoid crashes due to impossible pointer construction.
2013.053: 2.9
- Extend parsing of day-of-year style time strings to allow parsing
of time fields separated by dashes in addition to allowing the day
and time fields to be separated by a 'T' or space. Modifications
were made to ms_seedtimestr2hptime().
- Extend parsing of year-month-day style time strings to allow parsing
of time fields separated by commas. Modifications were made to
ms_timestr2hptime().
2013.050:
- Add MS_ISVALIDYEARDAY() macro to test range for year and day values,
years between 1900 and 2100 and days between 1 and 366.
- Use new macro to determine when byte swapping is needed. This test
leaves a non-determination of byte order for days 1, 256 and 257 in
the year 2056, beware future data users.
2013.007: 2.8 (again)
- Add msr_parse_selection() to libmseed.def for Windows builds.
- Fix errors in pseudo code in doc/msr_parse.3.
2012.363: 2.8
- Implement msr_parse_selection() which is a wrapper of msr_parse()
that searches for the first parsable miniSEED record in a memory
buffer and returns it. Optionally a Selections list may be specified
to limit the returned data to records matching specific criteria.
2012.357:
- Fix corruption of float sample types when opposite byte order than
host in certain architecture combinations. By not addressing
individual float samples directly as floats prior to byte swapping
we avoid the values being placed into the FPU where they may be
corrupted. Thanks to Moritz Beyreuther and Lion Krischer for discovery
and testing.
- Expose the msr_unpack_data() function for use by removing the static
declaration. Change verbose flag type to match others and document.
- Fix some logging messages, typos, etc.
2012.138: 2.7
Add define for MINGW32 to use _fstat and _stat.
2012.114: 2.7rc2
- Change record parsing code to trim trailing spaces from network,
station, location and channel parameters. Spaces in between non-space
characters remain.
2012.111:
- Update example/test.mseed to new data with an earthquake to make it
more recognizable compared to ambient noise in the previous example.
2012.105: 2.7rc1
- Add many type casts to quiet newer GCC and MSVC compilers.
For 32-bit programs there are some places, mostly in packing routines,
where 64-bit integers are converted to 32-bit values for sample buffer
sizes and counts leaving the potential for overflow. This will become
a problem when byte counts for sample buffers are beyond 2^31, for
32-bit integer sample values that is more than 536 million samples.
So programmer beware if using such buffer sizes for packing miniSEED.
2012.088:
- When parsing records copy the ASCII string fields (sequence number,
network, station, location, channel) directly without removing spaces.
This makes the parser more lenient to unallowed characters and
synchronizes read and write capabilities.
- For sampling rates above 32,767 Hz only print a warning for high
verbosity settings and set the sample rate factor and multipler to zero.
Previously an error was printed during rational approximation.
The expectation is that a record with such a high sample rate will
include a blockette 100 to specify the actual sample rate.
This is not an official convention for SEED, but is a kludge to
support extremly high sample rates without printing errors.
- Fix conversion to doubles in examples/msrepack.c.
2011.304: 2.6.2
- Increase precision of sample rate in SYNC printing routines to
avoid trucation of rate values.