Debian Codegraph @

runtime/cfsysline.h

raw
1 /* Definition of the cfsysline (config file system line) object.
2 *
3 * Copyright 2007-2012 Adiscon GmbH.
4 *
5 * This file is part of the rsyslog runtime library.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 * -or-
13 * see COPYING.ASL20 in the source distribution
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 #ifndef CFSYSLINE_H_INCLUDED
23 #define CFSYSLINE_H_INCLUDED
24
25 #include "linkedlist.h"
26
27 /* this is a single entry for a parse routine. It describes exactly
28 * one entry point/handler.
29 * The short name is cslch (Configfile SysLine CommandHandler)
30 */
31 struct cslCmdHdlr_s { /* config file sysline parse entry */
32 ecslConfObjType __attribute__((deprecated)) eConfObjType; /* which config object is this for? */
33 ecslCmdHdrlType eType; /* which type of handler is this? */
34 rsRetVal (*cslCmdHdlr)(); /* function pointer to use with handler (params depending on eType) */
35 void *pData; /* user-supplied data pointer */
36 int *permitted; /* is this parameter currently permitted? (NULL=don't check) */
37 };
38 typedef struct cslCmdHdlr_s cslCmdHdlr_t;
39
40
41 /* this is the list of known configuration commands with pointers to
42 * their handlers.
43 * The short name is cslc (Configfile SysLine Command)
44 */
45 struct cslCmd_s { /* config file sysline parse entry */
46 int bChainingPermitted; /* may multiple handlers be chained for this command? */
47 linkedList_t llCmdHdlrs; /* linked list of command handlers */
48 };
49 typedef struct cslCmd_s cslCmd_t;
50
51 /* prototypes */
52 rsRetVal regCfSysLineHdlr(const uchar *pCmdName,
53 int bChainingPermitted,
54 ecslCmdHdrlType eType,
55 rsRetVal (*pHdlr)(),
56 void *pData,
57 void *pOwnerCookie);
58 rsRetVal regCfSysLineHdlr2(const uchar *pCmdName,
59 int bChainingPermitted,
60 ecslCmdHdrlType eType,
61 rsRetVal (*pHdlr)(),
62 void *pData,
63 void *pOwnerCookie,
64 int *permitted);
65 rsRetVal unregCfSysLineHdlrs(void);
66 rsRetVal unregCfSysLineHdlrs4Owner(void *pOwnerCookie);
67 rsRetVal processCfSysLineCommand(uchar *pCmd, uchar **p);
68 rsRetVal cfsyslineInit(void);
69 void dbgPrintCfSysLineHandlers(void);
70
71 #endif /* #ifndef CFSYSLINE_H_INCLUDED */