INCLUDE: constants.xs
BOOT:
+#ifndef NO_WRITEABLE_DATA
+ trace = TRACE_DEFAULT ;
+#endif
/* Check this version of bzip2 is == 1 */
if (BZ2_bzlibVersion()[0] != '1')
croak(COMPRESS_CLASS " needs bzip2 version 1.x, you have %s\n", BZ2_bzlibVersion()) ;
bzlibversion()
void
-new(class, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0)
- const char * class
+new(className, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0)
+ const char * className
int appendOut
int blockSize100k
int workfactor
err = BZ_MEM_ERROR ;
{
- SV* obj = sv_setref_pv(sv_newmortal(), class, (void*)s);
+ SV* obj = sv_setref_pv(sv_newmortal(), className, (void*)s);
XPUSHs(obj);
}
if(0)
MODULE = Compress::Raw::Bunzip2 PACKAGE = Compress::Raw::Bunzip2
void
-new(class, appendOut=1 , consume=1, small=0, verbosity=0)
- const char* class
+new(className, appendOut=1 , consume=1, small=0, verbosity=0)
+ const char* className
int appendOut
int consume
int small
err = BZ_MEM_ERROR ;
{
- SV* obj = sv_setref_pv(sv_newmortal(), class, (void*)s);
+ SV* obj = sv_setref_pv(sv_newmortal(), className, (void*)s);
XPUSHs(obj);
}
if (0)
if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
- s = BZALLOC( sizeof(EState) );
+ s = (EState*) BZALLOC( sizeof(EState) );
if (s == NULL) return BZ_MEM_ERROR;
s->strm = strm;
s->ftab = NULL;
n = 100000 * blockSize100k;
- s->arr1 = BZALLOC( n * sizeof(UInt32) );
- s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
- s->ftab = BZALLOC( 65537 * sizeof(UInt32) );
+ s->arr1 = (UInt32*) BZALLOC( n * sizeof(UInt32) );
+ s->arr2 = (UInt32*) BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
+ s->ftab = (UInt32*) BZALLOC( 65537 * sizeof(UInt32) );
if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
if (s->arr1 != NULL) BZFREE(s->arr1);
{
Bool progress_in = False;
Bool progress_out = False;
- EState* s = strm->state;
+ EState* s = (EState*) strm->state;
while (True) {
Bool progress;
EState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
+ s = (EState*) strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
{
EState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
+ s = (EState*) strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
- s = BZALLOC( sizeof(DState) );
+ s = (DState*) BZALLOC( sizeof(DState) );
if (s == NULL) return BZ_MEM_ERROR;
s->strm = strm;
strm->state = s;
/*---------------------------------------------------*/
-__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
+#ifndef __cplusplus
+__inline__
+#endif
+Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
{
Int32 nb, na, mid;
nb = 0;
Bool corrupt;
DState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
+ s = (DState*) strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
{
DState* s;
if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
+ s = (DState*) strm->state;
if (s == NULL) return BZ_PARAM_ERROR;
if (s->strm != strm) return BZ_PARAM_ERROR;
if (ferror(f))
{ BZ_SETERR(BZ_IO_ERROR); return NULL; };
- bzf = malloc ( sizeof(bzFile) );
+ bzf = (bzFile*) malloc ( sizeof(bzFile) );
if (bzf == NULL)
{ BZ_SETERR(BZ_MEM_ERROR); return NULL; };
{ BZ_SETERR(BZ_OK); return; };
bzf->strm.avail_in = len;
- bzf->strm.next_in = buf;
+ bzf->strm.next_in = (char*)buf;
while (True) {
bzf->strm.avail_out = BZ_MAX_UNUSED;
if (ferror(f))
{ BZ_SETERR(BZ_IO_ERROR); return NULL; };
- bzf = malloc ( sizeof(bzFile) );
+ bzf = (bzFile*) malloc ( sizeof(bzFile) );
if (bzf == NULL)
{ BZ_SETERR(BZ_MEM_ERROR); return NULL; };
{ BZ_SETERR(BZ_OK); return 0; };
bzf->strm.avail_out = len;
- bzf->strm.next_out = buf;
+ bzf->strm.next_out = (char*) buf;
while (True) {