*** Sablotron.xs	Sun Feb 04 04:16:04 2001
--- Sablotron.bak	Wed Dec 20 03:29:29 2000
***************
*** 249,255 ****
    GV *gv;
    unsigned long ret = 0;
    SV *value;
!   unsigned int len;
  
    wrapper = (SV*)userData;
  
--- 249,255 ----
    GV *gv;
    unsigned long ret = 0;
    SV *value;
!   int len;
  
    wrapper = (SV*)userData;
  
***************
*** 283,289 ****
      value = POPs;
      if ( SvOK(value) ) {
        SvPV(value, len);
!       *buffer = (char*) malloc(len + 1);
        strcpy(*buffer, SvPV(value, PL_na));
        *byteCount = len + 1;
      } else {
--- 283,289 ----
      value = POPs;
      if ( SvOK(value) ) {
        SvPV(value, len);
!       *buffer = malloc(len + 1);
        strcpy(*buffer, SvPV(value, PL_na));
        *byteCount = len + 1;
      } else {
***************
*** 301,311 ****
  
  int SchemeHandlerFreeMemoryStub(void *userData, void *processor,
      char *buffer) {
-   unsigned long ret = 0;
    if (buffer) {
      free(buffer);
    }
-   return ret;
  }
  
  int SchemeHandlerOpenStub(void *userData, void *processor,
--- 301,309 ----
***************
*** 374,380 ****
    GV *gv;
    unsigned long ret = 0;
    SV *value;
!   unsigned int len;
  
    wrapper = (SV*)userData;
  
--- 372,378 ----
    GV *gv;
    unsigned long ret = 0;
    SV *value;
!   int len;
  
    wrapper = (SV*)userData;
  
***************
*** 726,732 ****
  	SV *processor_obj;
  	CODE:
  	processor = GET_PROCESSOR(object);
! 	processor_obj = (struct sv*) SablotGetInstanceData(processor);
  	if (processor_obj) SvREFCNT_dec(processor_obj);
  	SablotSetInstanceData(processor, NULL);
  
--- 724,730 ----
  	SV *processor_obj;
  	CODE:
  	processor = GET_PROCESSOR(object);
! 	processor_obj = SablotGetInstanceData(processor);
  	if (processor_obj) SvREFCNT_dec(processor_obj);
  	SablotSetInstanceData(processor, NULL);
  
***************
*** 906,912 ****
              croak("Unsupported handler type");
  	}
  	SvREFCNT_inc(wrapper);
! 	RETVAL = SablotRegHandler(processor, (HandlerType) type, vector, wrapper);
  	OUTPUT:
  	RETVAL
  
--- 904,910 ----
              croak("Unsupported handler type");
  	}
  	SvREFCNT_inc(wrapper);
! 	RETVAL = SablotRegHandler(processor, type, vector, wrapper);
  	OUTPUT:
  	RETVAL
  
***************
*** 936,959 ****
  	  otherwise:
              croak("Unsupported handler type");
  	}
! 	RETVAL = SablotUnregHandler(processor, (HandlerType) type, vector, wrapper);
  	SvREFCNT_dec(wrapper);
  	OUTPUT:
  	RETVAL
  
! #int
! #_debug_refcnt(ref)
! #	SV 	*ref
! #	CODE:
! #	RETVAL = SvREFCNT(ref);
! #	OUTPUT:
! #	RETVAL
! #
! #int
! #_debug_refcnt_rv(ref)
! #	SV 	*ref
! #	CODE:
! #	RETVAL = SvREFCNT(SvRV(ref));
! #	OUTPUT:
! #	RETVAL
! #*/
--- 934,956 ----
  	  otherwise:
              croak("Unsupported handler type");
  	}
! 	RETVAL = SablotUnregHandler(processor, type, vector, wrapper);
  	SvREFCNT_dec(wrapper);
  	OUTPUT:
  	RETVAL
  
! int
! _debug_refcnt(ref)
! 	SV 	*ref
! 	CODE:
! 	RETVAL = SvREFCNT(ref);
! 	OUTPUT:
! 	RETVAL
! 
! int
! _debug_refcnt_rv(ref)
! 	SV 	*ref
! 	CODE:
! 	RETVAL = SvREFCNT(SvRV(ref));
! 	OUTPUT:
! 	RETVAL
