1
/* Definition of the cfsysline (config file system line) object.
3
* Copyright 2007 Rainer Gerhards and Adiscon GmbH.
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
* A copy of the GPL can be found in the file "COPYING" in this distribution.
22
#ifndef CFSYSLINE_H_INCLUDED
23
#define CFSYSLINE_H_INCLUDED
25
#include "linkedlist.h"
27
/* types of configuration handlers
29
typedef enum cslCmdHdlrType {
30
eCmdHdlrInvalid = 0, /* invalid handler type - indicates a coding error */
31
eCmdHdlrCustomHandler, /* custom handler, just call handler function */
35
eCmdHdlrFileCreateMode,
41
/* this is a single entry for a parse routine. It describes exactly
42
* one entry point/handler.
43
* The short name is cslch (Configfile SysLine CommandHandler)
45
struct cslCmdHdlr_s { /* config file sysline parse entry */
46
ecslCmdHdrlType eType; /* which type of handler is this? */
47
rsRetVal (*cslCmdHdlr)(); /* function pointer to use with handler (params depending on eType) */
48
void *pData; /* user-supplied data pointer */
50
typedef struct cslCmdHdlr_s cslCmdHdlr_t;
53
/* this is the list of known configuration commands with pointers to
55
* The short name is cslc (Configfile SysLine Command)
57
struct cslCmd_s { /* config file sysline parse entry */
58
int bChainingPermitted; /* may multiple handlers be chained for this command? */
59
linkedList_t llCmdHdlrs; /* linked list of command handlers */
61
typedef struct cslCmd_s cslCmd_t;
64
rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData);
65
rsRetVal unregCfSysLineHdlrs(void);
66
rsRetVal processCfSysLineCommand(uchar *pCmd, uchar **p);
67
rsRetVal cfsyslineInit(void);
68
void dbgPrintCfSysLineHandlers(void);
70
#endif /* #ifndef CFSYSLINE_H_INCLUDED */