#define PW_TYPE_IS_SET (1 << 21) //!< Write whether this config item was
//!< left as the default to is_set_offset
//!< or is_set_ptr.
+
+#define PW_BASE_TYPE(_t) (0xff & (_t))
/* @} **/
#define FR_INTEGER_COND_CHECK(_name, _var, _cond, _new)\
attribute = (type & PW_TYPE_ATTRIBUTE);
multi = (type & PW_TYPE_MULTI);
- type &= 0xff; /* normal types are small */
+ type = PW_BASE_TYPE(type); /* normal types are small */
/*
* It's a section, recurse!
if (required) cant_be_empty = true; /* May want to review this in the future... */
- type &= 0xff; /* normal types are small */
+ type = PW_BASE_TYPE(type); /* normal types are small */
/*
* Everything except templates must have a base type.
CONF_PAIR *cp;
char buffer[8192];
- type &= 0xff;
+ type = PW_BASE_TYPE(type);
/*
* Defaults may need their values expanding
* We don't NULL terminate. Consumer must use
* talloc_array_length().
*/
- } else switch (type & 0xff) {
+ } else switch (PW_BASE_TYPE(type)) {
case PW_TYPE_BOOLEAN:
array = (void **)talloc_zero_array(cs, bool, count);
break;
int i;
for (i = 0; variables[i].name != NULL; i++) {
- if ((variables[i].type & 0xff) == PW_TYPE_SUBSECTION) {
+ if (PW_BASE_TYPE(variables[i].type) == PW_TYPE_SUBSECTION) {
CONF_SECTION *subcs;
if (!variables[i].dflt) continue;
continue;
}
- if ((variables[i].type != PW_TYPE_STRING) &&
+ if ((PW_BASE_TYPE(variables[i].type) != PW_TYPE_STRING) &&
(variables[i].type != PW_TYPE_FILE_INPUT) &&
(variables[i].type != PW_TYPE_FILE_OUTPUT)) {
continue;
/*
* Handle subsections specially
*/
- if (variables[i].type == PW_TYPE_SUBSECTION) {
+ if (PW_BASE_TYPE(variables[i].type) == PW_TYPE_SUBSECTION) {
CONF_SECTION *subcs;
subcs = cf_section_sub_find(cs, variables[i].name);