rem: if (*s==0 || *s==';') {  if (foo.len!=BODY_SPEC_LEN || strncasecmp(foo.s,BODY_SPEC_S,BODY_SPEC_LEN)!=0 ) { LOG(L_ERR,"ERROR:tm:parse_tw_append: short spec '%.*s' unknown" "(aceepted only %s)\n",foo.len, foo.s, BODY_SPEC_S);
add: if (*s=='=' ) {  s++;   elem = (struct append_elem*)pkg_malloc(sizeof(struct append_elem)); if (elem==0) { LOG(L_ERR,"ERROR:tm:parse_tw_append: no more pkg memory\n"); goto error; } memset( elem, 0, sizeof(struct append_elem));   elem->name = foo; if (last==0) { app->elems = elem; } else { last->next = elem; } last = elem;   while (*s && isspace((int)*s)) s++; } else {  s = foo.s; elem = 0; }   if ( (foo.s=xl_parse_spec( s, &lspec, xl_flags))==0 ) goto parse_error;   if (elem==0) { if (lspec.type!=XL_MSG_BODY) { LOG(L_ERR,"ERROR:tm:parse_tw_append: short spec '%.*s' unknown" "(aceepted only body)\n",foo.s-s, s);
context: int parse_tw_append( modparam_t type, void* val){	struct append_elem *last;	struct append_elem *elem;	struct tw_append *app;	char *s;	str  foo;	int  xl_flags;		if (val==0 || ((char*)val)[0]==0)		return 0;	s = (char*)val;	xl_flags = XL_THROW_ERROR | XL_DISABLE_COLORS;	/* start parsing - first the name */	while( *s && isspace((int)*s) )  s++;	if ( !*s || *s==':')		goto parse_error;	foo.s = s;	while ( *s && *s!=':' && !isspace((int)*s) ) s++;	if ( !*s || foo.s==s )		goto parse_error;	foo.len = s - foo.s;	/* parse separator */	while( *s && isspace((int)*s) )  s++;	if ( !*s || *s!=':')		goto parse_error;	s++;	/* check for name duplication */	for(app=tw_appends;app;app=app->next)		if (app->name.len==foo.len && !strncasecmp(app->name.s,foo.s,foo.len)){			LOG(L_ERR,"ERROR:tm:parse_tw_append: duplicated tw_append name "				"<%.*s>\n",foo.len,foo.s);			goto error;		}	/* new tw_append structure */	app = (struct tw_append*)pkg_malloc( sizeof(struct tw_append) );	if (app==0) {		LOG(L_ERR,"ERROR:tm:parse_tw_append: no more pkg memory\n");		goto error;	}	/* init the new append */	app->name = foo;	last = app->elems = 0;	/* link the new append */	app->next = tw_appends;	tw_appends = app;	/* parse the elements */	while (*s) {		/* skip white spaces */		while( *s && isspace((int)*s) )  s++;		if ( !*s )			goto parse_error;		/* parse element name */		foo.s = s;		while( *s && *s!='=' && *s!=';' && !isspace((int)*s) ) s++;		if (foo.s==s)			goto parse_error;		foo.len = s - foo.s;		/* skip spaces */		while( *s && isspace((int)*s) )  s++;		if ( *s && *s!='=' && *s!=';' )			goto parse_error;		/* body or element? */		if (*s==0 || *s==';')		{			/* only body allowed in this format */			if (foo.len!=BODY_SPEC_LEN ||			strncasecmp(foo.s,BODY_SPEC_S,BODY_SPEC_LEN)!=0 )			{				LOG(L_ERR,"ERROR:tm:parse_tw_append: short spec '%.*s' unknown"					"(aceepted only %s)\n",foo.len, foo.s, BODY_SPEC_S);				goto error;			}			app->add_body = 1;			if (*s && *(s++)!=';')				goto parse_error;			continue;		}		/* skip '=' */		s++;		/* new append_elem structure */		elem = (struct append_elem*)pkg_malloc( sizeof(struct append_elem) );		if (elem==0) {			LOG(L_ERR,"ERROR:tm:parse_tw_append: no more pkg memory\n");			goto error;		}		memset( elem, 0, sizeof(struct append_elem));		/* set and link the element */		elem->name = foo;		if (last==0) {			app->elems = elem;		} else {			last->next = elem;		}		last = elem;		/* skip spaces */		while (*s && isspace((int)*s))			s++;		/* get value type */		if ( (foo.s=xl_parse_spec( s, &elem->spec, xl_flags))==0 )			goto parse_error;		s = foo.s;		/* skip spaces */		while (*s && isspace((int)*s))  s++;		if (*s && *(s++)!=';')			goto parse_error;#if 0		if (*s){			if (*s!=';')				goto parse_error;			s++;		}#endif	}	/* go throught all elements and make the names null terminated */	for( elem=app->elems ; elem ; elem=elem->next)		elem->name.s[elem->name.len] = 0;	/* make the append name null terminated also */	app->name.s[app->name.len] = 0;	return 0;parse_error:	LOG(L_ERR,"ERROR:tm:parse_tw_append: parse error in <%s> around "		"position %ld(%c)\n", (char*)val, (long)(s-(char*)val),*s);error:	return -1;}