diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2004-11-17 14:32:37 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2004-11-17 14:32:37 +0000 |
commit | ad0011c81447641474216f306ae1b4709c22ea6c (patch) | |
tree | 573330802dd5c0eacf8e1abc6b96f0c4dc9b5094 /template.c | |
parent | 33579ae6eccde4593c17909ef7b065ec8f32e563 (diff) | |
download | rsyslog-ad0011c81447641474216f306ae1b4709c22ea6c.tar.gz rsyslog-ad0011c81447641474216f306ae1b4709c22ea6c.tar.xz rsyslog-ad0011c81447641474216f306ae1b4709c22ea6c.zip |
begin templates
Diffstat (limited to 'template.c')
-rw-r--r-- | template.c | 35 |
1 files changed, 35 insertions, 0 deletions
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 <stdio.h> +#include <malloc.h> +#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: + */ |