Added a method to write variable sized unsigned values. Use this method for

all sorts of things in the object files. This does not only make the object
files smaller, but does also remove several limits (strings may be longer
than 255 bytes, several counters no longer have 8 or 16 bit limits).


git-svn-id: svn://svn.cc65.org/cc65/trunk@260 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-08-02 13:23:06 +00:00
parent 85d8b3badf
commit 097a01094e
29 changed files with 423 additions and 295 deletions

View File

@@ -40,7 +40,8 @@
#include <stdio.h>
#include "../common/filepos.h"
/* common */
#include "filepos.h"
@@ -65,6 +66,9 @@ void Write32 (FILE* F, unsigned long Val);
void WriteVal (FILE* F, unsigned long Val, unsigned Size);
/* Write a value of the given size to the output file */
void WriteVar (FILE* F, unsigned long V);
/* Write a variable sized value to the file in special encoding */
void WriteStr (FILE* F, const char* S);
/* Write a string to the file */
@@ -89,10 +93,10 @@ unsigned long Read32 (FILE* F);
long Read32Signed (FILE* F);
/* Read a 32 bit value from the file. Sign extend the value. */
char* ReadStr (FILE* F, char* Str);
/* Read a string from the file. Str must hold 256 chars at max */
unsigned long ReadVar (FILE* F);
/* Read a variable size value from the file */
char* ReadMallocedStr (FILE* F);
char* ReadStr (FILE* F);
/* Read a string from the file into a malloced area */
FilePos* ReadFilePos (FILE* F, FilePos* Pos);