diff options
-rw-r--r-- | README.xml | 2 | ||||
-rw-r--r-- | xml.c | 25 |
2 files changed, 13 insertions, 14 deletions
@@ -12,7 +12,7 @@ Features -------- - Relatively small parser. -- Pretty simple API comparable with libexpat. +- Pretty simple API. - Pretty fast. - Portable - No dynamic memory allocation. @@ -3,7 +3,6 @@ #include <ctype.h> #include <errno.h> #include <limits.h> -#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -215,7 +214,7 @@ xml_parsecdata(XMLParser *x) } static int -codepointtoutf8(const uint32_t r, uint8_t *s) +codepointtoutf8(long r, char *s) { if (r == 0) { return 0; /* NUL byte */ @@ -251,16 +250,16 @@ namedentitytostr(const char *e, char *buf, size_t bufsiz) char *entity; int c; } entities[] = { - { .entity = "&", .c = '&' }, - { .entity = "<", .c = '<' }, - { .entity = ">", .c = '>' }, - { .entity = "'", .c = '\'' }, - { .entity = """, .c = '"' }, - { .entity = "&", .c = '&' }, - { .entity = "<", .c = '<' }, - { .entity = ">", .c = '>' }, - { .entity = "&APOS;", .c = '\'' }, - { .entity = """, .c = '"' } + { "&", '&' }, + { "<", '<' }, + { ">", '>' }, + { "'", '\'' }, + { """, '"' }, + { "&", '&' }, + { "<", '<' }, + { ">", '>' }, + { "&APOS;", '\'' }, + { """, '"' } }; size_t i; @@ -285,7 +284,7 @@ namedentitytostr(const char *e, char *buf, size_t bufsiz) static int numericentitytostr(const char *e, char *buf, size_t bufsiz) { - uint32_t l; + long l; int len; char *end; |