]> git.sur5r.net Git - cc65/blobdiff - src/cc65/segments.h
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / src / cc65 / segments.h
index e7590ee14a672e02e975ba1aea653294fb8c553a..cf6c72fba4b455e8b5d952e397e422d43df558e6 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                               segments.h                                 */
+/*                                segments.h                                 */
 /*                                                                           */
-/*                           Segment management                             */
+/*                            Segment management                             */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2002 Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2000-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -48,7 +48,7 @@
 
 
 /*****************************************************************************/
-/*                                Forwards                                  */
+/*                                 Forwards                                  */
 /*****************************************************************************/
 
 
@@ -63,7 +63,7 @@ struct SymEntry;
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
@@ -80,12 +80,12 @@ typedef enum segment_t {
 /* A list of all segments used when generating code */
 typedef struct Segments Segments;
 struct Segments {
-    struct TextSeg*    Text;           /* Text segment */
-    struct CodeSeg*    Code;           /* Code segment */
-    struct DataSeg*    Data;           /* Data segment */
-    struct DataSeg*    ROData;         /* Readonly data segment */
-    struct DataSeg*    BSS;            /* Segment for uninitialized data */
-    segment_t                  CurDSeg;        /* Current data segment */
+    struct TextSeg*     Text;           /* Text segment */
+    struct CodeSeg*     Code;           /* Code segment */
+    struct DataSeg*     Data;           /* Data segment */
+    struct DataSeg*     ROData;         /* Readonly data segment */
+    struct DataSeg*     BSS;            /* Segment for uninitialized data */
+    segment_t           CurDSeg;        /* Current data segment */
 };
 
 /* Pointer to the current segment list. Output goes here. */
@@ -97,7 +97,7 @@ extern Segments* GS;
 
 
 /*****************************************************************************/
-/*                                  Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -105,15 +105,27 @@ extern Segments* GS;
 void InitSegNames (void);
 /* Initialize the segment names */
 
-void NewSegName (segment_t Seg, const char* Name);
+void SetSegName (segment_t Seg, const char* Name);
 /* Set a new name for a segment */
 
+void PushSegName (segment_t Seg, const char* Name);
+/* Push the current segment name and set a new name for a segment */
+
+void PopSegName (segment_t Seg);
+/* Restore a segment name from the segment name stack */
+
+const char* GetSegName (segment_t Seg);
+/* Get the name of the given segment */
+
 Segments* PushSegments (struct SymEntry* Func);
 /* Make the new segment list current but remember the old one */
 
 void PopSegments (void);
 /* Pop the old segment list (make it current) */
 
+void CreateGlobalSegments (void);
+/* Create the global segments and remember them in GS */
+
 void UseDataSeg (segment_t DSeg);
 /* For the current segment list, use the data segment DSeg */
 
@@ -132,8 +144,14 @@ void AddCode (opc_t OPC, am_t AM, const char* Arg, struct CodeLabel* JumpTo);
 void AddDataLine (const char* Format, ...) attribute ((format (printf, 1, 2)));
 /* Add a line of data to the current data segment */
 
-void OutputSegments (const Segments* S, FILE* F);
-/* Output the given segments to the file */
+int HaveGlobalCode (void);
+/* Return true if the global code segment contains entries (which is an error) */
+
+void RemoveGlobalCode (void);
+/* Remove all code from the global code segment. Used for error recovery. */
+
+void OutputSegments (const Segments* S);
+/* Output the given segments to the output file */