---
name: "rbuf_append_vsprintf"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/rbuf_sprintf"
---

# rbuf\_append\_vsprintf(3)

creating formatted rbuf's

Part of [rbuf\_sprintf(3)](/rbuf_sprintf/3.md).

## NAME

rbuf\_sprintf - creating formatted rbuf's

## SYNOPSIS

\#include \<roy.h\>

void rbuf\_sprintf (*RBuf* \*buf, const char \**format*, ...);

void rbuf\_append\_sprintf (*RBuf* \*buf, const char \**format*, ...);

void rbuf\_append\_vsprintf (*RBuf* \*buf, const char \**format*, va\_list args);

RBuf \* rbuf\_new\_with\_sprintf (const char \**format*, ...);

## DESCRIPTION

These functions are used to insert formatted strings into an *RBuf*.

A call to [*rbuf\_sprintf*(3)](/rbuf_sprintf/3.md) resets the current contents of the rbuf with the formatted string.

A call to [*rbuf\_append\_sprintf*(3)](/rbuf_append_sprintf/3.md) appends the formatted string to the rbuf.

A call to [*rbuf\_append\_vsprintf*(3)](/rbuf_append_vsprintf/3.md) is identical to [*rbuf\_append\_sprintf*(3)](/rbuf_append_sprintf/3.md) except that a \**va\_list* is used as the arguments to the formatted string \**format*.

A call to [*rbuf\_new\_with\_sprintf*(3)](/rbuf_new_with_sprintf/3.md) creates a new rbuf with its buffer set to the formatted string.

## RBUF FORMAT SPECIFICATION

The RBuf sprintf calls all implement `%b` as a format specification for rufs.

## RETURN VALUE

All these calls with the exception of [*rbuf\_new\_with\_sprintf*(3)](/rbuf_new_with_sprintf/3.md) have no return value.  [*rbuf\_new\_with\_sprintf*(3)](/rbuf_new_with_sprintf/3.md) returns an rbuf struct for use with other rbuf calls.  The programmer should free this rbuf a call to [*rbuf\_free*(3)](/rbuf_free/3.md) when he/she is done using the rbuf.

## ERRORS

These calls do not error.

## FUNCTION

All [*rbuf\_sprintf*(3)](/rbuf_sprintf/3.md) style api calls are implemented using functions.

## SEE ALSO

[*rbuf*(3)](/rbuf/3.md), [*rbuf\_append*(3)](/rbuf_append/3.md),  [*rbuf\_append\_char*(3)](/rbuf_append_char/3.md), [*rbuf\_append\_data*(3)](/rbuf_append_data/3.md),  [*rbuf\_append\_rbuf*(3)](/rbuf_append_rbuf/3.md), [*rbuf\_append\_sprintf*(3)](/rbuf_append_sprintf/3.md),  [*rbuf\_append\_str*(3)](/rbuf_append_str/3.md), [*rbuf\_append\_vsprintf*(3)](/rbuf_append_vsprintf/3.md),  [*rbuf\_auto*(3)](/rbuf_auto/3.md), [*rbuf\_down*(3)](/rbuf_down/3.md),  [*rbuf\_empty*(3)](/rbuf_empty/3.md), [*rbuf\_equal*(3)](/rbuf_equal/3.md),  [*rbuf\_equal\_data*(3)](/rbuf_equal_data/3.md), [*rbuf\_equal\_rbuf*(3)](/rbuf_equal_rbuf/3.md),  [*rbuf\_equal\_rbuf\_len*(3)](/rbuf_equal_rbuf_len/3.md), [*rbuf\_equal\_rbufcase*(3)](/rbuf_equal_rbufcase/3.md),  [*rbuf\_equal\_str*(3)](/rbuf_equal_str/3.md), [*rbuf\_equal\_str\_len*(3)](/rbuf_equal_str_len/3.md),  [*rbuf\_equal\_strcase*(3)](/rbuf_equal_strcase/3.md), [*rbuf\_erase*(3)](/rbuf_erase/3.md),  [*rbuf\_float*(3)](/rbuf_float/3.md), [*rbuf\_free*(3)](/rbuf_free/3.md),  [*rbuf\_hash*(3)](/rbuf_hash/3.md), [*rbuf\_insert*(3)](/rbuf_insert/3.md),  [*rbuf\_last*(3)](/rbuf_last/3.md), [*rbuf\_len*(3)](/rbuf_len/3.md),  [*rbuf\_long*(3)](/rbuf_long/3.md), [*rbuf\_new*(3)](/rbuf_new/3.md),  [*rbuf\_new\_with\_sprintf*(3)](/rbuf_new_with_sprintf/3.md), [*rbuf\_own*(3)](/rbuf_own/3.md),  [*rbuf\_prepend*(3)](/rbuf_prepend/3.md), [*rbuf\_prepend\_char*(3)](/rbuf_prepend_char/3.md),  [*rbuf\_prepend\_data*(3)](/rbuf_prepend_data/3.md), [*rbuf\_prepend\_rbuf*(3)](/rbuf_prepend_rbuf/3.md),  [*rbuf\_prepend\_str*(3)](/rbuf_prepend_str/3.md), [*rbuf\_rdonly*(3)](/rbuf_rdonly/3.md),  [*rbuf\_set\_to*(3)](/rbuf_set_to/3.md), [*rbuf\_split*(3)](/rbuf_split/3.md),  [*rbuf\_str*(3)](/rbuf_str/3.md), [*rbuf\_truncate*(3)](/rbuf_truncate/3.md),  [*rbuf\_up*(3)](/rbuf_up/3.md), [*roy*(3)](/roy/3.md)
