From a9f80019dc30b54bf0593367c1cccf46e45a43c7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 29 Aug 2012 16:10:54 +0200 Subject: add capability to specify "optional" attribute for list-type templates, too --- template.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'template.c') diff --git a/template.c b/template.c index bd622285..475eae75 100644 --- a/template.c +++ b/template.c @@ -85,6 +85,7 @@ static struct cnfparamdescr cnfparamdescrProperty[] = { { "regex.match", eCmdHdlrInt, 0 }, { "regex.submatch", eCmdHdlrInt, 0 }, { "droplastlf", eCmdHdlrBinary, 0 }, + { "optional", eCmdHdlrBinary, 0 }, { "spifno1stsp", eCmdHdlrBinary, 0 } }; static struct cnfparamblk pblkProperty = @@ -1282,6 +1283,7 @@ createPropertyTpe(struct template *pTpl, struct cnfobj *o) int i; int droplastlf = 0; int spifno1stsp = 0; + int optional = 0; int frompos = -1; int topos = -1; int fieldnum = -1; @@ -1312,6 +1314,8 @@ createPropertyTpe(struct template *pTpl, struct cnfobj *o) cstrFinalize(name); } else if(!strcmp(pblkProperty.descr[i].name, "droplastlf")) { droplastlf = pvals[i].val.d.n; + } else if(!strcmp(pblkProperty.descr[i].name, "optional")) { + optional = pvals[i].val.d.n; } else if(!strcmp(pblkProperty.descr[i].name, "spifno1stsp")) { spifno1stsp = pvals[i].val.d.n; } else if(!strcmp(pblkProperty.descr[i].name, "outname")) { @@ -1473,6 +1477,7 @@ createPropertyTpe(struct template *pTpl, struct cnfobj *o) } pTpe->data.field.options.bDropLastLF = droplastlf; pTpe->data.field.options.bSPIffNo1stSP = spifno1stsp; + pTpe->data.field.options.bOptionalField = optional; pTpe->data.field.eCaseConv = caseconv; switch(formatType) { case F_NONE: -- cgit v1.2.3