mirror of
https://gitea.psi.ch/ELOG/mxml.git
synced 2026-09-09 01:23:22 +00:00
- OS_VXWORKS condition on sys/time
- Change // to /*
This commit is contained in:
parent
94890c59f6
commit
ad197c34d9
10
mxml.c
10
mxml.c
@ -66,7 +66,9 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#ifndef OS_VXWORKS
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -195,7 +197,7 @@ void mxml_encode(char *src, int size, int translate)
|
|||||||
pd = buffer;
|
pd = buffer;
|
||||||
for (ps = src ; *ps && (size_t)pd - (size_t)buffer < (size_t)(size-10) ; ps++) {
|
for (ps = src ; *ps && (size_t)pd - (size_t)buffer < (size_t)(size-10) ; ps++) {
|
||||||
|
|
||||||
if (translate) { // tranlate "<", ">", "&", """, "'"
|
if (translate) { /* tranlate "<", ">", "&", """, "'" */
|
||||||
switch (*ps) {
|
switch (*ps) {
|
||||||
case '<':
|
case '<':
|
||||||
strcpy(pd, "<");
|
strcpy(pd, "<");
|
||||||
@ -221,7 +223,7 @@ void mxml_encode(char *src, int size, int translate)
|
|||||||
*pd++ = *ps;
|
*pd++ = *ps;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (*ps) { // translate only illegal XML characters "<" and "&"
|
switch (*ps) { /* translate only illegal XML characters "<" and "&" */
|
||||||
case '<':
|
case '<':
|
||||||
strcpy(pd, "<");
|
strcpy(pd, "<");
|
||||||
pd += 4;
|
pd += 4;
|
||||||
@ -1113,7 +1115,7 @@ PMXML_NODE mxml_parse_buffer(char *buf, char *error, int error_size)
|
|||||||
PMXML_NODE root, ptree, pnew;
|
PMXML_NODE root, ptree, pnew;
|
||||||
int end_element;
|
int end_element;
|
||||||
size_t len;
|
size_t len;
|
||||||
char *file_name = NULL; // dummy for 'HERE'
|
char *file_name = NULL; /* dummy for 'HERE' */
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
line_number = 1;
|
line_number = 1;
|
||||||
@ -1936,7 +1938,7 @@ int mxml_write_tree(char *file_name, PMXML_NODE tree)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for (i=0 ; i<tree->n_children ; i++)
|
for (i=0 ; i<tree->n_children ; i++)
|
||||||
if (tree->child[i].node_type == ELEMENT_NODE) // skip PI and comments
|
if (tree->child[i].node_type == ELEMENT_NODE) /* skip PI and comments */
|
||||||
if (!mxml_write_subtree(writer, &tree->child[i], TRUE))
|
if (!mxml_write_subtree(writer, &tree->child[i], TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user