1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 16:43:33 +02:00

Update expat sources

This commit is contained in:
Paul Licameli
2017-06-27 05:34:22 -04:00
parent 138c188fb4
commit 941ad55140
43 changed files with 4134 additions and 882 deletions

View File

@@ -6,11 +6,7 @@
*/
#include <stdio.h>
#include "expat.h"
#if defined(__amigaos__) && defined(__USE_INLINE__)
#include <proto/expat.h>
#endif
#include <expat.h>
#ifdef XML_LARGE_SIZE
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
@@ -27,6 +23,8 @@ startElement(void *userData, const char *name, const char **atts)
{
int i;
int *depthPtr = (int *)userData;
(void)atts;
for (i = 0; i < *depthPtr; i++)
putchar('\t');
puts(name);
@@ -37,6 +35,8 @@ static void XMLCALL
endElement(void *userData, const char *name)
{
int *depthPtr = (int *)userData;
(void)name;
*depthPtr -= 1;
}
@@ -47,10 +47,13 @@ main(int argc, char *argv[])
XML_Parser parser = XML_ParserCreate(NULL);
int done;
int depth = 0;
(void)argc;
(void)argv;
XML_SetUserData(parser, &depth);
XML_SetElementHandler(parser, startElement, endElement);
do {
int len = (int)fread(buf, 1, sizeof(buf), stdin);
size_t len = fread(buf, 1, sizeof(buf), stdin);
done = len < sizeof(buf);
if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) {
fprintf(stderr,

View File

@@ -25,10 +25,6 @@
#include <stdio.h>
#include <expat.h>
#if defined(__amigaos__) && defined(__USE_INLINE__)
#include <proto/expat.h>
#endif
#ifdef XML_LARGE_SIZE
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
#define XML_FMT_INT_MOD "I64"
@@ -49,6 +45,7 @@ static void XMLCALL
start(void *data, const char *el, const char **attr)
{
int i;
(void)data;
for (i = 0; i < Depth; i++)
printf(" ");
@@ -66,6 +63,9 @@ start(void *data, const char *el, const char **attr)
static void XMLCALL
end(void *data, const char *el)
{
(void)data;
(void)el;
Depth--;
}
@@ -73,6 +73,9 @@ int
main(int argc, char *argv[])
{
XML_Parser p = XML_ParserCreate(NULL);
(void)argc;
(void)argv;
if (! p) {
fprintf(stderr, "Couldn't allocate memory for parser\n");
exit(-1);