ascii-chat 0.11.33
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 84 of file output_buffer.h.

Field Documentation

◆ buf

◆ cap

size_t outbuf_t::cap

◆ len

size_t outbuf_t::len

Current length in bytes (excluding null terminator)

Definition at line 86 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: