ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
outbuf_t Struct Reference

Dynamic output buffer (auto-expanding). More...

#include <include/ascii-chat/video/ascii/output_buffer.h>

Data Fields

char * buf
 Buffer pointer (allocated, owned by caller, must be freed).
size_t len
 Current length in bytes (excluding null terminator).
size_t cap
 Buffer capacity in bytes (maximum length before reallocation).

Detailed Description

Dynamic output buffer (auto-expanding).

Represents a dynamic output buffer that automatically expands when more space is needed. Buffer grows exponentially (doubles in size) to minimize reallocation overhead.

MEMORY MANAGEMENT:

  • buf: Points to allocated buffer (NULL if not yet allocated)
  • len: Current number of bytes used in buffer
  • cap: Current buffer capacity in bytes
  • Buffer must be freed by caller using free(buf) when done
Note
Buffer is null-terminated after each append operation.
Buffer grows automatically when space is needed.

Definition at line 88 of file output_buffer.h.

Field Documentation

◆ buf

char* outbuf_t::buf

◆ cap

size_t outbuf_t::cap

Buffer capacity in bytes (maximum length before reallocation).

Definition at line 91 of file output_buffer.h.

Referenced by ob_reserve(), ob_term(), and ob_write().

◆ len

size_t outbuf_t::len

Current length in bytes (excluding null terminator).

Definition at line 90 of file output_buffer.h.

Referenced by ob_putc(), ob_reserve(), ob_term(), ob_u32(), and ob_write().


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