Subject: use Debian zlib library
Description: Debian library is more recent than the one embedded upstream.
 Its API changed and code needs to be updated to use this version.
 See more info here:
 http://www.postgresql.org/message-id/1329988571.6474.9.camel@vanquo.pezone.net
Author: Olivier Sallou <osallou@debian.org>
Last-Updated: 2013-08-05
Forwaded: no
--- a/standardPregraph/prlRead2Ctg.c
+++ b/standardPregraph/prlRead2Ctg.c
@@ -424,7 +424,7 @@ static void locate1read ( int t )
 	}
 }
 
-static void output1read_gz ( int t, gzFile * outfp, gzFile * outfp2, char orien, int dhflag )
+static void output1read_gz ( int t, gzFile outfp, gzFile outfp2, char orien, int dhflag )
 {
 	int len = lenBuffer[t];
 	int index;
@@ -500,7 +500,7 @@ static void output1Nread ( int t, FILE *
 	fprintf ( outfp, "\n" );
 }
 
-static void getPEreadOnContig ( int t, gzFile * outfp )
+static void getPEreadOnContig ( int t, gzFile outfp )
 {
 	int len1, len2, index;
 	char orien1, orien2;
@@ -560,7 +560,7 @@ static void getPEreadOnContig(int t,FILE
         }
 }*/
 
-static void getReadIngap ( int t, int insSize, gzFile * outfp1, gzFile * outfp2, boolean readOne )
+static void getReadIngap ( int t, int insSize, gzFile outfp1, gzFile outfp2, boolean readOne )
 {
 	int read1, read2;
 	char orientation;
@@ -618,7 +618,7 @@ static void recordLongRead ( FILE * outf
 	}
 }
 
-static void recordAlldgn ( gzFile * outfp, int * insSizeArr, gzFile * outfp1, gzFile * outfp2, gzFile * outfp4 )
+static void recordAlldgn ( gzFile outfp, int * insSizeArr, gzFile outfp1, gzFile outfp2, gzFile outfp4 )
 {
 	int t, ctgId;
 	boolean rd1gap, rd2gap;
@@ -773,7 +773,7 @@ void prlRead2Ctg ( char * libfile, char
 	long long i;
 	char * src_name, *next_name, name[256];
 	FILE * fo2;
-	gzFile * fo, *outfp1 = NULL, *outfp2 = NULL, *outfp3 = NULL, *outfp4 = NULL;
+	gzFile fo, outfp1 = NULL, outfp2 = NULL, outfp3 = NULL, outfp4 = NULL;
 	int maxReadNum, libNo, prevLibNo, insSize = 0;
 	boolean flag, pairs = 1;
 	pthread_t threads[thrd_num];
--- a/standardPregraph/prlReadFillGap.c
+++ b/standardPregraph/prlReadFillGap.c
@@ -104,7 +104,7 @@ static void convertIndex ()
 	free ( ( void * ) length_array );
 }
 
-static long long getRead1by1_gz ( gzFile * fp, DARRAY * readSeqInGap )
+static long long getRead1by1_gz ( gzFile fp, DARRAY * readSeqInGap )
 {
 	long long readCounter = 0;
 
@@ -206,7 +206,7 @@ static long long getRead1by1 ( FILE * fp
 static boolean loadReads4gap ( char * graphfile )
 {
 	FILE * fp1, *fp2;
-	gzFile * fp;
+	gzFile fp;
 	char name[1024];
 	long long readCounter;
 
--- a/standardPregraph/output_pregraph.c
+++ b/standardPregraph/output_pregraph.c
@@ -85,7 +85,7 @@ void output_vertex ( char * outfile )
 	fclose ( fp );
 }
 
-void output_1edge ( preEDGE * edge, gzFile * fp )
+void output_1edge ( preEDGE * edge, gzFile fp )
 {
 	int i;
 	gzprintf ( fp, ">length %d,", edge->length );
--- a/standardPregraph/orderContig.c
+++ b/standardPregraph/orderContig.c
@@ -5072,7 +5072,7 @@ void PE2Links ( char * infile )
 	char name[256], *line;
 	FILE * fp1;
 	FILE * linkF;
-	gzFile * fp2;
+	gzFile fp2;
 	int i;
 	int flag = 0;
 	unsigned int j;
--- a/standardPregraph/node2edge.c
+++ b/standardPregraph/node2edge.c
@@ -37,8 +37,8 @@ static int edge_c, edgeCounter;
 static preEDGE temp_edge;              // for temp use in merge_V2()
 static char edge_seq[100000];       //use this static 'edge_seq ' as an temp seq in merge_V2() for speed ..
 
-static void make_edge ( gzFile * fp );
-static void merge_linearV2 ( char bal_edge, STACK * nStack, int count, gzFile * fp );
+static void make_edge ( gzFile fp );
+static void merge_linearV2 ( char bal_edge, STACK * nStack, int count, gzFile fp );
 static int check_iden_kmerList ( STACK * stack1, STACK * stack2 );
 
 //for stack
@@ -60,7 +60,7 @@ Return:
 *************************************************/
 void kmer2edges ( char * outfile )
 {
-	gzFile * fp;
+	gzFile fp;
 	char temp[256];
 	sprintf ( temp, "%s.edge.gz", outfile );
 	fp = gzopen ( temp, "w" );
@@ -234,7 +234,7 @@ Output:
 Return:
     0.
 *************************************************/
-static int startEdgeFromNode ( kmer_t * node1, gzFile * fp )
+static int startEdgeFromNode ( kmer_t * node1, gzFile fp )
 {
 	int node_c, palindrome;
 	unsigned char flag;
@@ -363,7 +363,7 @@ Output:
 Return:
     None.
 *************************************************/
-void make_edge ( gzFile * fp )
+void make_edge ( gzFile fp )
 {
 	int i = 0;
 	kmer_t * node1;
@@ -427,7 +427,7 @@ Output:
 Return:
     None.
 *************************************************/
-static void merge_linearV2 ( char bal_edge, STACK * nStack, int count, gzFile * fp )
+static void merge_linearV2 ( char bal_edge, STACK * nStack, int count, gzFile fp )
 {
 	int length, char_index;
 	preEDGE * newedge;
--- a/standardPregraph/loadPreGraph.c
+++ b/standardPregraph/loadPreGraph.c
@@ -449,7 +449,7 @@ void loadEdge ( char * graphfile )
 {
 	char c, name[256], line[1024], str[32];
 	char * tightSeq = NULL;
-	gzFile * fp;
+	gzFile fp;
 	Kmer from_kmer, to_kmer;
 	int n = 0, i, length, cvg, index = -1, bal_ed, edgeno;
 	int linelen;
--- a/standardPregraph/kmer.c
+++ b/standardPregraph/kmer.c
@@ -483,7 +483,7 @@ void print_kmer ( FILE * fp, Kmer kmer,
 	fprintf ( fp, "%c", c );
 }
 
-void print_kmer_gz ( gzFile * fp, Kmer kmer, char c )
+void print_kmer_gz ( gzFile fp, Kmer kmer, char c )
 {
 	gzprintf ( fp, "%llx %llx %llx %llx", kmer.high1, kmer.low1, kmer.high2, kmer.low2 );
 	gzprintf ( fp, "%c", c );
@@ -795,7 +795,7 @@ void print_kmer ( FILE * fp, Kmer kmer,
 	fprintf ( fp, "%c", c );
 }
 
-void print_kmer_gz ( gzFile * fp, Kmer kmer, char c )
+void print_kmer_gz ( gzFile fp, Kmer kmer, char c )
 {
 	gzprintf ( fp, "%llx %llx", kmer.high, kmer.low );
 	gzprintf ( fp, "%c", c );
--- a/standardPregraph/attachPEinfo.c
+++ b/standardPregraph/attachPEinfo.c
@@ -492,7 +492,7 @@ int connectByPE_grad ( FILE * fp, int pe
  Return:
     Loaded alignment record number.
  *************************************************/
-int connectByPE_grad_gz ( gzFile * fp, int peGrad, char * line )
+int connectByPE_grad_gz ( gzFile fp, int peGrad, char * line )
 {
 	long long pre_readno, readno, minno, maxno;
 	int pre_pos, pos, flag, PE, count = 0, Total_PE = 0;
--- a/standardPregraph/inc/extfunc.h
+++ b/standardPregraph/inc/extfunc.h
@@ -79,10 +79,10 @@ extern void loadPEgrads ( char * infile
 extern int putInsertS ( long long readid, int size, int * currGrads );
 extern int getInsertS ( long long readid, int * readlen );
 extern int connectByPE_grad ( FILE * fp, int peGrad, char * line );
-extern int connectByPE_grad_gz ( gzFile * fp, int peGrad, char * line );
+extern int connectByPE_grad_gz ( gzFile fp, int peGrad, char * line );
 extern void PEgradsScaf ( char * infile );
 extern void reorderAnnotation ( char * infile, char * outfile );
-extern void output_1edge ( preEDGE * edge, gzFile * fp );
+extern void output_1edge ( preEDGE * edge, gzFile fp );
 extern void prlRead2edge ( char * libfile, char * outfile );
 extern void annotFileTrans ( char * infile, char * outfile );
 extern void prlLoadPath ( char * graphfile );
--- a/standardPregraph/hashFunction.c
+++ b/standardPregraph/hashFunction.c
@@ -82,7 +82,7 @@ static int crc_table[256] =
 };
 
 typedef int ( *CRC32CFunctionPtr ) ( uint32_t, const char *, size_t );
-static CRC32CFunctionPtr crc32;
+static CRC32CFunctionPtr s_crc32;
 
 static uint32_t cpuid ( uint32_t functionInput )
 {
@@ -145,11 +145,11 @@ CRC32CFunctionPtr detectBestCRC32C()
 
 ubyte8 hash_kmer ( Kmer kmer )
 {
-	return ( crc32 ( 0, ( char * ) &kmer, sizeof ( Kmer ) ) );
+	return ( s_crc32 ( 0, ( char * ) &kmer, sizeof ( Kmer ) ) );
 }
 
 void crc32c_Init()
 {
-	crc32 = detectBestCRC32C();
+	s_crc32 = detectBestCRC32C();
 }
 
