iso9660fs: initialize buffer cache
[minix.git] / include / minix / optset.h
blob8d43fe23f4fd6f78cd66c19b1a0e3823657c7d48
1 #ifndef _MINIX_OPTSET_H
2 #define _MINIX_OPTSET_H
4 typedef enum {
5 OPT_BOOL,
6 OPT_STRING,
7 OPT_INT
8 } optset_type;
10 /* An entry for the parser of an options set. The 'os_name' field must point
11 * to a string, which is treated case-insensitively; the last entry of a table
12 * must have NULL name. The 'os_type' field must be set to one of the OPT_
13 * values defined above. The 'os_ptr' field must point to the field that is to
14 * receive the value of a recognized option. For OPT_STRING, it must point to a
15 * string of a size set in 'os_val'; the resulting string may be truncated, but
16 * will always be null-terminated. For OPT_BOOL, it must point to an int which
17 * will be set to the value in 'os_val' if the option is present. For OPT_INT,
18 * it must point to an int which will be set to the provided option value;
19 * 'os_val' is then a base passed to strtol().
21 struct optset {
22 char *os_name;
23 optset_type os_type;
24 void *os_ptr;
25 int os_val;
28 void optset_parse(struct optset *table, char *string);
30 #endif /* _MINIX_OPTSET_H */