cstring · Section 3
cstr_construct_mp_scoped
NAME
cstr_construct_mp_scoped - declare and initialise a cstr with custom mprocs and RAII
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> cstr_construct_mp_scoped(s, initial, mprocs);
DESCRIPTION
This macro does cstr_declare_scoped() and cstr_init_mp() in one statement. Once the variable leaves its scope the string is destroyed automatically, through the same custom memory management procedures.
PARAMETERS
s Variable name to create initial Initial content (C string or NULL for empty string) mprocs Custom memory management procedures (ccol_memmgmt_procs *)
NOTES
This macro needs GCC or Clang, because it uses __attribute__((cleanup))