git » fp-git.git » commit 44ab0c2

moved function parse from resources to search

author ecalot
2005-12-19 19:03:28 UTC
committer ecalot
2005-12-19 19:03:28 UTC
parent 92b29b565736cd626348f18c6c68e87143f397e3

moved function parse from resources to search

PR/src/console/main.c +2 -1
PR/src/include/common.h +3 -3
PR/src/include/search.h +3 -0
PR/src/include/tree.h +0 -5
PR/src/include/unknown.h +0 -5
PR/src/lib/pr.c +2 -0
PR/src/lib/xml/search.c +23 -0
PR/src/lib/xml/tree.c +0 -23
PR/src/lib/xml/unknown.c +0 -23

diff --git a/PR/src/console/main.c b/PR/src/console/main.c
index 280eb3e..faa649a 100644
--- a/PR/src/console/main.c
+++ b/PR/src/console/main.c
@@ -116,11 +116,12 @@ int main (int argc, char **argv) {
 				case 'z':
 					if (optarg) setCompressionLevel(atoi(optarg));
 					break;
-				case 'r':
 #ifndef PR_IGNORE_RAW_OPTION
+				case 'w':
 					setFlag(raw_flag);
 					break;
 #endif
+				case 'r':
 				case 'R':
 					setFlag(recursive_flag);
 					break;
diff --git a/PR/src/include/common.h b/PR/src/include/common.h
index bbb4439..423582a 100644
--- a/PR/src/include/common.h
+++ b/PR/src/include/common.h
@@ -124,8 +124,8 @@ common.h: Princed Resources : Defines and prototypes common to all PR code
 #define PR_IGNORE_RAW_OPTION
 
 #ifndef PR_IGNORE_RAW_OPTION
-#define PARSING_OPTRAW ,{"raw",         no_argument,       0,'r'},
-#define PARSING_CHRRAW "r"
+#define PARSING_OPTRAW ,{"raw",         no_argument,       0,'w'},
+#define PARSING_CHRRAW "w"
 #define PARSING_SHOWRAW(a) a
 #else
 #define PARSING_OPTRAW ,
@@ -154,7 +154,7 @@ PARSING_OPTRAW\
 {0, 0, 0, 0}\
 }
 
-#define PARSING_CHARS    "z::i::m::cx::e::b::a::fgs::t::Rvh?"PARSING_CHRRAW
+#define PARSING_CHARS    "z::i::m::cx::e::b::a::fgs::t::Rrvh?"PARSING_CHRRAW
 
 /* Flags */
 #define import_flag      0x0001
diff --git a/PR/src/include/search.h b/PR/src/include/search.h
index 521b92b..18e3863 100644
--- a/PR/src/include/search.h
+++ b/PR/src/include/search.h
@@ -42,6 +42,9 @@ search.h: Princed Resources : xml handling functions header file
 #include "common.h" /* tTag */
 #include "reslist.h"
 
+/* parse xml file */
+int parseFile(const char* vFile, const char* datFile, tResourceList *r);
+
 /****************************************************************\
 |                   Tag Tree Searching Functions                 |
 \****************************************************************/
diff --git a/PR/src/include/tree.h b/PR/src/include/tree.h
index 95059c8..c236427 100644
--- a/PR/src/include/tree.h
+++ b/PR/src/include/tree.h
@@ -54,11 +54,6 @@ resources.h: Princed Resources : Resource Handler headers
 void getFileName(char* vFileext,const char* vDirExt,const tResource* r,const char* vFiledat, const char* vDatFileName,int optionflag,const char* backupExtension,const char* format);
 void getUpperFolder(char* aux, char* vFiledat);
 
-const char* getExtDesc(int type);
-
-/* parse xml file */
-int parseFile(const char* vFile, const char* datFile, tResourceList *r);
-
 /* In case there are unknown resources it closes the unknown XML output */
 void endUnknownXml();
 
diff --git a/PR/src/include/unknown.h b/PR/src/include/unknown.h
index 95059c8..c236427 100644
--- a/PR/src/include/unknown.h
+++ b/PR/src/include/unknown.h
@@ -54,11 +54,6 @@ resources.h: Princed Resources : Resource Handler headers
 void getFileName(char* vFileext,const char* vDirExt,const tResource* r,const char* vFiledat, const char* vDatFileName,int optionflag,const char* backupExtension,const char* format);
 void getUpperFolder(char* aux, char* vFiledat);
 
