CSTR v1.0.0-build
Simple yet powerful string manipulation in C
Loading...
Searching...
No Matches
CSTR Struct Reference

Custom dynamic string type. More...

#include <cstr.h>

Public Attributes

size_t cap
 Total allocated capacity (including NULL terminator)
char * data
 Pointer to the character buffer Always NULL terminated if properly managed through the API.
bool forceCap
 If true, capacity is fixed and operations that exceed it return an error instead of reallocating the size.
bool initialized
 Tracks whether this CSTR has been initialized.
size_t len
 Current string length (not counting the NULL terminator)

Detailed Description

Custom dynamic string type.

The fields should typically be managed only through the cstr_* API Directly modifying them can lead to undefined behavior unless explicitly intended

Definition at line 40 of file cstr.h.

Member Data Documentation

◆ cap

size_t CSTR::cap

Total allocated capacity (including NULL terminator)

Definition at line 68 of file cstr.h.

◆ data

char* CSTR::data

Pointer to the character buffer Always NULL terminated if properly managed through the API.

Definition at line 52 of file cstr.h.

◆ forceCap

bool CSTR::forceCap

If true, capacity is fixed and operations that exceed it return an error instead of reallocating the size.

Definition at line 58 of file cstr.h.

◆ initialized

bool CSTR::initialized

Tracks whether this CSTR has been initialized.

Note
Should only be set by internal or initialization functions

Definition at line 46 of file cstr.h.

◆ len

size_t CSTR::len

Current string length (not counting the NULL terminator)

Definition at line 63 of file cstr.h.


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