git » fp-git.git » commit 758e1e4

Moved tResource* from reslist to types.h

author ecalot
2006-06-07 18:45:43 UTC
committer ecalot
2006-06-07 18:45:43 UTC
parent 71df24415f1957e277727984bdb2710da3c8d7d2

Moved tResource* from reslist to types.h

PR/doc/changelog.txt +1 -1
PR/src/include/autodetect.h +1 -1
PR/src/include/bitmap.h +1 -1
PR/src/include/bmp.h +1 -1
PR/src/include/common.h +1 -1
PR/src/include/dat.h +1 -1
PR/src/include/idlist.h +1 -1
PR/src/include/image.h +1 -1
PR/src/include/mid.h +1 -1
PR/src/include/object.h +1 -1
PR/src/include/pallist.h +1 -1
PR/src/include/plv.h +1 -1
PR/src/include/png.h +1 -1
PR/src/include/reslist.h +1 -31
PR/src/include/resourcematch.h +1 -1
PR/src/include/sound.h +1 -1
PR/src/include/tree.h +1 -1
PR/src/include/types.h +6 -27
PR/src/include/unknown.h +1 -1
PR/src/include/wav.h +1 -1
PR/src/lib/layers/pallist.c +1 -0
PR/src/lib/object/level/level_common.c +1 -1
PR/src/lib/object/object.c +1 -1
PR/src/lib/object/other/binary.c +1 -1
PR/src/lib/object/sound/sound_common.c +1 -1
PR/src/lib/pr.c +1 -1

diff --git a/PR/doc/changelog.txt b/PR/doc/changelog.txt
index 115d9dd..7ec8254 100644
--- a/PR/doc/changelog.txt
+++ b/PR/doc/changelog.txt
@@ -193,7 +193,7 @@ Versions:
   x Fix ./pr -ie it -f bug
   x Fix repeated resource name in CPALACE.DAT bug
   x Fork compress to code images as a new object in a separated file
-  x Move tResource* from reslist to types.h
+  - Moved tResource* from reslist to types.h
   - Rename "uncompress" to "decomporess"
   x Transform flags from the hex form to the [a-y]* form (a is 1, b is 2, c is 4...)
  * PR v1.4 (future plans)
diff --git a/PR/src/include/autodetect.h b/PR/src/include/autodetect.h
index f4957d7..c74ed9d 100644
--- a/PR/src/include/autodetect.h
+++ b/PR/src/include/autodetect.h
@@ -35,7 +35,7 @@ autodetect.h: Princed Resources : Resource automatic detection headers
 #define _PR_AUTODETECT_H_
 
 /* Includes */
-#include "reslist.h" /* tResourceType */
+#include "common.h" /* tResourceType */
 #include "binary.h"
 
 /* Verify  header */
diff --git a/PR/src/include/bitmap.h b/PR/src/include/bitmap.h
index 8c48e8b..ff27040 100644
--- a/PR/src/include/bitmap.h
+++ b/PR/src/include/bitmap.h
@@ -35,7 +35,7 @@ bmp.h: Princed Resources : BMP file support headers
 #ifndef _PR_BMP_H_
 #define _PR_BMP_H_
 
-#include "reslist.h" /* tResource */
+#include "types.h" /* tResource */
 #include "image.h" /* tImage */
 
 #define FORMATS_BMP_PALETTE_BW "\x00\x00\x00\0\xFF\xFF\xFF"
diff --git a/PR/src/include/bmp.h b/PR/src/include/bmp.h
index 8c48e8b..ff27040 100644
--- a/PR/src/include/bmp.h
+++ b/PR/src/include/bmp.h
@@ -35,7 +35,7 @@ bmp.h: Princed Resources : BMP file support headers
 #ifndef _PR_BMP_H_
 #define _PR_BMP_H_
 
-#include "reslist.h" /* tResource */
+#include "types.h" /* tResource */
 #include "image.h" /* tImage */
 
 #define FORMATS_BMP_PALETTE_BW "\x00\x00\x00\0\xFF\xFF\xFF"
diff --git a/PR/src/include/common.h b/PR/src/include/common.h
index e45e7e8..8262af7 100644
--- a/PR/src/include/common.h
+++ b/PR/src/include/common.h
@@ -231,11 +231,11 @@ PARSING_OPTRAW\
 #define PR_RESULT_FD_NO_FILES_SELECTED -22
 #define PR_RESULT_HELP_SHOWN -1
 #define PR_RESULT_INDEX_NOT_FOUND -23
