solidc
Robust collection of general-purpose cross-platform C libraries and data structures designed for rapid and safe development in C
Loading...
Searching...
No Matches
str.h File Reference

Header-only string utility library for C11. More...

#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for str.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Header-only string utility library for C11.

All functions operate on ordinary NUL-terminated C strings. Functions whose names begin with str_ fall into two categories:

In-place – modify the buffer passed in; no allocation, O(n) at most. Allocating – return a newly malloc'd string (or array). The caller is responsible for calling free() on every pointer that is returned (including each element of a split array; see str_split and str_free_split).

Every function that accepts a pointer guards against NULL unless the parameter is explicitly documented as "must not be NULL".

Note
This header requires C11 or later. MSVC users get thin shims for strcasecmp, strncasecmp and strcasestr at the bottom of the file.

Sections

Definition in file str.h.