]> git.sur5r.net Git - cc65/blobdiff - src/cc65/segments.c
Rewrote type conversions
[cc65] / src / cc65 / segments.c
index dd7817b8887149d68ead2401edad3c0b0c411653..dabb4a4a601e59ad5ae62aeff86b9ba73918db7a 100644 (file)
@@ -224,6 +224,22 @@ void AddDataLine (const char* Format, ...)
 
 
 
+int HaveGlobalCode (void)
+/* Return true if the global code segment contains entries (which is an error) */
+{
+    return (CS_GetEntryCount (GS->Code) > 0);
+}
+
+
+
+void RemoveGlobalCode (void)
+/* Remove all code from the global code segment. Used for error recovery. */
+{
+    CS_DelEntries (GS->Code, 0, CS_GetEntryCount (GS->Code));
+}
+
+
+
 void OutputSegments (const Segments* S, FILE* F)
 /* Output the given segments to the file */
 {