diff options
Diffstat (limited to 'template.h')
| -rw-r--r-- | template.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,7 +1,7 @@ /* This is the header for template processing code of rsyslog. * begun 2004-11-17 rgerhards * - * Copyright (C) 2004-2012 by Rainer Gerhards and Adiscon GmbH + * Copyright (C) 2004-2013 by Rainer Gerhards and Adiscon GmbH * * This file is part of rsyslog. * @@ -39,7 +39,7 @@ struct template { struct template *pNext; char *pszName; int iLenName; - rsRetVal (*pStrgen)(msg_t*, uchar**, size_t *); + rsRetVal (*pStrgen)(const msg_t*const, actWrkrIParams_t *const iparam); sbool bHaveSubtree; msgPropDescr_t subtree; /* subtree property name for subtree-type templates */ int tpenElements; /* number of elements in templateEntry list */ @@ -118,6 +118,8 @@ struct templateEntry { unsigned bCSV: 1; /* format field in CSV (RFC 4180) format */ unsigned bJSON: 1; /* format field JSON escaped */ unsigned bJSONf: 1; /* format field JSON *field* (n/v pair) */ + unsigned bJSONr: 1; /* format field JSON non escaped */ + unsigned bJSONfr: 1; /* format field JSON *field* non escaped (n/v pair) */ unsigned bMandatory: 1; /* mandatory field - emit even if empty */ unsigned bFromPosEndRelative: 1;/* is From/To-Pos relative to end of string? */ } options; /* options as bit fields */ @@ -143,7 +145,7 @@ void tplDeleteAll(rsconf_t *conf); void tplDeleteNew(rsconf_t *conf); void tplPrintList(rsconf_t *conf); void tplLastStaticInit(rsconf_t *conf, struct template *tpl); -rsRetVal ExtendBuf(uchar **pBuf, size_t *pLenBuf, size_t iMinSize); +rsRetVal ExtendBuf(actWrkrIParams_t *const iparam, const size_t iMinSize); int tplRequiresDateCall(struct template *pTpl); /* note: if a compiler warning for undefined type tells you to look at this * code line below, the actual cause is that you currently MUST include template.h @@ -151,9 +153,13 @@ int tplRequiresDateCall(struct template *pTpl); * rgerhards, 2007-08-06 */ rsRetVal tplToArray(struct template *pTpl, msg_t *pMsg, uchar*** ppArr, struct syslogTime *ttNow); -rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar** ppSz, size_t *, struct syslogTime *ttNow); rsRetVal tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **, struct syslogTime *ttNow); rsRetVal doEscape(uchar **pp, rs_size_t *pLen, unsigned short *pbMustBeFreed, int escapeMode); +rsRetVal +tplToString(struct template *__restrict__ const pTpl, + msg_t *__restrict__ const pMsg, + actWrkrIParams_t *__restrict const iparam, + struct syslogTime *const ttNow); rsRetVal templateInit(); rsRetVal tplProcessCnf(struct cnfobj *o); |
