ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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

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(), ascii_frame_finish(), ob_putc(), ob_reserve(), ob_term(), ob_u32(), ob_write(), session_display_destroy(), and session_display_release_ascii().

◆ 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 ob_reserve(), ob_term(), 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_term(), ob_u32(), and ob_write().


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