---
name: "xprintf"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["macos"]
url: "https://new.carta.tech/xprintf"
---

# xprintf(3)

extensible printf

## NAME

**asxprintf**, **dxprintf**, **fxprintf**, **sxprintf**, **xprintf**, **vasxprintf**, **vdxprintf**, **vfxprintf**, **vsxprintf**, **vxprintf** – extensible printf

## SYNOPSIS

**#include \<printf.h\>**

*int*\

**asxprintf**(*char \*\* restrict ret*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *...*);

*int*\

**dxprintf**(*int fd*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *...*);

*int*\

**fxprintf**(*FILE \* restrict stream*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *...*);

*int*\

**sxprintf**(*char \* restrict str*, *size\_t size*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *...*);

*int*\

**xprintf**(*printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *...*);

**#include \<stdarg.h\>**

*int*\

**vasxprintf**(*char \*\* restrict ret*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vdxprintf**(*int fd*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vfxprintf**(*FILE \* restrict stream*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vsxprintf**(*char \* restrict str*, *size\_t size*, *printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vxprintf**(*printf\_domain\_t restrict domain*, *locale\_t restrict loc*, *const char \* restrict format*, *va\_list ap*);

## DESCRIPTION

These extensible printf (see [xprintf(5)](/xprintf/5.md)) variants behave like their normal printf counterparts (see [printf(3)](/printf/3.md)) without ‘x’ in the name (except **sxprintf**() and **vsxprintf**() behave like **snprintf**() and **vsnprintf**(), respectively).

The *domain* argument must be a pointer to a printf domain structure, as returned by one of the functions described in [xprintf\_domain(3)](/xprintf_domain/3.md). The *loc* argument should be an extended locale (see [xlocale(3)](/xlocale/3.md)) or NULL, which means to use the current locale in effect (either the per-thread locale if set, or the global locale by default).

## SEE ALSO

[printf(3)](/printf/3.md), [xlocale(3)](/xlocale/3.md), [xprintf\_domain(3)](/xprintf_domain/3.md), [xprintf(5)](/xprintf/5.md)
