moved detect_endtag to clixon_proto

This commit is contained in:
Olof hagsand 2017-04-07 12:34:07 +02:00
parent 7880b5d498
commit 05edace630
5 changed files with 67 additions and 43 deletions

View file

@ -147,30 +147,6 @@ add_error_postamble(cbuf *xf)
return 0;
}
/*! Look for a text pattern in an input string, one char at a time
* @param[in] tag What to look for
* @param[in] ch New input character
* @param[in,out] state A state integer holding how far we have parsed.
* @retval 0 No, we havent detected end tag
* @retval 1 Yes, we have detected end tag!
* XXX: move to clicon_xml?
*/
int
detect_endtag(char *tag, char ch, int *state)
{
int retval = 0;
if (tag[*state] == ch){
(*state)++;
if (*state == strlen(tag)){
*state = 0;
retval = 1;
}
}
else
*state = 0;
return retval;
}
/*! Get "target" attribute, return actual database given candidate or running
* Caller must do error handling