ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
outbuf_t Struct Reference

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

#include <lib/video/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

char* outbuf_t::buf

Buffer pointer (allocated, owned by caller, must be freed)

Definition at line 85 of file output_buffer.h.

Referenced by ansi_compress_rle(), ansi_expand_rle(), ansi_strip_escapes(), convert_pixels_scalar_with_newlines(), image_print(), ob_putc(), ob_reserve(), ob_u32(), and ob_write().

◆ cap

size_t outbuf_t::cap

Buffer capacity in bytes (maximum length before reallocation)

Definition at line 87 of file output_buffer.h.

Referenced by convert_pixels_scalar_with_newlines(), image_print(), ob_reserve(), and ob_write().

◆ 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_u32(), and ob_write().


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