File wfm_path.h¶
FileList > inc > wfm > wfm_path.h
Go to the source code of this file
Sibling-path construction shared by the wfm reader and writer. More...
#include <stdio.h>#include <string.h>
Public Static Functions¶
| Type | Name |
|---|---|
| void | wfm_meta_path (const char * path, char * out, size_t cap) Name the .sigmf-meta sidecar belonging to the capture atpath . |
| void | wfm_swap_ext (const char * path, const char * ext, char * out, size_t cap) Swap path's final extension forext . |
Detailed Description¶
Several file types come in pairs — a BLUE detached capture is <base>.hdr + <base>.det, a SigMF one is <base>.sigmf-data + <base>.sigmf-meta — so both halves of the library have to derive one member's name from the other's. Reader and writer MUST agree on that derivation, or the writer emits a sidecar at a name the reader will not look for; one definition here is what makes that impossible.
Public Static Functions Documentation¶
function wfm_meta_path¶
Name the .sigmf-meta sidecar belonging to the capture atpath .
Two derivations, because two different things are being named:
"cap.sigmf-data"→"cap.sigmf-meta"(SWAP). Not a choice: SigMF defines a capture as the<base>.sigmf-data+<base>.sigmf-metapair, and conformant tools find the second half by exactly that name."cap.raw"→"cap.raw.sigmf-meta"(APPEND). Anything else is not a SigMF capture, so no external tool looks for its metadata under any name, which leaves the derivation free — and a free choice should be the one that cannot collide. Swapping would givecap.rawand a genuinecap.sigmf-datain one directory the SAME sidecar name, so writing one capture would silently overwrite the other's metadata. Appending keeps the sidecar 1:1 with the file it describes, which is also what makes it safe to read back by exact name: wfm_reader_create deliberately does NOT sniff for<base>.sigmf-metabeside an arbitrary file, because a shared base name hijacked two unrelated files the first time that was tried.
Parameters:
pathcapture (data) path.outdestination buffer; always NUL-terminated, truncated ifcapis too small.capbytes available atout.
function wfm_swap_ext¶
Swap path's final extension forext .
"foo/cap.prm" + ".det" → "foo/cap.det". A path whose basename carries no dot simply gains the extension, so "cap" → "cap.det".
The dot must be in the BASENAME: a dotted directory ("../cap", "v1.2/cap") is not an extension, and treating it as one would write the sibling into the wrong place entirely.
Parameters:
pathsource path.extreplacement extension, leading dot included.outdestination buffer; always NUL-terminated, truncated ifcapis too small.capbytes available atout.
The documentation for this class was generated from the following file native/inc/wfm/wfm_path.h