| 1 |
/* header for strgen.c |
| 2 |
* |
| 3 |
* Copyright 2010-2026 Rainer Gerhards and Adiscon GmbH. |
| 4 |
* |
| 5 |
* This file is part of the rsyslog runtime library. |
| 6 |
* |
| 7 |
* The rsyslog runtime library is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU Lesser General Public License as published by |
| 9 |
* the Free Software Foundation, either version 3 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* The rsyslog runtime library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU Lesser General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public License |
| 18 |
* along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
* |
| 20 |
* A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. |
| 21 |
*/ |
| 22 |
#ifndef INCLUDED_STRGEN_H |
| 23 |
#define INCLUDED_STRGEN_H |
| 24 |
|
| 25 |
|
| 26 |
/* we create a small helper object, a list of strgens, that we can use to |
| 27 |
* build a chain of them whereever this is needed. |
| 28 |
*/ |
| 29 |
struct strgenList_s { |
| 30 |
strgen_t *pStrgen; |
| 31 |
strgenList_t *pNext; |
| 32 |
}; |
| 33 |
|
| 34 |
|
| 35 |
/* the strgen object, a dummy because we have only static methods */ |
| 36 |
struct strgen_s { |
| 37 |
BEGINobjInstance |
| 38 |
; /* Data to implement generic object - MUST be the first data element! */ |
| 39 |
uchar *pName; /* name of this strgen */ |
| 40 |
modInfo_t *pModule; /* pointer to strgen's module */ |
| 41 |
}; |
| 42 |
|
| 43 |
/* interfaces */ |
| 44 |
BEGINinterface(strgen) /* name must also be changed in ENDinterface macro! */ |
| 45 |
rsRetVal (*Construct)(strgen_t **ppThis); |
| 46 |
rsRetVal (*ConstructFinalize)(strgen_t *pThis); |
| 47 |
rsRetVal (*Destruct)(strgen_t **ppThis); |
| 48 |
rsRetVal (*SetName)(strgen_t *pThis, uchar *name); |
| 49 |
rsRetVal (*SetModPtr)(strgen_t *pThis, modInfo_t *pMod); |
| 50 |
rsRetVal (*FindStrgen)(strgen_t **ppThis, uchar *name); |
| 51 |
rsRetVal (*InitStrgenList)(strgenList_t **pListRoot); |
| 52 |
rsRetVal (*DestructStrgenList)(strgenList_t **pListRoot); |
| 53 |
rsRetVal (*AddStrgenToList)(strgenList_t **pListRoot, strgen_t *pStrgen); |
| 54 |
ENDinterface(strgen) |
| 55 |
#define strgenCURR_IF_VERSION 1 /* increment whenever you change the interface above! */ |
| 56 |
|
| 57 |
|
| 58 |
/* prototypes */ |
| 59 |
PROTOTYPEObjFull(strgen); |
| 60 |
#endif /* #ifndef INCLUDED_STRGEN_H */ |