PRINTF_L(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– PRINTF_L(3) πŸ’– β€” formatted output conversion, fresh from the Library Functions Manual ✨

🌸 NAME 🌸

printf_l, asprintf_l, fprintf_l, snprintf_l, sprintf_l, vasprintf_l, vfprintf_l, vprintf_l, vsnprintf_l, vsprintf_l β€” formatted output conversion. That’s the whole squad, bestie πŸ’…

πŸŽ€ LIBRARY πŸŽ€

It’s in the Standard C Library (libc, -lc) β€” obviously, icon behavior 🫢

✨ SYNOPSIS ✨

okay so first you gotta include these, no cap:

#include <stdio.h>
#include <xlocale.h>

then the function lineup is literally:

int
printf_l(locale_t loc, const char * restrict format, ...);

int
asprintf_l(char **ret, locale_t loc, const char * format, ...);

int
fprintf_l(FILE * restrict stream, locale_t loc,
    const char * restrict format, ...);

int
snprintf_l(char * restrict str, size_t size, locale_t loc,
    const char * restrict format, ...);

int
sprintf_l(char * restrict str, locale_t loc,
    const char * restrict format, ...);

int
vasprintf_l(char **ret, locale_t loc, const char *format, va_list ap);

int
vfprintf_l(FILE * restrict stream, locale_t loc,
    const char * restrict format, va_list ap);

int
vprintf_l(locale_t loc, const char * restrict format, va_list ap);

int
vsnprintf_l(char * restrict str, size_t size, locale_t loc,
    const char * restrict format, va_list ap);

int
vsprintf_l(char * restrict str, locale_t loc,
    const char * restrict format, va_list ap);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so the functions above are used to convert formatted output in the locale loc. They behave in the same way as the versions without the _l suffix, but they use the specified locale rather than the global or per-thread locale. See the specific manual pages for more information β€” that’s where the full lore lives πŸ’–

πŸ”₯ SEE ALSO πŸ”₯

πŸ’… STANDARDS πŸ’…

ngl, these functions do not conform to any specific standard so they should be considered as non-portable local extensions. That’s the tea β˜•βœ¨

🌈 HISTORY 🌈

These functions first appeared in Darwin and were first implemented in FreeBSD 9.1. periodt πŸ’€


🫢 aaaand that’s the page! source/version energy: Debian, date: April 7, 2012, page: PRINTF_L(3) β€” mwah, bye bestie πŸ’‹πŸ’–
πŸ“¦ where this page comes from