Add __attribute__((__noreturn__)) to various function prototypes in bin/.
[dragonfly.git] / sbin / devfsctl / devfsctl.h
blobca3fc4f2ae1c0b37a78d846f70618ec71c4bd176
1 #ifndef DEVFSCTL_H
2 #define DEVFSCTL_H
4 #include <sys/queue.h>
6 #define iswhitespace(X) ((((X) == ' ') || ((X) == '\t'))?1:0)
7 #define RULE_MAX_STACK 32
8 #define RULES_FILE 0x01
10 #if 0
11 #define RULETAB_FILE 0x02
12 #define RULETAB_ALL 0x01
13 #define RULETAB_ONLY_BOOT 0x02
14 #define RULETAB_SPECIFIC 0x03
15 #endif
17 struct groupdevid {
18 enum {
19 isGROUP = 1,
20 isNAME,
21 isTYPE
22 } type;
24 union {
25 char *name;
26 int devtype;
29 struct groupdevid **list;
30 size_t listsize;
31 #if 0
32 struct groupdevid *next;
33 TAILQ_HEAD(, groupdevid) list;
34 #endif
35 TAILQ_ENTRY(groupdevid) link;
38 struct rule {
39 enum {
40 rPERM = 1,
41 rLINK,
42 rHIDE,
43 rSHOW
44 } type;
46 struct groupdevid *id;
47 char *dest;
48 uid_t uid;
49 uid_t gid;
50 int mode;
51 int jail;
53 TAILQ_ENTRY(rule) link;
56 #if 0
57 struct rule_tab {
58 const char *mntpoint;
59 const char *rule_file;
60 TAILQ_ENTRY(rule_tab) link;
62 #endif
64 typedef int (rule_iterate_callback_t)(struct rule *rule,
65 struct groupdevid *id);
66 typedef int (rule_parser_t)(char **);
68 struct groupdevid *new_id(const char *, int);
69 struct groupdevid *get_id(const char *);
70 struct groupdevid *get_group(const char *, int);
71 struct rule *new_rule(int, struct groupdevid *);
72 void add_rule(struct rule *);
73 int rule_apply(void);
74 void dump_config(void);
75 int read_config(const char *, int);
76 int syntax_error(const char *fmt, ...) __printflike(1, 2);
77 void rule_tab(void);
78 void delete_rules(void);
79 #endif