-const char* getExtDesc(int type);
-
-/* parse xml file */
-int parseFile(const char* vFile, const char* datFile, tResourceList *r);
-
 /* In case there are unknown resources it closes the unknown XML output */
 void endUnknownXml();
 
diff --git a/PR/src/lib/pr.c b/PR/src/lib/pr.c
index 0b50a87..c4d3dbc 100644
--- a/PR/src/lib/pr.c
+++ b/PR/src/lib/pr.c
@@ -63,6 +63,8 @@ pr.c: Main source file for Princed Resources library
 #include "memory.h"    /* getMemory, free */
 #include "resources.h"
 
+#include "search.h" /* parse */
+
 /***************************************************************\
 |                      Main working functions                   |
 \***************************************************************/
diff --git a/PR/src/lib/xml/search.c b/PR/src/lib/xml/search.c
index efaa773..54bf421 100644
--- a/PR/src/lib/xml/search.c
+++ b/PR/src/lib/xml/search.c
@@ -44,6 +44,29 @@ search.c: Princed Resources : specific xml handling functions
 #include <string.h>
 #include "translate.h" /* to translate indexes */
 
+/***************************************************************\
+|            Filtering xml structure to tResourceList           |
+\***************************************************************/
+
+/* parse file */
+int parseFile(const char* vFile, const char* datFile, tResourceList *r) {
+	/* Declare error variable */
+	int error;
+	tPassWork pass;
+	tTag* structure;
+
+	/* Generate xml structure if doesn't exist */
+	if ((error=parseStructure(vFile,&structure))) return error;
+
+	/* Use the xml structure to Generate the resource structure of the file */
+	pass.datFile=datFile;
+	pass.r=r;
+	workTree(structure,&pass,workTag);
+
+	/* All done */
+	return PR_RESULT_SUCCESS;
+}
+
 int getOrder(const char* order) {
 	if (order) {
 		if (equalsIgnoreCase(order,"first")) {
diff --git a/PR/src/lib/xml/tree.c b/PR/src/lib/xml/tree.c
index 3099bd5..ac94651 100644
--- a/PR/src/lib/xml/tree.c
+++ b/PR/src/lib/xml/tree.c
@@ -44,29 +44,6 @@ resources.c: Princed Resources : Resource Handler
 #include "stringformat.h"
 #include "translate.h"
 
-/***************************************************************\
-|            Filtering xml structure to tResourceList           |
-\***************************************************************/
-
-/* parse file */
-int parseFile(const char* vFile, const char* datFile, tResourceList *r) {
-	/* Declare error variable */
-	int error;
-	tPassWork pass;
-	tTag* structure;
-
-	/* Generate xml structure if doesn't exist */
-	if ((error=parseStructure(vFile,&structure))) return error;
-
-	/* Use the xml structure to Generate the resource structure of the file */
-	pass.datFile=datFile;
-	pass.r=r;
-	workTree(structure,&pass,workTag);
-
-	/* All done */
-	return PR_RESULT_SUCCESS;
-}
-
 /***************************************************************\
 |                     Unknown.xml primitives                    |
 \***************************************************************/
diff --git a/PR/src/lib/xml/unknown.c b/PR/src/lib/xml/unknown.c
index 3099bd5..ac94651 100644
--- a/PR/src/lib/xml/unknown.c
+++ b/PR/src/lib/xml/unknown.c
@@ -44,29 +44,6 @@ resources.c: Princed Resources : Resource Handler
 #include "stringformat.h"
 #include "translate.h"
 
-/***************************************************************\
-|            Filtering xml structure to tResourceList           |
-\***************************************************************/
-
-/* parse file */
-int parseFile(const char* vFile, const char* datFile, tResourceList *r) {
-	/* Declare error variable */
-	int error;
-	tPassWork pass;
-	tTag* structure;
-
-	/* Generate xml structure if doesn't exist */
-	if ((error=parseStructure(vFile,&structure))) return error;
-
-	/* Use the xml structure to Generate the resource structure of the file */
-	pass.datFile=datFile;
-	pass.r=r;
-	workTree(structure,&pass,workTag);
-
-	/* All done */
-	return PR_RESULT_SUCCESS;
-}
-
 /***************************************************************\
 |                     Unknown.xml primitives                    |
 \***************************************************************/