Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
s_string Struct Reference

Dynamic string structure with NUL-terminated storage. More...

#include <libft.h>

Data Fields

chardata
 Pointer to the string storage (borrowed or owned, NUL-terminated if not NULL).
 
size_t cap
 Current capacity in bytes, also encoding storage ownership.
 
size_t len
 Current length in bytes, excluding the trailing NUL.
 

Detailed Description

Dynamic string structure with NUL-terminated storage.

When s_string::data is not NULL and s_string::cap is 0, the string borrows its storage. When s_string::cap is greater than 0, the string owns its storage.

Field Documentation

◆ cap

size_t s_string::cap

Current capacity in bytes, also encoding storage ownership.

◆ data

char* s_string::data

Pointer to the string storage (borrowed or owned, NUL-terminated if not NULL).

◆ len

size_t s_string::len

Current length in bytes, excluding the trailing NUL.


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