Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667.Dd Aug 19, 2012.Dt XPRINTF_COMP 3.Os Darwin.Sh NAME.Nm free_printf_comp , new_printf_comp.Nd extensible printf compilation.Sh SYNOPSIS.In printf.h.Ft void.Fn free_printf_comp "printf_comp_t pc".Ft printf_comp_t.Fn new_printf_comp "printf_domain_t restrict domain" "locale_t restrict loc" "const char * restrict fmt".Sh DESCRIPTIONTo ameliorate some of the slowness caused by the extra overhead inextensible printf (see.Xr xprintf 5 ) ,a compile/execute mechanism has been created.The.Fn new_printf_compfunction compiles the given format string, along with a printf domain(see.Xr xprintf_domain 3 )and an extended locale(see.Xr xlocale 3 ) ,and returns a.Ft printf_comp_tstructure.The domain may not be.Dv NULL ,but the locale can be.Dv NULL ,which means to use the current locale, either the per-thread locale if itwas set, or else the global locale.Because the.Ft printf_comp_tstructure records the domain and locale, care should be taken if eitherof these are changed..PpOnce a.Ft printf_comp_tstructure is created, it can be passed to one of the extensible printfexecution variants, described in.Xr xprintf_exec 3 ,along with the necessary arguments.Creating the.Ft printf_comp_tstructure needs to be done only once, but it can be passedto extensible printf execution variants any number of times..PpWhen the.Ft printf_comp_tstructure is no longer needed, it should be passed to.Fn free_printf_compto release internal memory..Sh RETURN VALUESThe.Fn new_printf_compfunction returns the new structure, or.Dv NULLon error (usually NULL domain or out of memory condition)..Sh SEE ALSO.Xr xlocale 3 ,.Xr xprintf_domain 3 ,.Xr xprintf_exec 3 ,.Xr xprintf 5