]> git.sur5r.net Git - cc65/blobdiff - src/ca65/objfile.c
Finished implemenation of commands to delete macros. Added the new commands to
[cc65] / src / ca65 / objfile.c
index 512ccffb93bae7abaec90d6de9d3fce701192e16..f9fba1521141de0c06e30920ad7acf52e4217392 100644 (file)
@@ -83,7 +83,9 @@ static ObjHeader Header = {
     0,                  /* 32: Offset to string pool */
     0,                  /* 32: Size of string pool */
     0,                  /* 32: Offset to assertion table */
-    0                   /* 32: Size of assertion table */
+    0,                  /* 32: Size of assertion table */
+    0,                  /* 32: Offset into scope table */
+    0,                  /* 32: Size of scope table */
 };
 
 
@@ -138,6 +140,8 @@ static void ObjWriteHeader (void)
     ObjWrite32 (Header.StrPoolSize);
     ObjWrite32 (Header.AssertOffs);
     ObjWrite32 (Header.AssertSize);
+    ObjWrite32 (Header.ScopeOffs);
+    ObjWrite32 (Header.ScopeSize);
 }
 
 
@@ -292,6 +296,19 @@ void ObjWriteStr (const char* S)
 
 
 
+void ObjWriteBuf (const StrBuf* S)
+/* Write a string to the object file */
+{
+    /* Write the string with the length preceeded (this is easier for
+     * the reading routine than the C format since the length is known in
+     * advance).
+     */
+    ObjWriteVar (SB_GetLen (S));
+    ObjWriteData (SB_GetConstBuf (S), SB_GetLen (S));    
+}
+
+
+
 void ObjWriteData (const void* Data, unsigned Size)
 /* Write literal data to the file */
 {
@@ -462,3 +479,19 @@ void ObjEndAssertions (void)
 
 
 
+void ObjStartScopes (void)
+/* Mark the start of the scope table */
+{
+    Header.ScopeOffs = ftell (F);
+}
+
+
+
+void ObjEndScopes (void)
+/* Mark the end of the scope table */
+{
+    Header.ScopeSize = ftell (F) - Header.ScopeOffs;
+}
+
+
+