Permalink
Browse files

Step 2: add header for wrapped functions.

  • Loading branch information...
Ben Laurie
Ben Laurie committed Apr 28, 2012
1 parent 922ce66 commit 499e5452213602c9311a22fb5065bb20f2db601d
Showing with 14 additions and 4 deletions.
  1. +5 −0 contrib/bzip2/CONVERSION
  2. +1 −1 contrib/bzip2/bzip2.c
  3. +2 −3 contrib/bzip2/bzip2_wrapped.c
  4. +6 −0 contrib/bzip2/bzip2_wrapped.h
View
@@ -6,3 +6,8 @@
compression and decompression library. A visual inspection shows
that this is just the functions compressStream(),
uncompressStream() and testStream().
2. Compile.
Obviously we will now get errors because of the missing
functions. Add them to an appropriate new header.
View
@@ -55,6 +55,7 @@
#include <errno.h>
#include <ctype.h>
#include "bzlib.h"
#include "bzip2_wrapped.h"
#define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); }
#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); }
@@ -159,7 +160,6 @@
--*/
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
@@ -1,5 +1,6 @@
#include "bzip2_wrapped.c"
/*---------------------------------------------*/
static
void compressStream ( FILE *stream, FILE *zStream )
{
BZFILE* bzf = NULL;
@@ -103,7 +104,6 @@ void compressStream ( FILE *stream, FILE *zStream )
/*---------------------------------------------*/
static
Bool uncompressStream ( FILE *zStream, FILE *stream )
{
BZFILE* bzf = NULL;
@@ -224,7 +224,6 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
/*---------------------------------------------*/
static
Bool testStream ( FILE *zStream )
{
BZFILE* bzf = NULL;
@@ -0,0 +1,6 @@
typedef unsigned char Bool;
void compressStream ( FILE *stream, FILE *zStream );
Bool uncompressStream ( FILE *zStream, FILE *stream );
Bool testStream ( FILE *zStream );

0 comments on commit 499e545

Please sign in to comment.