]> git.sur5r.net Git - cc65/blobdiff - src/cc65/litpool.c
Cleanup. Added a few general purpose functions.
[cc65] / src / cc65 / litpool.c
index b1675ad870d2c102924d3c53d6d84ad28ad2517b..e026db0d49af72c85687d75068e9ef46c7bfa785 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 1998-2004 Ullrich von Bassewitz                                        */
+/*               Römerstraße 52                                              */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -37,7 +37,6 @@
 
 /* common */
 #include "check.h"
-#include "strbuf.h"
 #include "tgttrans.h"
 
 /* cc65 */
@@ -94,7 +93,7 @@ void DumpLiteralPool (void)
     }
 
     /* Switch to the data segment */
-    if (WriteableStrings) {
+    if (IS_Get (&WritableStrings)) {
        g_usedata ();
     } else {
                g_userodata ();
@@ -165,6 +164,17 @@ const char* GetLiteral (unsigned Offs)
 
 
 
+void GetLiteralStrBuf (StrBuf* Target, unsigned Offs)
+/* Copy the string starting at Offs and lasting to the end of the buffer
+ * into Target.
+ */
+{
+    CHECK (Offs <= SB_GetLen (&LiteralPool));
+    SB_Slice (Target, &LiteralPool, Offs, SB_GetLen (&LiteralPool) - Offs);
+}
+
+
+
 void PrintLiteralPoolStats (FILE* F)
 /* Print statistics about the literal space used */
 {