3 * Joe Hershberger, National Instruments, joe.hershberger@ni.com
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifndef __ENV_FLAGS_H__
25 #define __ENV_FLAGS_H__
27 enum env_flags_vartype {
28 env_flags_vartype_string,
29 env_flags_vartype_decimal,
30 env_flags_vartype_hex,
31 env_flags_vartype_bool,
33 env_flags_vartype_ipaddr,
34 env_flags_vartype_macaddr,
39 #define ENV_FLAGS_VAR ".flags"
40 #define ENV_FLAGS_ATTR_MAX_LEN 2
41 #define ENV_FLAGS_VARTYPE_LOC 0
43 #ifndef CONFIG_ENV_FLAGS_LIST_STATIC
44 #define CONFIG_ENV_FLAGS_LIST_STATIC ""
47 #define ENV_FLAGS_LIST_STATIC \
48 CONFIG_ENV_FLAGS_LIST_STATIC
51 * Parse the flags string from a .flags attribute list into the vartype enum.
53 enum env_flags_vartype env_flags_parse_vartype(const char *flags);
58 * When adding a variable to the environment, initialize the flags for that
61 void env_flags_init(ENTRY *var_entry);
64 * Validate the newval for to conform with the requirements defined by its flags
66 int env_flags_validate(const ENTRY *item, const char *newval, enum env_op op,
70 * These are the binary flags used in the environment entry->flags variable to
71 * decribe properties of veriables in the table
73 #define ENV_FLAGS_VARTYPE_BIN_MASK 0x00000007
74 /* The actual variable type values use the enum value (within the mask) */
76 #endif /* __ENV_FLAGS_H__ */