]> git.sur5r.net Git - cc65/blobdiff - src/ca65/spool.h
Started to add debug infos for C functions and symbols.
[cc65] / src / ca65 / spool.h
index 6cf9d18e4dc8d24203498c8d312571206edb0d6e..d20b3014bff2b43e757875fcef41ad9109d94851 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2003      Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2003-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 
-extern StringPool StrPool;
+/* The index for an empty string */
+#define EMPTY_STRING_ID         0U
+
+/* The string pool */
+extern StringPool* StrPool;
 
 
 
@@ -59,19 +63,52 @@ extern StringPool StrPool;
 
 
 
+#if defined(HAVE_INLINE)
+INLINE unsigned GetStrBufId (const StrBuf* S)
+/* Return the id of the given string buffer */
+{
+    return SP_Add (StrPool, S);
+}
+#else
+#  define GetStrBufId(S)        SP_Add (StrPool, (S))
+#endif
+
 #if defined(HAVE_INLINE)
 INLINE unsigned GetStringId (const char* S)
 /* Return the id of the given string */
 {
-    return SP_Add (&StrPool, S);
+    return SP_AddStr (StrPool, S);
+}
+#else
+#  define GetStringId(S)        SP_AddStr (StrPool, (S))
+#endif
+
+#if defined(HAVE_INLINE)
+INLINE const StrBuf* GetStrBuf (unsigned Index)
+/* Convert a string index into a string */
+{
+    return SP_Get (StrPool, Index);
+}
+#else
+#  define GetStrBuf(Index)      SP_Get (StrPool, (Index))
+#endif
+
+#if defined(HAVE_INLINE)
+INLINE const char* GetString (unsigned Index)
+/* Convert a string index into a string */
+{
+    return SB_GetConstBuf (SP_Get (StrPool, Index));
 }
 #else
-#  define GetStringId(S)        SP_Add (&StrPool, (S))
+#  define GetString(Index)      SB_GetConstBuf (SP_Get (StrPool, (Index)))
 #endif
 
 void WriteStrPool (void);
 /* Write the string pool to the object file */
 
+void InitStrPool (void);
+/* Initialize the string pool */
+
 
 
 /* End of spool.h */