| | |
| | | defstream.avail_in = data_len+1; |
| | | defstream.next_in = (unsigned char *)data; |
| | | fprintf(stderr,"WAS HERE %d\n", data_len); |
| | | *compressed=(char *)malloc(data_len*sizeof(char *)); |
| | | char *compr=(char *)malloc(data_len*sizeof(char)); |
| | | defstream.avail_out = data_len+1; |
| | | defstream.next_out = (unsigned char *)*compressed; |
| | | defstream.next_out = (unsigned char *)compr; |
| | | deflateInit(&defstream, Z_BEST_COMPRESSION); |
| | | deflate(&defstream, Z_FINISH); |
| | | deflateEnd(&defstream); |
| | | *compressed=compr; |
| | | return defstream.total_out; |
| | | } |
| | | |