2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
5 * Copyright (C) 2005 - 2007 The AROS Dev Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23 #ifndef AMIGA_CONFIG_H
24 #define AMIGA_CONFIG_H
26 #include <dos/rdargs.h>
28 extern BOOL initialized
; /* are we up? */
30 #define CURRENT(X) ((X)->CS_Buffer+(X)->CS_CurChr)
31 #define SPACE(X) ((X)->CS_Length-(X)->CS_CurChr)
33 #define KEYWORDLEN 24 /* buffer len for keywords */
34 #define CONFIGLINELEN 1024 /* buffer len for configuration line */
35 #define REPLYBUFLEN 255
38 /* Parsing error messages */
39 extern UBYTE ERR_UNKNOWN
[];
40 extern UBYTE ERR_ILLEGAL_VAR
[];
41 extern UBYTE ERR_ILLEGAL_IND
[];
42 extern UBYTE ERR_SYNTAX
[];
43 extern UBYTE ERR_TOO_LONG
[];
44 extern UBYTE ERR_MEMORY
[];
45 extern UBYTE ERR_NONETDB
[];
46 extern UBYTE ERR_VALUE
[];
47 extern UBYTE ERR_NOWRITE
[];
49 /* The command keywords and their tokens */
50 /* Note: ROUTE is currently not implemented */
51 #define REXXKEYWORDS "Q=QUERY,S=SET,READ,ROUTE,ADD,RESET,KILL"
53 { KEY_QUERY
, KEY_SET
, KEY_READ
, KEY_ROUTE
, KEY_ADD
, KEY_RESET
, KEY_KILL
};
56 /* Note: Query calls value, Set calls notify functions */
59 VAR_FUNC
= 1, /* value is function pointer */
60 VAR_LONG
, /* value is pointer to LONG */
61 VAR_STRP
, /* value is pointer to string */
62 VAR_FLAG
, /* LONG value is set once */
63 VAR_INET
, /* struct sockaddr_in */
64 VAR_ENUM
/* value is pointer to long, whose value is set
65 according to a enumeration string in notify */
69 (*var_f
)(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
70 typedef int (*notify_f
)(void *pt
, IPTR
new);
72 /* Configurable variable structure */
74 enum var_type type
; /* type of value */
75 WORD flags
; /* see below */
76 const UBYTE
*index
; /* optional index keyword list */
77 void *value
; /* pointer to value... */
78 notify_f notify
; /* notification function */
81 #define boolean_enum (notify_f)"NO=FALSE=OFF=0,YES=TRUE=ON=1"
84 #define VF_TABLE (1<<0) /* with an index... */
85 #define VF_READ (1<<1) /* readable */
86 #define VF_WRITE (1<<2) /* writeable */
87 #define VF_CONF (1<<3) /* writeable only during configuration */
88 #define VF_RW (VF_WRITE|VF_READ)
89 #define VF_RCONF (VF_CONF|VF_READ)
90 #define VF_FREE (1<<8) /* free when replaced? */
92 BOOL
readconfig(void);
94 LONG
parsefile(UBYTE
const *fname
, UBYTE
**errstrp
, struct CSource
*res
);
95 LONG
parseline(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
96 LONG
readfile(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
97 LONG
getvalue(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
98 LONG
setvalue(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
99 LONG
sendbreak(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
101 /*LONG read_gets(struct CSource *args, UBYTE **errstrp, struct CSource *res);*/
102 LONG
read_sets(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
104 LONG
parseroute(struct CSource
*args
, UBYTE
**errstrp
, struct CSource
*res
);
106 #endif /* !AMIGA_CONFIG_H */