IXP_ERRBUF(3)

πŸ“¦ version 0-unstable-2022-04, in nixos 26.05, nixpkgs unstable

okay bestie, this is IXP_ERRBUF(3) from the Library Functions Manual β€” we're doing Plan 9-style errstr vibes and it's lowkey iconic πŸ’–

🌸 NAME 🌸

ixp_errbuf, ixp_errstr, ixp_rerrstr, ixp_werrstr, ixp_vsnprint β€” the little errstr crew in libixp, and yes they ate πŸŽ€

✨ SYNOPSIS ✨

#include <ixp.h>

char *ixp_errbuf(void);

void ixp_errstr(char *buf, int nbuf);

void ixp_rerrstr(char *buf, int nbuf);

void ixp_werrstr(const char *fmt, ...);

int      (*ixp_vsnprint)(char *buf, int nbuf, const char *fmt, va_list);

πŸŽ€ PARAMETERS πŸŽ€

  • buf β€” the buffer you're reading and/or filling, bestie.
  • nbuf β€” the size of that buffer.
  • fmt β€” a format string you use to write the errstr.
  • ... β€” the arguments that go with fmt, obviously.

πŸ’… DESCRIPTION πŸ’…

Okay so these functions simulate Plan 9's errstr functionality β€” no cap. They replace errno in libixp. Note that these functions are not internationalized πŸ™ˆ.

ixp_errbuf(3) returns the errstr buffer for the current thread. Slay.

ixp_rerrstr(3) fills buf with the data from the current thread's error buffer. Copy that vibe over ✨.

ixp_errstr(3) exchanges buf's contents with those of the current thread's error buffer. It's giving swap energy πŸ’….

ixp_werrstr(3) formats the given format string, fmt, via ixp_vsnprint(3) and writes it to the error buffer. Write it, bestie 🫢.

ixp_vsnprint(3) may be set to a function which will format its arguments and write the result to the nbuf length buffer buf(3). The default value is vsnprintf(3). That function must format '%s' as a nul-terminated string and may not consume any arguments not indicated by a %-prefixed format specifier, but may otherwise behave in any manner chosen by the user. Periodt. πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

made with πŸ’– by the libixp Manual crew β€” 2012 Dec β€” for IXP_ERRBUF(3), bye bestie! 🫢

πŸ“¦ where this page comes from