[sword-cvs] sword/bindings/swig/perl Sword.cxx,1.11,1.12 Sword.pm,1.9,1.10

sword@www.crosswire.org sword@www.crosswire.org
Sat, 28 Jun 2003 14:08:59 -0700


Update of /usr/local/cvsroot/sword/bindings/swig/perl
In directory www:/tmp/cvs-serv13769/perl

Modified Files:
	Sword.cxx Sword.pm 
Log Message:
fixes for Swig bindings to current CVS

Index: Sword.cxx
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/perl/Sword.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Sword.cxx	16 May 2003 19:49:52 -0000	1.11
--- Sword.cxx	28 Jun 2003 21:08:56 -0000	1.12
***************
*** 521,559 ****
  #define  SWIGTYPE_p_p_char swig_types[7] 
  #define  SWIGTYPE_p_RawLD swig_types[8] 
! #define  SWIGTYPE_p_TreeKey swig_types[9] 
! #define  SWIGTYPE_p_bool swig_types[10] 
! #define  SWIGTYPE_p_SWFilterMgr swig_types[11] 
! #define  SWIGTYPE_p_SWLD swig_types[12] 
! #define  SWIGTYPE_p_SWTextDirection swig_types[13] 
! #define  SWIGTYPE_p_RawText swig_types[14] 
! #define  SWIGTYPE_p_f_char_p_void__void swig_types[15] 
! #define  SWIGTYPE_p_VerseKey swig_types[16] 
[...1047 lines suppressed...]
+ {"Swordc::SWBuf_c_str", _wrap_SWBuf_c_str},
+ {"Swordc::SWBuf_charAt", _wrap_SWBuf_charAt},
+ {"Swordc::SWBuf_size", _wrap_SWBuf_size},
+ {"Swordc::SWBuf_length", _wrap_SWBuf_length},
+ {"Swordc::SWBuf_set", _wrap_SWBuf_set},
+ {"Swordc::SWBuf_setSize", _wrap_SWBuf_setSize},
+ {"Swordc::SWBuf_append", _wrap_SWBuf_append},
+ {"Swordc::SWBuf_appendFormatted", _wrap_SWBuf_appendFormatted},
+ {"Swordc::SWBuf_getRawData", _wrap_SWBuf_getRawData},
+ {"Swordc::SWBuf_compare", _wrap_SWBuf_compare},
  {0,0}
  };
***************
*** 9348,9351 ****
--- 10136,10140 ----
      SWIG_TypeClientData(SWIGTYPE_p_LZSSCompress, (void*) "Sword::LZSSCompress");
      SWIG_TypeClientData(SWIGTYPE_p_ZipCompress, (void*) "Sword::ZipCompress");
+     SWIG_TypeClientData(SWIGTYPE_p_SWBuf, (void*) "Sword::SWBuf");
      ST(0) = &PL_sv_yes;
      XSRETURN(1);

Index: Sword.pm
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/perl/Sword.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Sword.pm	16 May 2003 19:49:52 -0000	1.9
--- Sword.pm	28 Jun 2003 21:08:56 -0000	1.10
***************
*** 41,44 ****
--- 41,45 ----
  %OWNER = ();
  %BLESSEDMEMBERS = (
+     filename => 'Sword::SWBuf',
  );
  
***************
*** 1353,1356 ****
--- 1354,1410 ----
  *Encode = *Swordc::ZipCompress_Encode;
  *Decode = *Swordc::ZipCompress_Decode;
+ sub DISOWN {
+     my $self = shift;
+     my $ptr = tied(%$self);
+     delete $OWNER{$ptr};
+     };
+ 
+ sub ACQUIRE {
+     my $self = shift;
+     my $ptr = tied(%$self);
+     $OWNER{$ptr} = 1;
+     };
+ 
+ 
+ ############# Class : Sword::SWBuf ##############
+ 
+ package Sword::SWBuf;
+ @ISA = qw( Sword );
+ %OWNER = ();
+ %ITERATORS = ();
+ sub new {
+     my $pkg = shift;
+     my @args = @_;
+     my $self = Swordc::new_SWBuf(@args);
+     return undef if (!defined($self));
+     $OWNER{$self} = 1;
+     my %retval;
+     tie %retval, "Sword::SWBuf", $self;
+     return bless \%retval, $pkg;
+ }
+ 
+ sub DESTROY {
+     return unless $_[0]->isa('HASH');
+     my $self = tied(%{$_[0]});
+     return unless defined $self;
+     delete $ITERATORS{$self};
+     if (exists $OWNER{$self}) {
+         Swordc::delete_SWBuf($self);
+         delete $OWNER{$self};
+     }
+ }
+ 
+ *setFillByte = *Swordc::SWBuf_setFillByte;
+ *getFillByte = *Swordc::SWBuf_getFillByte;
+ *c_str = *Swordc::SWBuf_c_str;
+ *charAt = *Swordc::SWBuf_charAt;
+ *size = *Swordc::SWBuf_size;
+ *length = *Swordc::SWBuf_length;
+ *set = *Swordc::SWBuf_set;
+ *setSize = *Swordc::SWBuf_setSize;
+ *append = *Swordc::SWBuf_append;
+ *appendFormatted = *Swordc::SWBuf_appendFormatted;
+ *getRawData = *Swordc::SWBuf_getRawData;
+ *compare = *Swordc::SWBuf_compare;
  sub DISOWN {
      my $self = shift;