]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - docs/developer/XMLPush/XMLPush.cpp
propagate from internal tree
[xonotic/netradiant.git] / docs / developer / XMLPush / XMLPush.cpp
1 // XMLPush.cpp : Defines the entry point for the console application.
2 //
3
4 #include "stdafx.h"
5
6 int main(int argc, char* argv[])
7 {
8   FILE *f;
9   xmlDocPtr doc;
10   
11   f = fopen("XMLDump.xml", "r");
12   if (f != NULL) {
13     int res, size = 1024;
14     char chars[1024];
15     xmlParserCtxtPtr ctxt;
16     
17     res = fread(chars, 1, 4, f);
18     if (res > 0) {
19       ctxt = xmlCreatePushParserCtxt(NULL, NULL,
20         chars, res, "foooo (filename)?");
21       while ((res = fread(chars, 1, size, f)) > 0) {
22         xmlParseChunk(ctxt, chars, res, 0);
23       }
24       xmlParseChunk(ctxt, chars, 0, 1);
25       doc = ctxt->myDoc;
26       xmlFreeParserCtxt(ctxt);
27     }
28   }
29   return 0;
30 }