source: subversion/applications/rendering/gosmore/extract.c @ 15979

Last change on this file since 15979 was 9734, checked in by nic, 11 years ago

WinCE: Translations now comes from wiki, like RichardF did with Potlatch.
WinCE: Fix cegcc compatibility
Better verbal instructions.

  • Property svn:executable set to *
File size: 676 bytes
Line 
1/* This software is placed by in the public domain by its authors. */
2/* Written by Nic Roets. */
3
4#include <stdio.h>
5#include <unistd.h>
6#include <libxml/xmlreader.h>
7
8int main (void)
9{
10  xmlTextReaderPtr xml = xmlReaderForFd (STDIN_FILENO, "", NULL, 0);
11  while (xmlTextReaderRead (xml)) {
12    char *name = (char *) BAD_CAST xmlTextReaderName (xml);
13    if (xmlTextReaderNodeType (xml) == XML_READER_TYPE_ELEMENT &&
14         strcasecmp (name, "text") == 0) {
15      while (xmlTextReaderRead (xml) && // memory leak :
16              xmlStrcmp (xmlTextReaderName (xml), BAD_CAST "#text") != 0) {}
17      printf ("%s\n", xmlTextReaderValue (xml));
18    }
19  }
20}
Note: See TracBrowser for help on using the repository browser.