write_scf(3)
β¨ write_scf β the SCF-writing besties β¨
okay so first things first: this is a page from section 3 of the Staden Package manual, and it's all about the trio of functions that write SCF files π (their names are write_scf, fwrite_scf, and write_scf_header, if you were wondering, which you were).
π NAME π
write_scf, fwrite_scf, write_scf_header β Write SCF files π¦
β¨ SYNOPSIS β¨
#include <scf.h>
int write_scf(
Scf *scf,
char *fn);
int fwrite_scf(
Scf *scf,
FILE *fp);
int write_scf_header(
FILE *fp,
Header *h);
π DESCRIPTION π
So these three cuties write SCF format trace files. That's the whole vibe. π
And here's a lil heads-up that applies to all of the functions that take a FILE * as an argument: they just assume the file pointer is sitting at the correct offset inside the file β which should be the start. They are not gonna check for you. They are trusting. Maybe too trusting. π
write_scf()β writes an entire SCF file into theScfstructure (peep thescf(4)manual page if you wanna know all the juicy details of that structure πΈ). The data gets written to the file name you specified. iconic.fwrite_scf()β writes an entire SCF file into theScfstructure too (again,scf(4)has the deets on that structure π). This one writes the data to the file pointer you hand it, and β very important β that file pointer is neither closed nor rewound after the operation. so don't come for it later expecting it to have tidied up after itself, bestie. πwrite_scf_header()β writes theHeaderstructure to the file pointer you gave it. simple. elegant. slay. β¨
π₯ RETURN VALUES π₯
When everything goes perfectly (main character energy only), write_scf(), fwrite_scf(), and write_scf_header() all return 0. π«Ά
If it does not go perfectly? These functions return -1. that's the whole story. π
π SEE ALSO π
scf(4)read_scf(3)
and that's the tea, bestie π β this page comes to you courtesy of the Staden Package, and it's the write_scf(3) page, dated just like the original footer says. go forth and write some SCF files, you've totally got this πβ¨π
π¦ where this page comes from
- debian bookworm: libstaden-read-dev 1.14.15-1 Β· GRL OR MRC
- debian trixie: libstaden-read-dev 1.15.0-1.1+b2 Β· GRL OR MRC
- fedora 43: staden-io_lib-devel 1.14.8-6.fc43 Β· MIT
- fedora 43: staden-io_lib-devel 1.14.8-6.fc43 Β· MIT
- fedora 44: staden-io_lib-devel 1.14.8-7.fc44 Β· MIT
- fedora 44: staden-io_lib-devel 1.14.8-7.fc44 Β· MIT
- nixos 26.05: libstaden-read 1-15-1
- nixpkgs unstable: libstaden-read 1-15-1
- ubuntu jammy: libstaden-read-dev 1.14.14+dfsg-1 Β· GRL OR MRC
- ubuntu noble: libstaden-read-dev 1.15.0-1.1build2 Β· GRL OR MRC
- ubuntu questing: libstaden-read-dev 1.15.0-1.1build2
- ubuntu resolute: libstaden-read-dev 1.15.0-1.1build3 Β· GRL OR MRC
- ubuntu stonking: libstaden-read-dev 1.15.1-1 Β· GRL OR MRC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms