Browse Source

Change pucrunch interface to take an EXP_FILE * so the checksum is computed.

git-svn-id: file:///var/svn/tigccpp/trunk@1147 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 17 years ago
parent
commit
a7870c9b19
2 changed files with 7 additions and 7 deletions
  1. 5 5
      tigcc/ld-tigcc/export/pucrunch.c
  2. 2 2
      tigcc/ld-tigcc/export/pucrunch.h

+ 5 - 5
tigcc/ld-tigcc/export/pucrunch.c

@@ -147,7 +147,7 @@ static void TTPackInit(void) {
 //=============================================================================
 // the packing code
 //=============================================================================
-static int SavePack(unsigned char *data, int size, FILE *fp, int escape,
+static int SavePack(unsigned char *data, int size, EXP_FILE *fp, int escape,
                     unsigned char *rleValues, int extraLZPosBits)
 {
     int  i;
@@ -178,9 +178,9 @@ static int SavePack(unsigned char *data, int size, FILE *fp, int escape,
 
     for(i=0; i<rleUsed; i++) re.value[i] = rleValues[i+1];
 
-    fwrite(&cth, 1, sizeof(PackedHeader), fp); // write header
-    fwrite(&re,  1, cth.rleentries, fp);       // write rle values
-    fwrite(data, size, 1, fp);                 // write compressed data
+    ExportWrite(fp, &cth, 1, sizeof(PackedHeader)); // write header
+    ExportWrite(fp, &re,  1, cth.rleentries);       // write rle values
+    ExportWrite(fp, data, size, 1);                 // write compressed data
     return 0;
 }
 
@@ -1552,7 +1552,7 @@ errorexit:
 //=============================================================================
 // as usual: the main, but a long one ...
 //=============================================================================
-int TTPack(int flags, int in_len, unsigned char *in_data, FILE *out_file) {
+int TTPack(int flags, int in_len, unsigned char *in_data, EXP_FILE *out_file) {
     int   startAddr   = 0x258;
     int   lzlen       = -1;
     int   startEscape = 0;

+ 2 - 2
tigcc/ld-tigcc/export/pucrunch.h

@@ -22,9 +22,9 @@
 #error Pucrunch compression is only supported for the standalone target.
 #endif
 
-#include <stdio.h>
+#include "exp_def.h"
 
 #define F_VERBOSE    (1<<0)
 #define F_STATS      (1<<1)
 
-int TTPack(int flags, int in_len, unsigned char *in_data, FILE *out_file);
+int TTPack(int flags, int in_len, unsigned char *in_data, EXP_FILE *out_file);