summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b1c317)
raw | patch | inline | side by side (parent: 8b1c317)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 4 Jul 2006 21:04:12 +0000 (21:04 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 4 Jul 2006 21:04:12 +0000 (21:04 +0000) |
program/src/rrd_restore.c | patch | blob | history |
index 29a97b3bf67260a946bd9ac9e950b11ebf9cd458..6097fa4c248e5c038ab591c5bb9b50b6d46946f5 100644 (file)
void xml_lc(char*);
int skip(char **);
+int skipxml(char **);
int eat_tag(char **, char *);
int read_tag(char **, char *, char *, void *);
int xml2rrd(char*, rrd_t*, char);
}
}
+int skipxml(char **buf){
+ char *ptr;
+ ptr=(*buf);
+ do {
+ (*buf)=ptr;
+ while((*(ptr+1)) && ((*ptr)==' ' || (*ptr)=='\r' || (*ptr)=='\n' || (*ptr)=='\t')) ptr++;
+ if (strncmp(ptr,"<?xml",4) == 0) {
+ ptr= strstr(ptr,"?>");
+ if (ptr) ptr+=2; else {
+ rrd_set_error("Dangling XML header");
+ (*buf) = NULL;
+ return -1;
+ }
+ }
+ } while ((*buf)!=ptr);
+ return 1;
+}
+
int skip(char **buf){
char *ptr;
ptr=(*buf);
ptr2=buf;
ptr3=buf;
/* start with an RRD tag */
+
+ skipxml(&ptr);
eat_tag(&ptr,"rrd");
/* allocate static header */