2011-10-31 19:04:16 +00:00
|
|
|
#ifndef PSYC_VARIABLE_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file psyc/variable.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
/// Routing variables in alphabetical order.
|
2011-10-31 19:26:47 +00:00
|
|
|
extern const PsycString psyc_routing_vars[];
|
2011-10-31 19:04:16 +00:00
|
|
|
|
|
|
|
// Variable types in alphabetical order.
|
2011-10-31 19:26:47 +00:00
|
|
|
extern const PsycMatchVar psyc_var_types[];
|
2011-10-31 19:04:16 +00:00
|
|
|
|
|
|
|
extern const size_t psyc_routing_vars_num;
|
|
|
|
extern const size_t psyc_var_types_num;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this a routing variable name?
|
|
|
|
*/
|
2011-10-31 19:26:47 +00:00
|
|
|
PsycBool psyc_var_is_routing (const char *name, size_t len);
|
2011-10-31 19:04:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the type of variable name.
|
|
|
|
*/
|
2011-10-31 19:26:47 +00:00
|
|
|
PsycType psyc_var_type (const char *name, size_t len);
|
2011-10-31 19:04:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this a list variable name?
|
|
|
|
*/
|
|
|
|
static inline
|
2011-10-31 19:26:47 +00:00
|
|
|
PsycBool psyc_var_is_list (const char *name, size_t len)
|
2011-10-31 19:04:16 +00:00
|
|
|
{
|
|
|
|
return len < 5 || memcmp(name, "_list", 5) != 0 ||
|
|
|
|
(len > 5 && name[5] != '_') ? PSYC_FALSE : PSYC_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define PSYC_VARIABLE_H
|
|
|
|
#endif
|