File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / vars.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:39:23 2021 UTC (4 years ago) by misho
Branches: mpd, MAIN
CVS tags: v5_9p16, v5_9, HEAD
mpd 5.9

    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 "defs.h"
   18: 
   19: #include <sys/types.h>
   20: 
   21: /*
   22:  * DEFINITIONS
   23:  */
   24: 
   25: /* Describes one option */
   26: 
   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;
   33: 
   34: /* Generic option configuration structure */
   35: 
   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)))
   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, 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);
   61: 
   62: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>