--- ray/src/common/ezxml.c 2015/02/14 00:34:43 2.7 +++ ray/src/common/ezxml.c 2016/03/06 01:13:17 2.9 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ezxml.c,v 2.7 2015/02/14 00:34:43 greg Exp $"; +static const char RCSid[] = "$Id: ezxml.c,v 2.9 2016/03/06 01:13:17 schorsch Exp $"; #endif /* ezxml.c * @@ -25,6 +25,10 @@ static const char RCSid[] = "$Id: ezxml.c,v 2.7 2015/0 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#if defined(_WIN32) || defined(_WIN64) +#define EZXML_NOMMAP +#endif + #include #include #include @@ -38,12 +42,7 @@ static const char RCSid[] = "$Id: ezxml.c,v 2.7 2015/0 #include #include "ezxml.h" -#ifdef _WIN32 -#include -#define read _read -#define open _open -#define close _close -#endif +#include "platform.h" #define EZXML_WS "\t\r\n " /* whitespace */ #define EZXML_ERRL 128 /* maximum error string length */ @@ -72,6 +71,14 @@ ezxml_t ezxml_child(ezxml_t xml, const char *name) xml = (xml) ? xml->child : NULL; while (xml && strcmp(name, xml->name)) xml = xml->sibling; return xml; +} + +/* returns the given tag's character content or empty string if none */ +char *ezxml_txt(ezxml_t xml) +{ + if (xml == NULL) + return ""; + return xml->txt; } /* returns the Nth tag with the same name in the same subsection or NULL if not */