Parse a shell (environment) variable to its components.
- Parameters
-
- Returns
- the variable components, tokenized with ':' (heap allocated)
- Exceptions
-
Definition at line 128 of file util.cpp.
References __D_ASSERT, csdbg::chain< T >::add(), csdbg::string::append(), csdbg::string::length(), likely, and unlikely.
Referenced by csdbg::tracer::on_lib_load().
138 chain<string> *retval =
new chain<string>;
139 string *token = NULL;
145 for (
u32 i = 0, sz = strlen(val);
likely(i < sz); i++) {
152 else if (
likely(token->length() > 0) ) {
160 if (
likely(token->length() > 0) )
char i8
8-bit signed integer
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
unsigned int u32
32-bit unsigned integer
static chain< string > * getenv(const i8 *)
Parse a shell (environment) variable to its components.
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
#define __D_ASSERT(x)
Assertion macro.