PRINTF_L(3)
π 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 π₯
printf(3)β go check it, bestiexlocale(3)β locale deets, iykyk
π 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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2012 Isabell Long <issyl0@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms