]> Shamusworld >> Repos - rln/blobdiff - rln.h
Revbump for last commit. :-P
[rln] / rln.h
diff --git a/rln.h b/rln.h
index 74d4d2f11248efd2f2a7ec314e634a11c36f1c56..c517f69627821f91f744705f4b5415b6713403f8 100644 (file)
--- a/rln.h
+++ b/rln.h
@@ -7,11 +7,6 @@
 #ifndef __RLN_H__
 #define __RLN_H__
 
-// Required Include Files
-
-// Macro Definitions
-
-// Requirements for Windows Compilation
 
 #ifdef WIN32
 //#define _OPEN_FLAGS  _O_BINARY|_O_RDWR
@@ -33,8 +28,6 @@
 #include <setjmp.h>
 #endif
 
-// Requirements for Mac OS-X or Linux Compilation
-
 #ifdef __GCCUNIX__
 //#define _OPEN_FLAGS  O_RDWR
 #define _OPEN_FLAGS  O_RDONLY
@@ -51,8 +44,8 @@
 #endif
 
 #define MAJOR   1                      // Major version number
-#define MINOR   3                      // Minor version number
-#define PATCH   2                      // Patch release number
+#define MINOR   4                      // Minor version number
+#define PATCH   3                      // Patch release number
 
 #ifdef WIN32
 #define PLATFORM     "Win32"           // Release platform - Windows
@@ -131,7 +124,9 @@ struct ARHEADER
 
 #define new_arheader()  (struct ARHEADER *)malloc(sizeof(struct ARHEADER))
 
-// Object File Structure and Related Items
+// Object file structure and related items
+
+enum { TEXT=0, DATA=1, BSS=2 };
 
 struct OFILE
 {
@@ -144,6 +139,7 @@ struct OFILE
        struct OHEADER o_header;                        // Header of this file
        uint8_t * o_image;                                      // Image of this file
        uint8_t isArchiveFile;                          // Temporary extra flag
+       uint32_t segSize[3];                            // Size of TEXT, DATA & BSS
 };
 
 #define new_ofile()  (struct OFILE *)malloc(sizeof(struct OFILE))
@@ -224,26 +220,32 @@ struct HREC
 //#define T_COMMON     (T_GLOBAL | T_EXTERN)
 
 // Symbol Table - Type Definitions
-// N.B.: T_EXT can be ORed with any of T_ABS, T_TEXT, TDATA, or T_BSS!
-
-#define T_UNDF         0x00000000     // Undefined Symbol
-#define T_EXT          0x01000000     // External Bit, OR'ed In (Global)
-#define T_ABS          0x02000000     // Absolute Symbol (Equated)
-#define T_TEXT         0x04000000     // TEXT Segment
-#define T_DATA         0x06000000     // DATA Segment
-#define T_BSS          0x08000000     // BSS Segment
+// N.B.: T_GLBL can be ORed with any of T_ABS, T_TEXT, TDATA, or T_BSS!
+//       Also, these are really a mashup of a struct, consisting of the
+//       following items: type (1 byte), other (1 byte), & descr. (2 bytes).
+//       Also, the type is not enough to distinguish between external &
+//       common symbols; for this,  you need to go to the value field to see
+//       what's there (0=external, !0=common).
+
+#define T_UNDF         0x00000000     // Undefined symbol
+#define T_GLBL         0x01000000     // Scoping bit, OR'ed in (global)
+#define T_ABS          0x02000000     // Absolute symbol (equated)
+#define T_TEXT         0x04000000     // TEXT segment
+#define T_DATA         0x06000000     // DATA segment
+#define T_BSS          0x08000000     // BSS segment
 #define T_SEG          (T_DATA | T_TEXT | T_BSS)   // segment bits
 
 // These macros are used with the TYPE field of a SYMBOL.
+// They are also mostly WRONG
 /*
 Absolutes (equates) can't be externals (line 434)
 -- they are non-relocatable
 */
 
-#define iscommon(type) (((type) & T_EXT) == 0)
-#define islocal(type)  (((type) & T_EXT) == 0)
-#define isglobal(type) ((type) & T_EXT)
-#define isextern(type) ((type) & T_EXT)
+#define iscommon(type) (((type) & T_GLBL) == 0)
+#define islocal(type)  (((type) & T_GLBL) == 0)
+#define isglobal(type) ((type) & T_GLBL)
+#define isextern(type) ((type) & T_GLBL)
 
 /*
 Shamus: