Zstr
Description
Read-only NUL-terminated C string – the project name for what libc calls const char *. Public API surface uses this typedef so the intent (“read a borrowed C-string here”) is visible at a glance; internal helpers may keep raw const char *.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.Init.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Float.Type.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Float.h>
#include <Misra/Std/Container/BitVec.h>- In
PdbCache.c:12:
#include <Misra.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Memory.h>
#include <Misra/Sys.h>- In
Int.Math.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Int.h>
#include <Misra/Std/Log.h>- In
Str.Type.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Pe.c:12:
#include <Misra.h>
#include <Misra/Parsers/Pe.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Memory.h>- In
Dns.c:2:
#include <Misra/Parsers/Dns.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Pdb.c:13:
#include <Misra.h>
#include <Misra/Parsers/Pdb.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Memory.h>- In
Http.c:2:
#include <Misra/Parsers/Http.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
MachoCache.c:15:
#include <Misra.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Memory.h>
#include <Misra/Std/File.h> #include <Misra.h>
#include <Misra/Parsers/Dwarf.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Parsers/Elf.h>
#include <Misra/Std/Allocator/Default.h>- In
Str.Ops.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Io.Read.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Container/BitVec.h>- In
Map.Ops.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Map.h>
#include <Misra/Std/Container/Str.h>- In
ArgParse.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/ArgParse.h>
#include <Misra/Std/Log.h>- In
Dwarf.c:3:
#include <Misra.h>
#include <Misra/Parsers/Dwarf.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Parsers/Elf.h>
#include <Misra/Std/Allocator/Default.h> #include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Float.h>
#include <Misra/Std/Container/Int.h>- In
Backtrace.c:3:
#include <Misra.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Sys/Backtrace.h>
#if FEATURE_SYS_SYMRESOLVE #include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Graph.h>
#include <Misra/Std/Container/Map.h>- In
Graph.Init.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Heap.h>
#include <Misra/Std/Container/Graph.h>- In
Str.Foreach.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Map.Type.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Map.h>
#include <Misra/Std/Log.h>- In
SysDns.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Log.h>
#include <Misra/Sys/Dns.h>- In
Str.Remove.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Str.Convert.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
MachO.c:9:
#include <Misra.h>
#include <Misra/Parsers/MachO.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Memory.h>- In
Io.Write.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Container/BitVec.h>- In
Str.Insert.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Float.Math.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Float.h>
#include <Misra/Std/Container/Int.h> #include <Misra.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Sys/SymbolResolver.h>- In
Str.Memory.c:2:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Log.h>- In
Vec.Complex.c:3:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Allocator/Heap.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Memory.h>- In
Socket.c:7:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Log.h>
#include <Misra/Sys/Socket.h>- In
AllocDebug.c:22:
#include <Misra.h>
#include <Misra/Std/Allocator/Debug.h>
#include <Misra/Std/Zstr.h>
#include "../Util/TestRunner.h" #include <Misra/Std/Container/BitVec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Container/Str.h>- In
File.c:6:
#include <Misra/Std/Log.h>
#include <Misra/Std/Memory.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Sys/Dir.h>- In
Int.Convert.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Int.h>
#include <Misra/Std/Log.h>- In
Graph.Access.c:2:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Graph.h>
#include <Misra/Std/Log.h>- In
Sys.c:342:
#endif
Zstr EnvGet(Zstr name) {
if (!name) {
return NULL;- In
Dns.c:11:
#include <Misra/Sys/Dns.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Parsers/Dns.h>- In
Proc.c:13:
#include <Misra/Sys/Proc.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Sys.h>
#include <Misra/Std/Memory.h>- In
Dir.c:27:
#include "../_Syscall.h"
Zstr DirEntryTypeToZstr(DirEntryType type) {
switch (type) {
case SYS_DIR_ENTRY_TYPE_UNKNOWN :- In
Dir.c:74:
#if PLATFORM_WINDOWS
// Windows-specific implementation using FindFirstFile/FindNextFile
DirContents dir_get_contents(Zstr path, Allocator *alloc) {
if (!path || !alloc) {
LOG_FATAL("Invalid argument");- In
Dir.c:197:
}
DirContents dir_get_contents(Zstr path, Allocator *alloc) {
if (!path || !alloc) {
LOG_FATAL("invalid arguments.");- In
Dir.c:282:
#else
// APPLE or other Unix-based system implementation using opendir/readdir.
DirContents dir_get_contents(Zstr path, Allocator *alloc) {
if (!path || !alloc) {
LOG_FATAL("invalid arguments.");- In
Dir.c:347:
// Cross-platform function to get file size
i64 file_get_size(Zstr filename) {
#if PLATFORM_WINDOWS
// Windows-specific code using GetFileSizeEx
- In
Dir.c:415:
// ---------------------------------------------------------------------------
i8 file_remove(Zstr path) {
if (!path) {
LOG_FATAL("FileRemove: NULL path");- In
Dir.c:444:
}
i8 dir_remove(Zstr path) {
if (!path) {
LOG_FATAL("DirRemove: NULL path");- In
Dir.c:485:
#define DIR_CREATE_MODE 0755
i8 dir_create(Zstr path) {
if (!path) {
LOG_FATAL("DirCreate: NULL path");- In
Dir.c:538:
}
i8 dir_create_all(Zstr path) {
if (!path) {
LOG_FATAL("DirCreateAll: NULL path");- In
Dir.c:591:
#define DIR_REMOVE_ALL_PATH_CAP 512
i8 dir_remove_all(Zstr path) {
if (!path) {
LOG_FATAL("DirRemoveAll: NULL path");- In
Pe.c:548:
}
bool pe_open(Pe *out, Zstr path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_FATAL("PeOpen: NULL argument (contract violation)");- In
Pe.c:569:
}
const PeSection *PeFindSection(const Pe *self, Zstr name) {
if (!self || !name)
return NULL;- In
KvConfig.c:2:
#include <Misra/Parsers/KvConfig.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Map/Private.h>
#include <Misra/Std/Memory.h>- In
KvConfig.c:368:
}
Str *KvConfigGetPtr(KvConfig *cfg, Zstr key) {
Str lookup = {0};
Str *value = NULL;- In
KvConfig.c:390:
}
Str KvConfigGet(KvConfig *cfg, Zstr key) {
Str *value = KvConfigGetPtr(cfg, key);- In
KvConfig.c:400:
}
bool KvConfigContains(KvConfig *cfg, Zstr key) {
return KvConfigGetPtr(cfg, key) != NULL;
}- In
Pdb.c:737:
}
bool pdb_open(Pdb *out, Zstr path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_FATAL("PdbOpen: NULL argument (contract violation)");- In
Http.c:9:
#include <Misra/Parsers/Http.h>
#include <Misra/Std/Zstr.h>
#if FEATURE_FILE- In
Http.c:61:
}
HttpHeader *HttpHeadersFind(HttpHeaders *headers, Zstr key) {
if (!headers || !key) {
LOG_FATAL("invalid arguments");- In
Http.c:102:
}
const char *HttpRequestParse(HttpRequest *req, Zstr in) {
if (!req || !req->allocator || !in) {
LOG_FATAL("invalid arguments");- In
Http.c:395:
#if FEATURE_FILE
HttpResponse *
HttpRespondWithFile(HttpResponse *response, HttpResponseCode status, HttpContentType content_type, Zstr filepath) {
if (!response || !response->allocator || !filepath) {
LOG_FATAL("invalid arguments");- In
Elf.c:477:
}
bool elf_open(Elf *out, Zstr path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_FATAL("ElfOpen: NULL argument (contract violation)");- In
Elf.c:536:
}
const ElfSection *ElfFindSection(const Elf *self, Zstr name) {
if (!self || !name)
return NULL;- In
JSON.c:2:
#include <Misra/Parsers/JSON.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Allocator/Default.h>- In
MachO.c:443:
}
bool macho_open(Macho *out, Zstr path, Allocator *alloc) {
if (!out || !path || !alloc) {
LOG_FATAL("MachoOpen: NULL argument (contract violation)");- In
MachO.c:466:
}
const MachoSection *MachoFindSection(const Macho *self, Zstr segment, Zstr section) {
if (!self || !segment || !section)
return NULL;- In
ArgParse.c:9:
#include <Misra/Std/ArgParse.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/File.h>
#include <Misra/Std/Io.h>- In
ArgParse.c:462:
/* ------------------------------------------------------------------ */
ArgParse arg_parse_init(Zstr name, Zstr about, Allocator *alloc) {
if (!name)
LOG_FATAL("ArgParseInit: name is required");- In
Io.c:50:
#include <Misra/Std/Allocator/Default.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Buf.h>
#include <Misra/Std/File.h>- In
Zstr.c:9:
#include <Misra/Std/Log.h>
#include <Misra/Std/Memory.h>
#include <Misra/Std/Zstr.h>
size ZstrLen(const char *str) {- In
Log.c:37:
#include <Misra/Sys/Backtrace.h>
void LogWrite(LogMessageType type, Zstr tag, u64 line, Zstr msg) {
if (!msg) {
return;- In
File.c:74:
// ---------------------------------------------------------------------------
File file_open(Zstr path, Zstr mode) {
File f = {0};
#if PLATFORM_WINDOWS- In
BitVec.c:8:
#include <Misra/Std/Container/BitVec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Memory.h>- In
Int.c:8:
#include <Misra/Std/Container/Int.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Int/Private.h>
#include <Misra/Std/Container/BitVec.h>- In
Int.c:620:
}
bool IntTryFromStr(Int *out, Zstr decimal) {
u64 start = 0;- In
Int.c:634:
}
Int int_from_str(Zstr decimal, Allocator *alloc) {
Int out = IntInit(alloc);- In
Int.c:657:
}
bool IntTryFromStrRadix(Int *out, Zstr digits, u8 radix) {
u64 start = 0;- In
Int.c:670:
}
Int int_from_str_radix(Zstr digits, u8 radix, Allocator *alloc) {
Int out = IntInit(alloc);- In
Int.c:742:
}
bool IntTryFromBinary(Int *out, Zstr binary) {
u64 start = 0;
u64 len = 0;- In
Int.c:758:
}
Int int_from_binary(Zstr binary, Allocator *alloc) {
Int out = IntInit(alloc);- In
Int.c:769:
}
bool IntTryFromOctStr(Int *out, Zstr octal) {
u64 start = 0;
u64 len = 0;- In
Int.c:785:
}
Int int_from_oct_str(Zstr octal, Allocator *alloc) {
Int out = IntInit(alloc);- In
Int.c:796:
}
bool IntTryFromHexStr(Int *out, Zstr hex) {
if (!out || !hex) {
LOG_FATAL("Invalid arguments");- In
Int.c:804:
}
Int int_from_hex_str(Zstr hex, Allocator *alloc) {
Int out = IntInit(alloc);- In
Str.c:8:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Vec/Private.h>
#include <Misra/Std/Log.h>- In
Str.c:162:
}
StrIters StrSplitToIters(Str *s, Zstr key) {
ValidateStr(s);- In
Str.c:186:
}
Strs StrSplit(Str *s, Zstr key) {
ValidateStr(s);- In
Str.c:250:
}
size StrIndexOfZstr(const Str *s, Zstr key) {
if (!key) {
LOG_FATAL("Invalid arguments");- In
Str.c:276:
}
bool StrContainsZstr(const Str *s, Zstr key) {
return StrIndexOfZstr(s, key) != SIZE_MAX;
}- In
Str.c:298:
// = -1 means from left
// = 1 means from right
Str strip_str(Str *s, Zstr chars_to_strip, int split_direction) {
ValidateStr(s);- In
Str.c:331:
}
bool StrStartsWithZstr(const Str *s, Zstr prefix) {
ValidateStr(s);
return starts_with(s->data, s->length, prefix, ZstrLen(prefix));- In
Str.c:336:
}
bool StrEndsWithZstr(const Str *s, Zstr suffix) {
ValidateStr(s);
return ends_with(s->data, s->length, suffix, ZstrLen(suffix));- In
Str.c:380:
}
void StrReplaceZstr(Str *s, Zstr match, Zstr replacement, size count) {
ValidateStr(s);
str_replace(s, match, ZstrLen(match), replacement, ZstrLen(replacement), count);- In
Float.c:8:
#include <Misra/Std/Container/Float.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Float/Private.h>
#include <Misra/Std/Container/Int.h>- In
Float.c:489:
}
bool FloatTryFromStr(Float *out, Zstr text) {
Float result;
Str digits;- In
Float.c:594:
}
Float float_from_str(Zstr text, Allocator *alloc) {
Float result = FloatInit(alloc);- In
Std.h:26:
#include <Misra/Std/Memory.h>
#include <Misra/Std/Utility.h>
#include <Misra/Std/Zstr.h>
#if FEATURE_ALLOC_ARENA- In
Sys.h:11:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Sys/Errno.h>
#include <Misra/Sys/Mutex.h>- In
Sys.h:104:
/// TAGS: Environment
///
Zstr EnvGet(Zstr name);
///
- In
Dir.h:5:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
typedef enum DirEntryType {- In
Dir.h:28:
/// TAGS: System, Conversion, String, Utility
///
Zstr DirEntryTypeToZstr(DirEntryType type);
///
- In
Dir.h:98:
/// TAGS: System, FileSystem, Directory
///
DirContents dir_get_contents(Zstr path, Allocator *alloc);
#define DirGetContents(...) MISRA_OVERLOAD(DirGetContents, __VA_ARGS__)
#define DirGetContents_1(path) \- In
Dir.h:125:
/// TAGS: System, File, Metadata
///
i64 file_get_size(Zstr filename);
#define FileGetSize(path) \
_Generic( \- In
Dir.h:153:
/// TAGS: System, File, FileSystem
///
i8 file_remove(Zstr path);
#define FileRemove(path) \
_Generic( \- In
Dir.h:176:
/// TAGS: System, Directory, FileSystem
///
i8 dir_remove(Zstr path);
#define DirRemove(path) \
_Generic( \- In
Dir.h:199:
/// TAGS: System, Directory, FileSystem
///
i8 dir_create(Zstr path);
#define DirCreate(path) \
_Generic( \- In
Dir.h:221:
/// TAGS: System, Directory, FileSystem
///
i8 dir_create_all(Zstr path);
#define DirCreateAll(path) \
_Generic( \- In
Dir.h:242:
/// TAGS: System, Directory, FileSystem
///
i8 dir_remove_all(Zstr path);
#define DirRemoveAll(path) \
_Generic( \- In
KvConfig.h:14:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Utility/StrIter.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Types.h>- In
KvConfig.h:194:
/// FAILURE : Empty `Str` if key does not exist.
///
Str KvConfigGet(KvConfig *cfg, Zstr key);
///
- In
KvConfig.h:205:
/// FAILURE : `NULL` if key does not exist.
///
Str *KvConfigGetPtr(KvConfig *cfg, Zstr key);
///
- In
KvConfig.h:216:
/// FAILURE : `false`
///
bool KvConfigContains(KvConfig *cfg, Zstr key);
///
- In
KvConfig.h:230:
/// FAILURE : `false`
///
bool KvConfigGetBool(KvConfig *cfg, Zstr key, bool *value);
///
- In
KvConfig.h:242:
/// FAILURE : `false`
///
bool KvConfigGetI64(KvConfig *cfg, Zstr key, i64 *value);
///
- In
KvConfig.h:254:
/// FAILURE : `false`
///
bool KvConfigGetF64(KvConfig *cfg, Zstr key, f64 *value);
#endif // MISRA_PARSERS_KVCONFIG_H
- In
Pdb.h:31:
#include <Misra/Std/Container/Buf.h>
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Types.h>- In
Pdb.h:119:
/// TAGS: Parser, PDB, File
///
bool pdb_open(Pdb *out, Zstr path, Allocator *alloc);
#define PdbOpen(...) MISRA_OVERLOAD(PdbOpen, __VA_ARGS__)
#define PdbOpen_2(out, path) \- In
MachO.h:28:
#include <Misra/Std/Container/Buf.h>
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Types.h>- In
MachO.h:124:
/// TAGS: Parser, MachO, File
///
bool macho_open(Macho *out, Zstr path, Allocator *alloc);
#define MachoOpen(...) MISRA_OVERLOAD(MachoOpen, __VA_ARGS__)
#define MachoOpen_2(out, path) \- In
MachO.h:196:
/// absent.
///
const MachoSection *MachoFindSection(const Macho *self, Zstr segment, Zstr section);
///
- In
Http.h:76:
/// FAILURE : NULL if no header matches.
///
HttpHeader *HttpHeadersFind(HttpHeaders *headers, Zstr key);
typedef enum HttpResponseCode {- In
Http.h:229:
/// FAILURE : Returns `in` unchanged when the input is malformed.
///
const char *HttpRequestParse(HttpRequest *req, Zstr in);
///
- In
Http.h:284:
///
HttpResponse *
HttpRespondWithFile(HttpResponse *response, HttpResponseCode status, HttpContentType content_type, Zstr filepath);
#endif- In
Pe.h:22:
#include <Misra/Std/Container/Buf.h>
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Types.h>- In
Pe.h:121:
/// TAGS: Parser, PE, File
///
bool pe_open(Pe *out, Zstr path, Allocator *alloc);
#define PeOpen(...) MISRA_OVERLOAD(PeOpen, __VA_ARGS__)
#define PeOpen_2(out, path) \- In
Pe.h:188:
/// they're vanishingly rare).
///
const PeSection *PeFindSection(const Pe *self, Zstr name);
///
- In
Elf.h:24:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Types.h>- In
Elf.h:205:
/// TAGS: Parser, ELF, File
///
bool elf_open(Elf *out, Zstr path, Allocator *alloc);
#define ElfOpen(...) MISRA_OVERLOAD(ElfOpen, __VA_ARGS__)
#define ElfOpen_2(out, path) \- In
Elf.h:313:
/// Find a section by name (first match). Returns NULL if absent.
///
const ElfSection *ElfFindSection(const Elf *self, Zstr name);
#endif // MISRA_PARSERS_ELF_H
- In
File.h:15:
#include <Misra/Std/Container/Buf.h>
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Sys.h>
#include <Misra/Types.h>- In
File.h:73:
/// FAILURE : Returns a File where `FileIsOpen(&out)` is false.
///
File file_open(Zstr path, Zstr mode);
#define FileOpen(path, mode) \
_Generic( \- In
File.h:169:
/// TAGS: File, Read
///
i64 file_read_and_close_to_buf(Zstr path, Buf *out);
i64 file_read_and_close_to_str(Zstr path, Str *out);
#define FileReadAndClose(path, out) \- In
File.h:170:
///
i64 file_read_and_close_to_buf(Zstr path, Buf *out);
i64 file_read_and_close_to_str(Zstr path, Str *out);
#define FileReadAndClose(path, out) \
_Generic( \- In
File.h:216:
/// TAGS: File, Write
///
i64 file_write_and_close_from_buf(Zstr path, const Buf *in);
i64 file_write_and_close_from_str(Zstr path, const Str *in);
i64 file_write_and_close_from_bytes(Zstr path, const void *buf, u64 n);- In
File.h:217:
///
i64 file_write_and_close_from_buf(Zstr path, const Buf *in);
i64 file_write_and_close_from_str(Zstr path, const Str *in);
i64 file_write_and_close_from_bytes(Zstr path, const void *buf, u64 n);
#define FileWriteAndClose(...) MISRA_OVERLOAD(FileWriteAndClose, __VA_ARGS__)- In
File.h:218:
i64 file_write_and_close_from_buf(Zstr path, const Buf *in);
i64 file_write_and_close_from_str(Zstr path, const Str *in);
i64 file_write_and_close_from_bytes(Zstr path, const void *buf, u64 n);
#define FileWriteAndClose(...) MISRA_OVERLOAD(FileWriteAndClose, __VA_ARGS__)
#define FileWriteAndClose_2(path, container) \- In
Log.h:174:
/// by design; there is no upstream reporter to surface to).
///
void LogWrite(LogMessageType type, Zstr tag, u64 line, Zstr msg);
#endif // MISRA_STD_LOG_H
- In
ArgParse.h:44:
#include <Misra/Std/Container/Str.h>
#include <Misra/Std/Container/Vec.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Types.h>- In
ArgParse.h:152:
/// FAILURE: Aborts via `LOG_FATAL` on allocator OOM.
///
ArgParse arg_parse_init(Zstr name, Zstr about, Allocator *alloc);
#define ArgParseInit(...) MISRA_OVERLOAD(ArgParseInit, __VA_ARGS__)- In
Zstr.h:21:
/// glance; internal helpers may keep raw `const char *`.
typedef const char *Zstr;
typedef Vec(Zstr) Zstrs;
///
- In
Io.h:12:
#include <Misra/Std/Container.h>
#include <Misra/Std/Container/Buf.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/File.h>
#include <Misra/Types.h>- In
Io.h:229:
Str: TO_TYPE_SPECIFIC_IO(Str, &(x)), \
IOFMT_FLOAT_CASE_(x, &(x)) IOFMT_INT_CASE_(x, &(x)) IOFMT_BITVEC_CASE_(x, &(x)) \
const char *: TO_TYPE_SPECIFIC_IO(Zstr, &(x)), \
char *: TO_TYPE_SPECIFIC_IO(Zstr, &(x)), \
unsigned char: TO_TYPE_SPECIFIC_IO(u8, &(x)), \
- In
Io.h:230:
IOFMT_FLOAT_CASE_(x, &(x)) IOFMT_INT_CASE_(x, &(x)) IOFMT_BITVEC_CASE_(x, &(x)) \
const char *: TO_TYPE_SPECIFIC_IO(Zstr, &(x)), \
char *: TO_TYPE_SPECIFIC_IO(Zstr, &(x)), \
unsigned char: TO_TYPE_SPECIFIC_IO(u8, &(x)), \
unsigned short: TO_TYPE_SPECIFIC_IO(u16, &(x)), \
- In
Io.h:267:
Str: TO_TYPE_SPECIFIC_IO(Str, (void *)&(x)), \
IOFMT_FLOAT_CASE_(x, (void *)&(x)) IOFMT_INT_CASE_(x, (void *)&(x)) IOFMT_BITVEC_CASE_(x, (void *)&(x)) \
const char *: TO_TYPE_SPECIFIC_IO(Zstr, (void *)&(x)), \
char *: TO_TYPE_SPECIFIC_IO(Zstr, (void *)&(x)), \
unsigned char: TO_TYPE_SPECIFIC_IO(u8, (void *)&(x)), \
- In
Io.h:268:
IOFMT_FLOAT_CASE_(x, (void *)&(x)) IOFMT_INT_CASE_(x, (void *)&(x)) IOFMT_BITVEC_CASE_(x, (void *)&(x)) \
const char *: TO_TYPE_SPECIFIC_IO(Zstr, (void *)&(x)), \
char *: TO_TYPE_SPECIFIC_IO(Zstr, (void *)&(x)), \
unsigned char: TO_TYPE_SPECIFIC_IO(u8, (void *)&(x)), \
unsigned short: TO_TYPE_SPECIFIC_IO(u16, (void *)&(x)), \
- In
Convert.h:91:
/// TAGS: Float, Convert, Parse, Decimal
///
bool FloatTryFromStr(Float *out, Zstr text);
///
- In
Convert.h:98:
/// SUCCESS : Returns Parsed floating-point value, or zero on failure.
///
Float float_from_str(Zstr text, Allocator *alloc);
#define FloatFromStr(...) MISRA_OVERLOAD(FloatFromStr, __VA_ARGS__)
#define FloatFromStr_1(text) float_from_str((text), MisraScope)- In
Ops.h:12:
#include "Type.h"
#include <Misra/Std/Utility/StrIter.h>
#include <Misra/Std/Zstr.h>
#ifdef __cplusplus- In
Ops.h:126:
/// TAGS: Str, IndexOf, Search
///
size StrIndexOfZstr(const Str *s, Zstr key);
///
- In
Ops.h:166:
/// TAGS: Str, Contains, Search
///
bool StrContainsZstr(const Str *s, Zstr key);
///
- In
Ops.h:195:
/// FAILURE : Returns `false`. The string is not modified.
///
bool StrStartsWithZstr(const Str *s, Zstr prefix);
///
- In
Ops.h:206:
/// FAILURE : Returns `false`. The string is not modified.
///
bool StrEndsWithZstr(const Str *s, Zstr suffix);
///
- In
Ops.h:269:
/// FAILURE : No replacement if `match` not found.
///
void StrReplaceZstr(Str *s, Zstr match, Zstr replacement, size count);
///
- In
Ops.h:325:
/// FAILURE : StrIters vector of zero-length
///
StrIters StrSplitToIters(Str *s, Zstr key);
///
- In
Ops.h:342:
/// FAILURE : Strs vector of zero-length
///
Strs StrSplit(Str *s, Zstr key);
//
- In
Ops.h:352:
/// Used by StrStrip, StrLStrip, and StrRStrip macros.
///
Str strip_str(Str *s, Zstr key, int split_direction);
///
- In
Init.h:12:
#include "Type.h"
#include <Misra/Std/Memory.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Container/Vec/Type.h>- In
Insert.h:11:
#include "Type.h"
#include <Misra/Std/Zstr.h>
#ifdef __cplusplus- In
Convert.h:121:
/// TAGS: Int, Convert, Parse, Radix
///
bool IntTryFromStrRadix(Int *out, Zstr digits, u8 radix);
///
- In
Convert.h:128:
/// SUCCESS : Returns Parsed integer value, or zero on failure.
///
Int int_from_str_radix(Zstr digits, u8 radix, Allocator *alloc);
#define IntFromStrRadix(...) MISRA_OVERLOAD(IntFromStrRadix, __VA_ARGS__)
#define IntFromStrRadix_2(digits, radix) int_from_str_radix((digits), (radix), MisraScope)- In
Convert.h:168:
/// TAGS: Int, Convert, Parse, Decimal
///
bool IntTryFromStr(Int *out, Zstr decimal);
///
- In
Convert.h:175:
/// SUCCESS : Returns Parsed integer value, or zero on failure.
///
Int int_from_str(Zstr decimal, Allocator *alloc);
#define IntFromStr(...) MISRA_OVERLOAD(IntFromStr, __VA_ARGS__)
#define IntFromStr_1(decimal) int_from_str((decimal), MisraScope)- In
Convert.h:213:
/// TAGS: Int, Convert, Parse, Binary
///
bool IntTryFromBinary(Int *out, Zstr binary);
///
- In
Convert.h:220:
/// SUCCESS : Returns Parsed integer value, or zero on failure.
///
Int int_from_binary(Zstr binary, Allocator *alloc);
#define IntFromBinary(...) MISRA_OVERLOAD(IntFromBinary, __VA_ARGS__)
#define IntFromBinary_1(binary) int_from_binary((binary), MisraScope)- In
Convert.h:249:
/// TAGS: Int, Convert, Parse, Octal
///
bool IntTryFromOctStr(Int *out, Zstr octal);
///
- In
Convert.h:256:
/// SUCCESS : Returns Parsed integer value, or zero on failure.
///
Int int_from_oct_str(Zstr octal, Allocator *alloc);
#define IntFromOctStr(...) MISRA_OVERLOAD(IntFromOctStr, __VA_ARGS__)
#define IntFromOctStr_1(octal) int_from_oct_str((octal), MisraScope)- In
Convert.h:287:
/// TAGS: Int, Convert, Parse, Hex
///
bool IntTryFromHexStr(Int *out, Zstr hex);
///
- In
Convert.h:294:
/// SUCCESS : Returns Parsed integer value, or zero on failure.
///
Int int_from_hex_str(Zstr hex, Allocator *alloc);
#define IntFromHexStr(...) MISRA_OVERLOAD(IntFromHexStr, __VA_ARGS__)
#define IntFromHexStr_1(hex) int_from_hex_str((hex), MisraScope)- In
StrIter.h:5:
#include <Misra/Std/Container/Vec/Type.h>
#include <Misra/Std/Zstr.h>
#include <Misra/Std/Utility/Iter.h>
#include <Misra/Types.h>
Last updated on