record(3)

πŸ“¦ version 1.2.3, in fedora 43, fedora 44

πŸ’– record β€” Recorder Library (that's section 3, bestie) πŸ’–

okay so you found the record(3) page in the Recorder Library and you're like "what do these three functions even do" β€” don't worry, I got you. this is the configure-your-output trio: record_configure_output, record_configure_show, and record_configure_format. they literally just tell the recorder where its words go and how they should look. that's it. that's the vibe. πŸŽ€


✨ NAME ✨

  • record_configure_output β€” Configure recorder output
  • record_configure_show β€” Configure recorder output function
  • record_configure_format β€” Configure recorder event formatting

🌸 SYNOPSIS 🌸

#include <recorder/recorder.h>

typedef unsigned (*recorder_show_fn) (const char *text,
                                      size_tlen,
                                      void *output);
typedef void (*recorder_format_fn)(recorder_show_fn show,
                                   void *output,
                                   const char * label,
                                   const char *location,
                                   uintptr_torder,
                                   uintptr_ttimestamp,
                                   const char *message);

void *recorder_configure_output(void *output);
recorder_show_fn   recorder_configure_show(recorder_show_fnshow);
recorder_format_fn recorder_configure_format(recorder_format_fnformat);

πŸ¦‹ DESCRIPTION πŸ¦‹

so recorder_configure_output() configures the output for the recorder output function. the default output function just assumes that output is a FILE * and β€” plot twist β€” it uses stderr if it's NULL. πŸ’€ and since recorder tracing is often used for debugging, it may be a good idea to make the output non-buffered using:

setvbuf(output,NULL,_IONBF,0);

like, genuinely, do that. no cap. your debug output wants to be there now, not whenever the buffer feels like it. πŸ™ˆ

recorder_configure_show() configures the output function for the recorder. this output function receives the output value that you defined with recorder_configure_output. so they're besties, they pass stuff to each other, it's giving teamwork. 🫢

recorder_configure_format() configures the event record formatting function. that's the one deciding how each event gets dressed up before it hits the output. πŸ‘‘


⭐ RETURN VALUE ⭐

the functions return the previously configured value. so if you wanna put the old one back later, you absolutely can. main character foresight. πŸ’…


πŸ’€ BUGS πŸ’€

Bugs should be reported using https://github.com/c3d/recorder/issues. go tell them, don't just suffer in silence bestie 😭


πŸ”₯ SEE ALSO πŸ”₯

Additional documentation and tutorials can be found at https://github.com/c3d/recorder.


πŸŽ€ AUTHOR πŸŽ€

Written by Christophe de Dinechin. king behaviour honestly πŸ‘‘


and that's the whole page, babe β€” version 1.0, dated 2019-03-09, filed under record(3) in the Recorder Library. go configure something iconic βœ¨πŸ’–

πŸ“¦ where this page comes from