+#define PR_RESULT_PAL_UNSUPPORTED -32
 #define PR_RESULT_SUCCESS 0
 #define PR_RESULT_WAV_UNSUPPORTED_BITRATE -28
 #define PR_RESULT_WAV_UNSUPPORTED_SAMPLERATE -29
 #define PR_RESULT_WAV_UNSUPPORTED_STEREO -30
 #define PR_RESULT_XML_AND_DAT_FORMAT_DO_NOT_MATCH -25
-#define PR_RESULT_PAL_UNSUPPORTED -32
 
 #endif
diff --git a/PR/src/include/dat.h b/PR/src/include/dat.h
index b83769b..b68d8e7 100644
--- a/PR/src/include/dat.h
+++ b/PR/src/include/dat.h
@@ -34,7 +34,7 @@ dat.h: Princed Resources : DAT format library headers
 #ifndef _PR_DAT_H_
 #define _PR_DAT_H_
 
-#include "reslist.h" /* tResource* */
+#include "types.h" /* tResource* */
 #include "binary.h" /* tBinary */
 
 typedef enum {
diff --git a/PR/src/include/idlist.h b/PR/src/include/idlist.h
index 7d4c4d5..59f86a7 100644
--- a/PR/src/include/idlist.h
+++ b/PR/src/include/idlist.h
@@ -35,7 +35,7 @@ idlist.h: Princed Resources : Resource id list headers
 #define _PR_IDLIST_H_
 
 /* Includes */
-#include "reslist.h" /* tResourceId */
+#include "types.h" /* tResourceId */
 
 int  parseGivenPath(char* path);
 int  itemMatchingListActive();
diff --git a/PR/src/include/image.h b/PR/src/include/image.h
index 3c337fb..6b07e56 100644
--- a/PR/src/include/image.h
+++ b/PR/src/include/image.h
@@ -34,7 +34,7 @@ image.h: Princed Resources : Image handling headers
 #ifndef _PR_IMAGE_H_
 #define _PR_IMAGE_H_
 
-#include "reslist.h"
+#include "types.h"
 #include "binary.h"
 
 typedef struct { 
diff --git a/PR/src/include/mid.h b/PR/src/include/mid.h
index d2f37f1..a9df6da 100644
--- a/PR/src/include/mid.h
+++ b/PR/src/include/mid.h
@@ -35,7 +35,7 @@ mid.h: Princed Resources : MIDI files support headers
 #define _PR_MID_H_
 
 #include "binary.h"
-#include "reslist.h"
+#include "types.h"
 
 int mFormatImportMid(tResource *res);
 int writeMid(const char* file, tBinary* snd, int optionflag, const char* backupExtension);
diff --git a/PR/src/include/object.h b/PR/src/include/object.h
index 96385e8..bc54ad7 100644
--- a/PR/src/include/object.h
+++ b/PR/src/include/object.h
@@ -33,7 +33,7 @@ object.h: Princed Resources : Main item class types and prototypes
 #ifndef _PR_OBJECT_H_
 #define _PR_OBJECT_H_
 
-#include "reslist.h"
+#include "types.h"
 #include "common.h"
 #include "image.h"
 
diff --git a/PR/src/include/pallist.h b/PR/src/include/pallist.h
index 9be91f4..bbf2b9b 100644
--- a/PR/src/include/pallist.h
+++ b/PR/src/include/pallist.h
@@ -39,7 +39,7 @@ typedef tList tPaletteList;
 
 #include "common.h"  /* tResourceType */
 #include "object.h"  /* tObject */
-#include "reslist.h" /* tResourceId */
+#include "types.h"   /* tResourceId */
 
 /* types */
 typedef struct {
diff --git a/PR/src/include/plv.h b/PR/src/include/plv.h
index 6248a4a..d5a650f 100644
--- a/PR/src/include/plv.h
+++ b/PR/src/include/plv.h
@@ -59,7 +59,7 @@ plv.h: Princed Resources : PLV prince level files support headers
  * All values are unsigned and in the Intel x86 architecture
  */
 
-#include "reslist.h"
+#include "types.h"
 #include "common.h" /* for PR_VERSION */
 
 /*int mFormatImportPlv(tResource *res);
diff --git a/PR/src/include/png.h b/PR/src/include/png.h
index 8c48e8b..ff27040 100644
--- a/PR/src/include/png.h
+++ b/PR/src/include/png.h
@@ -35,7 +35,7 @@ bmp.h: Princed Resources : BMP file support headers
 #ifndef _PR_BMP_H_
 #define _PR_BMP_H_
 
-#include "reslist.h" /* tResource */
+#include "types.h" /* tResource */
 #include "image.h" /* tImage */
 
 #define FORMATS_BMP_PALETTE_BW "\x00\x00\x00\0\xFF\xFF\xFF"
diff --git a/PR/src/include/reslist.h b/PR/src/include/reslist.h
index c181ae0..293e90a 100644
--- a/PR/src/include/reslist.h
+++ b/PR/src/include/reslist.h
@@ -37,37 +37,7 @@ reslist.h: Princed Resources : Resource list prototypes
 #include "list.h" /* tList */
 typedef tList tResourceList;
 
-#include "binary.h"
-
-#include "common.h" /* Item Types */
-
-/* types */
-typedef struct { 
-	tResourceType type;
-	void* obj;
-}tObject;
-
-typedef struct {
-	int                value;
-	char               index[5];
-	unsigned int       order;
-}tResourceId;
-
-typedef struct {
-	tResourceId        id;
-	tResourceId        paletteId;
-	tObject            palette;
-	tBinary            content;
-	unsigned long int  offset; /* Used internally in dat.c to remember the offset */
-	unsigned char      number; /* Used for level number */
-	tResourceType      type;
-	char*              desc;
-	char*              name;
-	char*              path;
-	const char*        datfile;
-	const char*        datAuthor;
-	unsigned long      flags;
-}tResource;
+#include "types.h"
 
 #ifdef DEBUG_RESPRINT
 void printr(const tResource* record); /* for debug purposes */
diff --git a/PR/src/include/resourcematch.h b/PR/src/include/resourcematch.h
index 889cb0a..b218987 100644
--- a/PR/src/include/resourcematch.h
+++ b/PR/src/include/resourcematch.h
@@ -35,7 +35,7 @@ resourcematch.h: Princed Resources : Partial list matching abstract layer header
 #ifndef _PR_RESOURCEMATCH_H_
 #define _PR_RESOURCEMATCH_H_
 
-#include "reslist.h" /* tResourceId*/
+#include "types.h" /* tResourceId*/
 
 typedef struct {
 	int flag;
diff --git a/PR/src/include/sound.h b/PR/src/include/sound.h
index b582349..0e0c2d1 100644
--- a/PR/src/include/sound.h
+++ b/PR/src/include/sound.h
@@ -34,7 +34,7 @@ sound.h: Princed Resources :
 #define _PR_SOUND_H_
 
 #include "binary.h"
-#include "reslist.h"
+#include "types.h"
 
 #include "mid.h"
 #include "wav.h"
diff --git a/PR/src/include/tree.h b/PR/src/include/tree.h
index 4814483..1718ae2 100644
--- a/PR/src/include/tree.h
+++ b/PR/src/include/tree.h
@@ -35,7 +35,7 @@ tree.h: Princed Resources : Special XML tree prototypes
 #define _PR_TREE_H_
 
 /* Includes */
-#include "reslist.h"
+#include "types.h"
 #include <stdio.h> /* FILE* */
 
 typedef struct {
diff --git a/PR/src/include/types.h b/PR/src/include/types.h
index c181ae0..1dcf0a5 100644
--- a/PR/src/include/types.h
+++ b/PR/src/include/types.h
@@ -19,8 +19,8 @@
 */
 
 /*
-reslist.h: Princed Resources : Resource list prototypes
-\xaf\xaf\xaf\xaf\xaf\xaf\xaf\xaf\xaf
+types.h: Princed Resources : Common types
+\xaf\xaf\xaf\xaf\xaf\xaf\xaf
  Copyright 2005 Princed Development Team
   Created: 05 Jun 2005
 
@@ -31,15 +31,11 @@ reslist.h: Princed Resources : Resource list prototypes
   DO NOT remove this copyright notice
 */
 
-#ifndef _PR_RESLIST_H_
-#define _PR_RESLIST_H_
+#ifndef _PR_TYPES_H_
+#define _PR_TYPES_H_
 
-#include "list.h" /* tList */
-typedef tList tResourceList;
-
-#include "binary.h"
-
-#include "common.h" /* Item Types */
+#include "binary.h" /* tBinary */
+#include "common.h" /* tResourceType */
 
 /* types */
 typedef struct { 
@@ -69,21 +65,4 @@ typedef struct {
 	unsigned long      flags;
 }tResource;
 
-#ifdef DEBUG_RESPRINT
-void printr(const tResource* record); /* for debug purposes */
-void resourceListDebugPrint(tResourceList* r);
-#endif
-
-#define resourceListStartIteration(l) list_firstCursor(l)
-#define resourceListDrop(r)	list_drop(r)
-
-int resCmp(const void* a,const void* b);
-int resourceListCompareId(tResourceId a,tResourceId b);
-const tResource* resourceListGetElement(tResourceList* r);
-tResourceList resourceListCreate(int isCopy);
-void resourceListAddInfo(tResourceList* r,tResource* res);
-void resourceListAdd(tResourceList* r,tResource* res); /* only increases order */
-void resourceListDebugPrint(tResourceList* r);
-void resourceListRebuildForIndex(tResourceList* r);
-
 #endif
diff --git a/PR/src/include/unknown.h b/PR/src/include/unknown.h
index fb3b1fe..58c6f41 100644
--- a/PR/src/include/unknown.h
+++ b/PR/src/include/unknown.h
@@ -40,7 +40,7 @@ unknown.h: Princed Resources : Unknown.xml generator headers
 
 /* Includes */
 #include "parse.h"
-#include "reslist.h"
+#include "types.h"
 #include "common.h" /* RES_FILE_TYPES_COUNT */
 #include "tree.h" /* tTreeStatus */
 
diff --git a/PR/src/include/wav.h b/PR/src/include/wav.h
index b78912d..a6566c6 100644
--- a/PR/src/include/wav.h
+++ b/PR/src/include/wav.h
@@ -35,7 +35,7 @@ wav.h: Princed Resources : WAV files support headers
 #define _PR_WAV_H_
 
 #include "binary.h"
-#include "reslist.h"
+#include "types.h"
 
 #define WAVE_HEADER {0x52, 0x49, 0x46, 0x46, 0x12, 0x16, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45, 0x66, 0x6D, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x11, 0x2B, 0x00, 0x00, 0x11, 0x2B, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x64, 0x61, 0x74, 0x61, 0xA3, 0x15, 0x00, 0x00}
 
diff --git a/PR/src/lib/layers/pallist.c b/PR/src/lib/layers/pallist.c
index 7d8d62f..f62b156 100644
--- a/PR/src/lib/layers/pallist.c
+++ b/PR/src/lib/layers/pallist.c
@@ -33,6 +33,7 @@ pallist.c: Princed Resources : Palette list layer implementation
 
 /* Defines */
 #include "pallist.h"
+#include "reslist.h" /* resourceListCompareId */
 
 /* palette list layer (that uses the abstract list layer primitives) */
 
diff --git a/PR/src/lib/object/level/level_common.c b/PR/src/lib/object/level/level_common.c
index fdd788c..6077d7d 100644
--- a/PR/src/lib/object/level/level_common.c
+++ b/PR/src/lib/object/level/level_common.c
@@ -38,7 +38,7 @@
 #include "binary.h" /* tBinary */
 #include "common.h"
 #include "dat.h" /* WriteDat */
-#include "reslist.h" /* tResources */
+#include "types.h" /* tResources */
 #include "plv.h"
 #include <stdlib.h>
 
diff --git a/PR/src/lib/object/object.c b/PR/src/lib/object/object.c
index b26f16d..a689c4e 100644
--- a/PR/src/lib/object/object.c
+++ b/PR/src/lib/object/object.c
@@ -32,7 +32,7 @@ main.c: Princed Resources : Main item class implementation
 
 #include "common.h"
 #include "object.h"
-#include "reslist.h"
+#include "types.h"
 
 #include "image.h"
 #include "other.h"
diff --git a/PR/src/lib/object/other/binary.c b/PR/src/lib/object/other/binary.c
index 20de390..9bc9859 100644
--- a/PR/src/lib/object/other/binary.c
+++ b/PR/src/lib/object/other/binary.c
@@ -38,7 +38,7 @@
 #include "binary.h" /* tBinary */
 #include "common.h"
 #include "dat.h" /* WriteDat */
-#include "reslist.h" /* tResources */
+#include "types.h" /* tResources */
 #include "disk.h" /* we are skiping the format layer here */
 #include <stdlib.h>
 
diff --git a/PR/src/lib/object/sound/sound_common.c b/PR/src/lib/object/sound/sound_common.c
index 1a44e27..c45b243 100644
--- a/PR/src/lib/object/sound/sound_common.c
+++ b/PR/src/lib/object/sound/sound_common.c
@@ -41,7 +41,7 @@ wave.c: Princed Resources :
 #include <stdlib.h>
 #include <string.h> /* memcpy */
 #include "dat.h" 
-#include "reslist.h" 
+#include "types.h" 
 
 /***************************************************************\
 |                         Binary Object                         |
diff --git a/PR/src/lib/pr.c b/PR/src/lib/pr.c
index 14322b8..a86cb0d 100644
--- a/PR/src/lib/pr.c
+++ b/PR/src/lib/pr.c
@@ -60,7 +60,7 @@ pr.c: Main source file for Princed Resources library
 #include "disk.h"      /* getFileNameFromPath */
 #include "idlist.h"
 #include "memory.h"    /* getMemory, free */
-#include "reslist.h"
+#include "types.h"
 
 #include "search.h"    /* parse */
 #include "unknown.h"