libosmocore 1.13.1.1-afb4 Osmocom core library

Data Fields
osmo_strbuf Struct Reference
General-purpose utility functions

State for OSMO_STRBUF_APPEND() and OSMO_STRBUF_PRINTF(). More...

`#include <utils.h>`

## Data Fields
char * | buf
| Point to the start of a string buffer. More...
size_t | len
| Total sizeof() the buffer buf points at. More...
char * | pos
| Current writing position in buf (end of the string written so far). More...
size_t | chars_needed
| After all OSMO_STRBUF_APPEND operations, reflects the total number of characters that would be written had buf been large enough. More...

## Detailed Description

State for OSMO_STRBUF_APPEND() and OSMO_STRBUF_PRINTF().

See there for examples.

## Field Documentation

## ◆ buf

char* osmo_strbuf::buf

Point to the start of a string buffer.

Referenced by _osmo_escape_str_buf(), _osmo_quote_str_buf(), _osmo_strbuf_char_count(), _osmo_strbuf_remain(), log_output_buf(), osmo_escape_cstr_buf(), osmo_escape_str_buf2(), osmo_escape_str_buf3(), osmo_int_to_float_str_buf(), osmo_quote_cstr_buf(), osmo_quote_str_buf(), osmo_quote_str_buf2(), osmo_quote_str_buf3(), osmo_str_tolower_c(), osmo_str_toupper_c(), osmo_strbuf_added_tail(), osmo_strbuf_drop_tail(), and osmo_use_count_to_str_buf().

## ◆ chars_needed

size_t osmo_strbuf::chars_needed

After all OSMO_STRBUF_APPEND operations, reflects the total number of characters that would be written had buf been large enough.

Like snprintf()'s return value, this does not include the terminating nul character. Hence, to allocate an adequately sized buffer, add 1 to this number.

Referenced by _osmo_escape_str_buf(), _osmo_quote_str_buf(), osmo_int_to_float_str_buf(), osmo_strbuf_added_tail(), osmo_strbuf_drop_tail(), and osmo_use_count_to_str_buf().

## ◆ len

size_t osmo_strbuf::len

Total sizeof() the buffer buf points at.

Referenced by _osmo_strbuf_char_count(), _osmo_strbuf_remain(), and osmo_strbuf_added_tail().

## ◆ pos

char* osmo_strbuf::pos

Current writing position in buf (end of the string written so far).

Referenced by _osmo_strbuf_char_count(), _osmo_strbuf_remain(), log_output_buf(), osmo_strbuf_added_tail(), and osmo_strbuf_drop_tail().

The documentation for this struct was generated from the following file:

- include/osmocom/core/utils.h