]> git.sur5r.net Git - cc65/blobdiff - src/od65/fileio.c
Rather stay with OFF_YEAR as it is an "officially" name.
[cc65] / src / od65 / fileio.c
index 300321164087f2cc6ddb981d701544491d5b0808..a1493500689331bc6b8cde996cd6fb1de88b1722 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2003 Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -51,9 +51,9 @@
 
 
 
-void FileSeek (FILE* F, unsigned long Pos)
+void FileSetPos (FILE* F, unsigned long Pos)
 /* Seek to the given absolute position, fail on errors */
-{
+{                 
     if (fseek (F, Pos, SEEK_SET) != 0) {
        Error ("Cannot seek: %s", strerror (errno));
     }
@@ -61,6 +61,18 @@ void FileSeek (FILE* F, unsigned long Pos)
 
 
 
+unsigned long FileGetPos (FILE* F)
+/* Return the current file position, fail on errors */
+{
+    long Pos = ftell (F);
+    if (Pos < 0) {
+               Error ("Error in ftell: %s", strerror (errno));
+    }
+    return Pos;
+}
+
+
+
 unsigned Read8 (FILE* F)
 /* Read an 8 bit value from the file */
 {
@@ -213,6 +225,12 @@ void ReadObjHeader (FILE* F, ObjHeader* H)
     H->LineInfoSize = Read32 (F);
     H->StrPoolOffs  = Read32 (F);
     H->StrPoolSize  = Read32 (F);
+    H->AssertOffs   = Read32 (F);
+    H->AssertSize   = Read32 (F);
+    H->ScopeOffs    = Read32 (F);
+    H->ScopeSize    = Read32 (F);
+    H->SpanOffs     = Read32 (F);
+    H->SpanSize     = Read32 (F);
 }