CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
strliteral.h File Reference

String literal prefix macros and compile-time constant declarations. More...

Go to the source code of this file.

Macros

#define _S
 Creates a static ASCII string literal (STR_LEN0, runtime strlen). Prefer _SL() on hot paths when targeting GCC/Clang.
 
#define _SU
 Creates a static UTF-8 string literal (STR_LEN0, runtime strlen). Prefer _SLU() on hot paths when targeting GCC/Clang.
 
#define _SO
 Creates a static string literal with other/unknown encoding (STR_LEN0, runtime strlen). Prefer _SLO() on hot paths when targeting GCC/Clang.
 
#define STR_CONST(name, s)   _STR_CONST8(name, 0xE1u, s)
 Declare a named ASCII string constant with a compile-time length (STR_LEN8, < 255 bytes).
 
#define STR_CONSTU(name, s)   _STR_CONST8(name, 0xA1u, s)
 Declare a named UTF-8 string constant with a compile-time length (STR_LEN8, < 255 bytes).
 
#define STR_CONSTO(name, s)   _STR_CONST8(name, 0x81u, s)
 
#define STR_CONSTL(name, s)   _STR_CONST16(name, 0xE2u, s)
 Declare a named ASCII string constant with a compile-time length (STR_LEN16, < 65535 bytes).
 
#define STR_CONSTUL(name, s)   _STR_CONST16(name, 0xA2u, s)
 Declare a named UTF-8 string constant with a compile-time length (STR_LEN16, < 65535 bytes).
 
#define STR_CONSTOL(name, s)   _STR_CONST16(name, 0x82u, s)
 
#define STR_CONSTR(name, s)   _STR_CONSTR8(name, 0xE1u, s)
 
#define STR_CONSTRU(name, s)   _STR_CONSTR8(name, 0xA1u, s)
 
#define STR_CONSTRO(name, s)   _STR_CONSTR8(name, 0x81u, s)
 
#define STR_CONSTRL(name, s)   _STR_CONSTR16(name, 0xE2u, s)
 
#define STR_CONSTRUL(name, s)   _STR_CONSTR16(name, 0xA2u, s)
 
#define STR_CONSTROL(name, s)   _STR_CONSTR16(name, 0x82u, s)
 
#define _SR(name)   ((strref)&_cx_sc_##name)
 
#define _SL(s)
 Inline ASCII string literal with compile-time embedded length (STR_LEN8). Content must be < 200 bytes; use _SLL() for longer strings.
 
#define _SLU(s)
 Inline UTF-8 string literal with compile-time embedded length (STR_LEN8). Content must be < 200 bytes; use _SLUL() for longer strings.
 
#define _SLO(s)
 Inline other-encoding string literal with compile-time embedded length (STR_LEN8). Content must be < 200 bytes; use _SLOL() for longer strings.
 
#define _SLL(s)
 Inline ASCII string literal with compile-time embedded length (STR_LEN16). For strings 200–65534 bytes; use _SL() for shorter strings.
 
#define _SLUL(s)
 Inline UTF-8 string literal with compile-time embedded length (STR_LEN16).
 
#define _SLOL(s)
 Inline other-encoding string literal with compile-time embedded length (STR_LEN16).
 

Detailed Description

String literal prefix macros and compile-time constant declarations.

Definition in file strliteral.h.