Annotation of embedaddon/mpd/src/vars.h, revision 1.1.1.2
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''
1.1.1.2 ! misho 8: *
1.1 misho 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:
1.1.1.2 ! misho 17: #include "defs.h"
! 18:
1.1 misho 19: #include <sys/types.h>
20:
21: /*
22: * DEFINITIONS
23: */
24:
25: /* Describes one option */
26:
1.1.1.2 ! misho 27: struct confinfo {
! 28: u_char peered; /* Is accept/deny applicable? */
! 29: u_char option; /* Option index (0 <= value < 16) */
! 30: const char *name; /* Textual name; NULL ends list */
! 31: };
! 32: typedef const struct confinfo *ConfInfo;
1.1 misho 33:
34: /* Generic option configuration structure */
35:
1.1.1.2 ! misho 36: struct optinfo {
! 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)))
1.1 misho 46:
1.1.1.2 ! misho 47: #define Enabled(c,x) (((c)->enable & (1<<(x))) != 0)
! 48: #define Acceptable(c,x) (((c)->accept & (1<<(x))) != 0)
1.1 misho 49:
50: /*
51: * FUNCTIONS
52: */
53:
1.1.1.2 ! misho 54: extern void AcceptCommand(int ac, const char *const av[], Options opt, ConfInfo conf);
! 55: extern void DenyCommand(int ac, const char *const av[], Options opt, ConfInfo conf);
! 56: extern void EnableCommand(int ac, const char *const av[], Options opt, ConfInfo conf);
! 57: extern void DisableCommand(int ac, const char *const av[], Options opt, ConfInfo conf);
! 58: extern void YesCommand(int ac, const char *const av[], Options opt, ConfInfo conf);
! 59: extern void NoCommand(int ac, const char *const av[], Options opt, ConfInfo conf);
! 60: extern void OptStat(Context ctx, Options c, ConfInfo conf);
1.1 misho 61:
62: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>