git » fp-git.git » commit cd1271a

o Added xml parsing module

author ecalot
2003-11-04 01:12:30 UTC
committer ecalot
2003-11-04 01:12:30 UTC
parent 0449dea13e23b48cfcf05fcec5964ade2a595459

o Added xml parsing module

PR/src/include/filedir.h +56 -0
PR/src/include/search.h +56 -0
PR/src/include/xml.h +30 -0

diff --git a/PR/src/include/filedir.h b/PR/src/include/filedir.h
new file mode 100644
index 0000000..c83e51f
--- /dev/null
+++ b/PR/src/include/filedir.h
@@ -0,0 +1,56 @@
+/*  Princed V3 - Prince of Persia Level Editor for PC Version
+    Copyright (C) 2003 Princed Development Team
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    The authors of this program may be contacted at http://forum.princed.com.ar
+*/
+
+/*
+xml.h: Princed Resources : xml handling functions header file
+\xaf\xaf\xaf\xaf\xaf
+ Copyright 2003 Princed Development Team
+  Created: 23 Oct 2003
+
+  Author: Enrique Calot <ecalot.cod@princed.com.ar>
+  Version: 1.01 (2003-Oct-25)
+
+ Note:
+  DO NOT remove this copyright notice
+*/
+
+/***************************************************************\
+|                  I M P L E M E N T A T I O N                  |
+\***************************************************************/
+
+#ifndef _XMLSEARCH_H_
+#define _XMLSEARCH_H_
+
+
+//Includes
+#include "xml.h"
+#include "resources.h"
+
+/****************************************************************\
+|                   Tag Tree Searching Functions                 |
+\****************************************************************/
+
+
+tTag* searchTree(tTag* t,const char* datFile, const char* id);
+void workTag(const tTag* t, tResource* r[]);
+void workTree(const tTag* t,const char* datFile, tResource* r[]);
+
+#endif
+
diff --git a/PR/src/include/search.h b/PR/src/include/search.h
new file mode 100644
index 0000000..c83e51f
--- /dev/null
+++ b/PR/src/include/search.h
@@ -0,0 +1,56 @@
+/*  Princed V3 - Prince of Persia Level Editor for PC Version
+    Copyright (C) 2003 Princed Development Team
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    The authors of this program may be contacted at http://forum.princed.com.ar
+*/
+
+/*
+xml.h: Princed Resources : xml handling functions header file
+\xaf\xaf\xaf\xaf\xaf
+ Copyright 2003 Princed Development Team
+  Created: 23 Oct 2003
+
+  Author: Enrique Calot <ecalot.cod@princed.com.ar>
+  Version: 1.01 (2003-Oct-25)
+
+ Note:
+  DO NOT remove this copyright notice
+*/
+
+/***************************************************************\
+|                  I M P L E M E N T A T I O N                  |
+\***************************************************************/
+
+#ifndef _XMLSEARCH_H_
+#define _XMLSEARCH_H_
+
+
+//Includes
+#include "xml.h"
+#include "resources.h"
+
+/****************************************************************\
+|                   Tag Tree Searching Functions                 |
+\****************************************************************/
+
+
+tTag* searchTree(tTag* t,const char* datFile, const char* id);
+void workTag(const tTag* t, tResource* r[]);
+void workTree(const tTag* t,const char* datFile, tResource* r[]);
+
+#endif
+
diff --git a/PR/src/include/xml.h b/PR/src/include/xml.h
new file mode 100644
index 0000000..3d7b25a
--- /dev/null
+++ b/PR/src/include/xml.h
@@ -0,0 +1,30 @@
+
+#ifndef _XML_H_
+#define _XML_H_
+
+int equalsIgnoreCase(const char s1[],const char s2[]);
+
+typedef struct tTag {
+ struct tTag* child;
+ struct tTag* next;
+ char* tag;
+ char* desc;
+ char* external;
+ char* file;
+ char* itemtype;
+ char* name;
+ char* palette;
+ char* type;
+ char* value;
+ char* version;
+}tTag;
+
+//Constants
+#define MAX_VALUE_SIZE 1000
+#define MAX_SIZE_OF_FILE 30000
+
+//tTag* getTagStructure(); //initializes
+void freeTagStructure(tTag* structure);
+//int parseNext(char** pString, tTag* tag);
+tTag* parseXmlFile(char* vFile,int* error);
+#endif