diff options
Diffstat (limited to 'tools/omfile.c')
-rw-r--r-- | tools/omfile.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/omfile.c b/tools/omfile.c index ba9f7f7..3dca347 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -133,7 +133,7 @@ typedef struct s_dynaFileCacheEntry dynaFileCacheEntry; typedef struct _instanceData { - uchar *f_fname; /* file or template name (display only) */ + uchar *fname; /* file or template name (display only) */ uchar *tplName; /* name of assigned template */ strm_t *pStrm; /* our output stream */ char bDynamicName; /* 0 - static name, 1 - dynamic name (with properties) */ @@ -287,11 +287,11 @@ CODESTARTdbgPrintInstInfo if(pData->bDynamicName) { dbgprintf("[dynamic]\n"); } else { /* regular file */ - dbgprintf("%s%s\n", pData->f_fname, + dbgprintf("%s%s\n", pData->fname, (pData->pStrm == NULL) ? " (closed)" : ""); } - dbgprintf("\ttemplate='%s'\n", pData->f_fname); + dbgprintf("\ttemplate='%s'\n", pData->fname); dbgprintf("\tuse async writer=%d\n", pData->bUseAsyncWriter); dbgprintf("\tflush on TX end=%d\n", pData->bFlushOnTXEnd); dbgprintf("\tflush interval=%d\n", pData->iFlushInterval); @@ -411,7 +411,7 @@ static rsRetVal cflineParseOutchannel(instanceData *pData, uchar* p, omodStringR } /* OK, we finally got a correct template. So let's use it... */ - pData->f_fname = ustrdup(pOch->pszFileTemplate); + pData->fname = ustrdup(pOch->pszFileTemplate); pData->iSizeLimit = pOch->uSizeLimit; /* WARNING: It is dangerous "just" to pass the pointer. As we * never rebuild the output channel description, this is acceptable here. @@ -796,9 +796,9 @@ writeFile(uchar **ppString, unsigned iMsgOpts, instanceData *pData) CHKiRet(prepareDynFile(pData, ppString[1], iMsgOpts)); } else { /* "regular", non-dynafile */ if(pData->pStrm == NULL) { - CHKiRet(prepareFile(pData, pData->f_fname)); + CHKiRet(prepareFile(pData, pData->fname)); if(pData->pStrm == NULL) { - errmsg.LogError(0, RS_RET_NO_FILE_ACCESS, "Could no open output file '%s'", pData->f_fname); + errmsg.LogError(0, RS_RET_NO_FILE_ACCESS, "Could no open output file '%s'", pData->fname); } } } @@ -885,7 +885,7 @@ ENDcreateInstance BEGINfreeInstance CODESTARTfreeInstance free(pData->tplName); - free(pData->f_fname); + free(pData->fname); if(pData->bDynamicName) { dynaFileFreeCache(pData); } else if(pData->pStrm != NULL) @@ -935,7 +935,7 @@ ENDendTransaction BEGINdoAction CODESTARTdoAction DBGPRINTF("file to log to: %s\n", - (pData->bDynamicName) ? ppString[1] : pData->f_fname); + (pData->bDynamicName) ? ppString[1] : pData->fname); DBGPRINTF("omfile: start of data: '%.128s'\n", ppString[0]); STATSCOUNTER_INC(pData->ctrRequests, pData->mutCtrRequests); CHKiRet(writeFile(ppString, iMsgOpts, pData)); @@ -951,7 +951,7 @@ ENDdoAction static inline void setInstParamDefaults(instanceData *pData) { - pData->f_fname = NULL; + pData->fname = NULL; pData->tplName = NULL; pData->fileUID = -1; pData->fileGID = -1; @@ -987,7 +987,7 @@ setupInstStatsCtrs(instanceData *pData) } /* support statistics gathering */ - snprintf((char*)ctrName, sizeof(ctrName), "dynafile cache %s", pData->f_fname); + snprintf((char*)ctrName, sizeof(ctrName), "dynafile cache %s", pData->fname); ctrName[sizeof(ctrName)-1] = '\0'; /* be on the save side */ CHKiRet(statsobj.Construct(&(pData->stats))); CHKiRet(statsobj.SetName(pData->stats, ctrName)); @@ -1156,11 +1156,11 @@ CODESTARTnewActInst } else if(!strcmp(actpblk.descr[i].name, "createdirs")) { pData->bCreateDirs = (int) pvals[i].val.d.n; } else if(!strcmp(actpblk.descr[i].name, "file")) { - pData->f_fname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); + pData->fname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); CODE_STD_STRING_REQUESTnewActInst(1) pData->bDynamicName = 0; } else if(!strcmp(actpblk.descr[i].name, "dynafile")) { - pData->f_fname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); + pData->fname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); CODE_STD_STRING_REQUESTnewActInst(2) pData->bDynamicName = 1; } else if(!strcmp(actpblk.descr[i].name, "template")) { @@ -1175,7 +1175,7 @@ CODESTARTnewActInst } } - if(pData->f_fname == NULL) { + if(pData->fname == NULL) { errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "omfile: either the \"file\" or " "\"dynfile\" parameter must be given"); ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); @@ -1196,7 +1196,7 @@ CODESTARTnewActInst /* "filename" is actually a template name, we need this as string 1. So let's add it * to the pOMSR. -- rgerhards, 2007-07-27 */ - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->f_fname), OMSR_NO_RQD_TPL_OPTS)); + CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->fname), OMSR_NO_RQD_TPL_OPTS)); // TODO: create unified code for this (legacy+v6 system) /* we now allocate the cache table */ CHKmalloc(pData->dynCache = (dynaFileCacheEntry**) @@ -1255,13 +1255,13 @@ CODESTARTparseSelectorAct CODE_STD_STRING_REQUESTparseSelectorAct(2) ++p; /* eat '?' */ CHKiRet(cflineParseFileName(p, fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, getDfltTpl())); - pData->f_fname = ustrdup(fname); + pData->fname = ustrdup(fname); pData->bDynamicName = 1; pData->iCurrElt = -1; /* no current element */ /* "filename" is actually a template name, we need this as string 1. So let's add it * to the pOMSR. -- rgerhards, 2007-07-27 */ - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->f_fname), OMSR_NO_RQD_TPL_OPTS)); + CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->fname), OMSR_NO_RQD_TPL_OPTS)); /* we now allocate the cache table */ CHKmalloc(pData->dynCache = (dynaFileCacheEntry**) calloc(cs.iDynaFileCacheSize, sizeof(dynaFileCacheEntry*))); @@ -1271,7 +1271,7 @@ CODESTARTparseSelectorAct case '.': CODE_STD_STRING_REQUESTparseSelectorAct(1) CHKiRet(cflineParseFileName(p, fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, getDfltTpl())); - pData->f_fname = ustrdup(fname); + pData->fname = ustrdup(fname); pData->bDynamicName = 0; break; default: |