diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2022-10-24 01:45:47 +0200 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2022-10-24 16:00:45 +0200 |
commit | 023b95dba00117cd1fed2d8a97ce80331376a1f9 (patch) | |
tree | 32ded75e6550ee475389d88e6186b6c35ebd0a58 | |
parent | 93a757ab7dfde74327da6316fbaddde13f56ae77 (diff) | |
download | libexpat-git-023b95dba00117cd1fed2d8a97ce80331376a1f9.tar.gz |
examples/outline.c: Make element handler signatures consistent across examples
-rw-r--r-- | expat/examples/outline.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/expat/examples/outline.c b/expat/examples/outline.c index 048c83c0..6d51a35d 100644 --- a/expat/examples/outline.c +++ b/expat/examples/outline.c @@ -52,17 +52,17 @@ #endif static void XMLCALL -start(void *data, const XML_Char *el, const XML_Char **attr) { +startElement(void *userData, const XML_Char *name, const XML_Char **atts) { int i; - int *const depthPtr = (int *)data; + int *const depthPtr = (int *)userData; for (i = 0; i < *depthPtr; i++) printf(" "); - printf("%" XML_FMT_STR, el); + printf("%" XML_FMT_STR, name); - for (i = 0; attr[i]; i += 2) { - printf(" %" XML_FMT_STR "='%" XML_FMT_STR "'", attr[i], attr[i + 1]); + for (i = 0; atts[i]; i += 2) { + printf(" %" XML_FMT_STR "='%" XML_FMT_STR "'", atts[i], atts[i + 1]); } printf("\n"); @@ -70,9 +70,9 @@ start(void *data, const XML_Char *el, const XML_Char **attr) { } static void XMLCALL -end(void *data, const XML_Char *el) { - int *const depthPtr = (int *)data; - (void)el; +endElement(void *userData, const XML_Char *name) { + int *const depthPtr = (int *)userData; + (void)name; *depthPtr -= 1; } @@ -89,7 +89,7 @@ main(void) { } XML_SetUserData(parser, &depth); - XML_SetElementHandler(parser, start, end); + XML_SetElementHandler(parser, startElement, endElement); for (;;) { int done; |