From ad0011c81447641474216f306ae1b4709c22ea6c Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 17 Nov 2004 14:32:37 +0000 Subject: begin templates --- template.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 template.c (limited to 'template.c') diff --git a/template.c b/template.c new file mode 100644 index 00000000..f882ea56 --- /dev/null +++ b/template.c @@ -0,0 +1,35 @@ +/* This is the template processing code of rsyslog. + * Please see syslogd.c for license information. + * This code is placed under the GPL. + * begun 2004-11-17 rgerhards + */ +#include +#include +#include "template.h" + +static struct template *tplRoot = NULL; /* the root of the templat list */ +static struct template *tplLast = NULL; /* points to the last element of the template list */ + +/* Constructs a template entry. Returns pointer to it + * or NULL (if it fails). + */ +struct template* tplConstruct(void) +{ + struct template *pTpl; + if((pTpl = malloc(sizeof(struct template))) == NULL) + return NULL; + + pTpl->pszName = NULL; + pTpl->pszTemplate = NULL; + + if(tplLast == NULL) + { /* we are the first element! */ + tplRoot = tplLast = pTpl; + } + + return(pTpl); +} + +/* + * vi:set ai: + */ -- cgit