X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fsegments.h;h=6d6ad2facceb1e53bbc5f4fc7a668563279ed402;hb=3f4096d3030095605f28b4cfa73563c53a563df6;hp=1c9b5fd9a448a0039dfd5b1fd68f5ea49734dfc2;hpb=fe2cd767b2f3206c3c97f20b1d238aa9e78344a0;p=cc65 diff --git a/src/cc65/segments.h b/src/cc65/segments.h index 1c9b5fd9a..6d6ad2fac 100644 --- a/src/cc65/segments.h +++ b/src/cc65/segments.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000-2001 Ullrich von Bassewitz */ +/* (C) 2000-2002 Ullrich von Bassewitz */ /* Wacholderweg 14 */ /* D-70597 Stuttgart */ /* EMail: uz@cc65.org */ @@ -91,6 +91,9 @@ struct Segments { /* Pointer to the current segment list. Output goes here. */ extern Segments* CS; +/* Pointer to the global segment list */ +extern Segments* GS; + /*****************************************************************************/ @@ -102,11 +105,17 @@ extern Segments* CS; 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 */ -int ValidSegName (const char* Name); -/* Return true if the given segment name is valid, return false otherwise */ +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 */ @@ -121,7 +130,7 @@ struct DataSeg* GetDataSeg (void); /* Return the current data segment */ void AddTextLine (const char* Format, ...) attribute ((format (printf, 1, 2))); -/* Add a line of code to the current text segment */ +/* Add a line to the current text segment */ void AddCodeLine (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Add a line of code to the current code segment */ @@ -132,6 +141,12 @@ 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 */ +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, FILE* F); /* Output the given segments to the file */