Annotation of embedaddon/mpd/src/vars.h, revision 1.1.1.1
1.1 misho 1:
2: /*
3: * vars.h
4: *
5: * Written by Toshiharu OHNO <tony-o@iij.ad.jp>
6: * Copyright (c) 1993, Internet Initiative Japan, Inc. All rights reserved.
7: * See ``COPYRIGHT.iij''
8: *
9: * Rewritten by Archie Cobbs <archie@freebsd.org>
10: * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
11: * See ``COPYRIGHT.whistle''
12: */
13:
14: #ifndef _VARS_H_
15: #define _VARS_H_
16:
17: #include <sys/types.h>
18:
19: /*
20: * DEFINITIONS
21: */
22:
23: /* Describes one option */
24:
25: struct confinfo
26: {
27: u_char peered; /* Is accept/deny applicable? */
28: u_char option; /* Option index (0 <= value < 16) */
29: const char *name; /* Textual name; NULL ends list */
30: };
31: typedef const struct confinfo *ConfInfo;
32:
33: /* Generic option configuration structure */
34:
35: struct optinfo
36: {
37: u_int32_t enable; /* Options I want */
38: u_int32_t accept; /* Options I'll allow */
39: };
40: typedef struct optinfo *Options;
41:
42: #define Enable(c,x) ((c)->enable |= (1<<(x)))
43: #define Disable(c,x) ((c)->enable &= ~(1<<(x)))
44: #define Accept(c,x) ((c)->accept |= (1<<(x)))
45: #define Deny(c,x) ((c)->accept &= ~(1<<(x)))
46:
47: #define Enabled(c,x) (((c)->enable & (1<<(x))) != 0)
48: #define Acceptable(c,x) (((c)->accept & (1<<(x))) != 0)
49:
50: /*
51: * FUNCTIONS
52: */
53:
54: extern void AcceptCommand(int ac, char *av[], Options opt, ConfInfo conf);
55: extern void DenyCommand(int ac, char *av[], Options opt, ConfInfo conf);
56: extern void EnableCommand(int ac, char *av[], Options opt, ConfInfo conf);
57: extern void DisableCommand(int ac, char *av[], Options opt, ConfInfo conf);
58: extern void YesCommand(int ac, char *av[], Options opt, ConfInfo conf);
59: extern void NoCommand(int ac, char *av[], Options opt, ConfInfo conf);
60: extern void OptStat(Context ctx, Options c, ConfInfo conf);
61:
62: #endif
63:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>