[sword-cvs] sword/bindings/swig/perl Sword.cxx,1.7,1.8 Sword.pm,1.6,1.7

sword@www.crosswire.org sword@www.crosswire.org
Thu, 30 Jan 2003 17:24:08 -0700


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

Modified Files:
	Sword.cxx Sword.pm 
Log Message:
improved SWIG bindings

Index: Sword.cxx
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/perl/Sword.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Sword.cxx	13 Jan 2003 23:52:09 -0000	1.7
--- Sword.cxx	31 Jan 2003 00:24:04 -0000	1.8
***************
*** 697,700 ****
--- 697,740 ----
  using namespace sword;
  
+ int const VerseKey_bookCount(VerseKey *self,int const testament){
+ 		if ( (testament < 1) || (testament > 2) ) {
+ 			return 0;
+ 		};
+ 		return self->BMAX[testament-1];
+ 	}
+ char const *VerseKey_bookName(VerseKey *self,int const testament,int const book){
+ 		if ( (testament < 1) || (testament > 2) ) {
+ 			return "";
+ 		};
+ 		if ( (book < 1) || (book > self->BMAX[testament-1]) ) {
+ 			return "";
+ 		}
+ 
+ 		return self->books[testament-1][book-1].name;
+ 	}
+ int const VerseKey_chapterCount(VerseKey *self,int const testament,int const book){
+ 		if ( (testament < 1) || (testament > 2) ) {
+ 			return 0;
+ 		};
+ 		if ( (book < 1) || (book > self->BMAX[testament-1]) ) {
+ 			return 0;
+ 		}
+ 
+ 		return self->books[testament-1][book-1].chapmax;
+ 	}
+ int const VerseKey_verseCount(VerseKey *self,int const testament,int const book,int const chapter){
+ 		if ( (testament < 1) || (testament > 2) ) {
+ 			return 0;
+ 		};
+ 		if ( (book < 1) || (book > self->BMAX[testament-1]) ) {
+ 			return 0;
+ 		}
+ 		if ( (chapter < 1) || (chapter > self->books[testament-1][book-1].chapmax) ) {
+ 			return 0;
+ 		}
+ 
+ 		return self->books[testament-1][book-1].versemax[chapter-1];
+ 
+ 	}
  
  #include "listkey.h"
***************
*** 5058,5061 ****
--- 5098,5237 ----
  
  
+ XS(_wrap_VerseKey_bookCount) {
+     char _swigmsg[SWIG_MAX_ERRMSG] = "";
+     const char *_swigerr = _swigmsg;
+     {
+         VerseKey *arg1 = (VerseKey *) 0 ;
+         int arg2 ;
+         int result;
+         int argvi = 0;
+         dXSARGS;
+         
+         if ((items < 2) || (items > 2)) {
+             SWIG_croak("Usage: VerseKey_bookCount(self,testament);");
+         }
+         {
+             if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_VerseKey,0) < 0) {
+                 SWIG_croak("Type error in argument 1 of VerseKey_bookCount. Expected _p_VerseKey");
+             }
+         }
+         arg2 = (int) SvIV(ST(1));
+         result = (int)VerseKey_bookCount(arg1,arg2);
+         
+         ST(argvi) = sv_newmortal();
+         sv_setiv(ST(argvi++), (IV) result);
+         XSRETURN(argvi);
+         fail:
+         (void) _swigerr;
+     }
+     croak(_swigerr);
+ }
+ 
+ 
+ XS(_wrap_VerseKey_bookName) {
+     char _swigmsg[SWIG_MAX_ERRMSG] = "";
+     const char *_swigerr = _swigmsg;
+     {
+         VerseKey *arg1 = (VerseKey *) 0 ;
+         int arg2 ;
+         int arg3 ;
+         char *result;
+         int argvi = 0;
+         dXSARGS;
+         
+         if ((items < 3) || (items > 3)) {
+             SWIG_croak("Usage: VerseKey_bookName(self,testament,book);");
+         }
+         {
+             if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_VerseKey,0) < 0) {
+                 SWIG_croak("Type error in argument 1 of VerseKey_bookName. Expected _p_VerseKey");
+             }
+         }
+         arg2 = (int) SvIV(ST(1));
+         arg3 = (int) SvIV(ST(2));
+         result = (char *)VerseKey_bookName(arg1,arg2,arg3);
+         
+         ST(argvi) = sv_newmortal();
+         if (result) {
+             sv_setpv((SV*)ST(argvi++), (char *) result);
+         }else {
+             sv_setsv((SV*)ST(argvi++), &PL_sv_undef);
+         }
+         XSRETURN(argvi);
+         fail:
+         (void) _swigerr;
+     }
+     croak(_swigerr);
+ }
+ 
+ 
+ XS(_wrap_VerseKey_chapterCount) {
+     char _swigmsg[SWIG_MAX_ERRMSG] = "";
+     const char *_swigerr = _swigmsg;
+     {
+         VerseKey *arg1 = (VerseKey *) 0 ;
+         int arg2 ;
+         int arg3 ;
+         int result;
+         int argvi = 0;
+         dXSARGS;
+         
+         if ((items < 3) || (items > 3)) {
+             SWIG_croak("Usage: VerseKey_chapterCount(self,testament,book);");
+         }
+         {
+             if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_VerseKey,0) < 0) {
+                 SWIG_croak("Type error in argument 1 of VerseKey_chapterCount. Expected _p_VerseKey");
+             }
+         }
+         arg2 = (int) SvIV(ST(1));
+         arg3 = (int) SvIV(ST(2));
+         result = (int)VerseKey_chapterCount(arg1,arg2,arg3);
+         
+         ST(argvi) = sv_newmortal();
+         sv_setiv(ST(argvi++), (IV) result);
+         XSRETURN(argvi);
+         fail:
+         (void) _swigerr;
+     }
+     croak(_swigerr);
+ }
+ 
+ 
+ XS(_wrap_VerseKey_verseCount) {
+     char _swigmsg[SWIG_MAX_ERRMSG] = "";
+     const char *_swigerr = _swigmsg;
+     {
+         VerseKey *arg1 = (VerseKey *) 0 ;
+         int arg2 ;
+         int arg3 ;
+         int arg4 ;
+         int result;
+         int argvi = 0;
+         dXSARGS;
+         
+         if ((items < 4) || (items > 4)) {
+             SWIG_croak("Usage: VerseKey_verseCount(self,testament,book,chapter);");
+         }
+         {
+             if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_VerseKey,0) < 0) {
+                 SWIG_croak("Type error in argument 1 of VerseKey_verseCount. Expected _p_VerseKey");
+             }
+         }
+         arg2 = (int) SvIV(ST(1));
+         arg3 = (int) SvIV(ST(2));
+         arg4 = (int) SvIV(ST(3));
+         result = (int)VerseKey_verseCount(arg1,arg2,arg3,arg4);
+         
+         ST(argvi) = sv_newmortal();
+         sv_setiv(ST(argvi++), (IV) result);
+         XSRETURN(argvi);
+         fail:
+         (void) _swigerr;
+     }
+     croak(_swigerr);
+ }
+ 
+ 
  XS(_wrap_new_ListKey__SWIG_0) {
      char _swigmsg[SWIG_MAX_ERRMSG] = "";
***************
*** 8718,8721 ****
--- 8894,8901 ----
  {"Swordc::VerseKey_setLocale", _wrap_VerseKey_setLocale},
  {"Swordc::VerseKey_getLocale", _wrap_VerseKey_getLocale},
+ {"Swordc::VerseKey_bookCount", _wrap_VerseKey_bookCount},
+ {"Swordc::VerseKey_bookName", _wrap_VerseKey_bookName},
+ {"Swordc::VerseKey_chapterCount", _wrap_VerseKey_chapterCount},
+ {"Swordc::VerseKey_verseCount", _wrap_VerseKey_verseCount},
  {"Swordc::new_ListKey", _wrap_new_ListKey},
  {"Swordc::delete_ListKey", _wrap_delete_ListKey},

Index: Sword.pm
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/perl/Sword.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Sword.pm	13 Jan 2003 23:52:09 -0000	1.6
--- Sword.pm	31 Jan 2003 00:24:05 -0000	1.7
***************
*** 532,535 ****
--- 532,539 ----
  *setLocale = *Swordc::VerseKey_setLocale;
  *getLocale = *Swordc::VerseKey_getLocale;
+ *bookCount = *Swordc::VerseKey_bookCount;
+ *bookName = *Swordc::VerseKey_bookName;
+ *chapterCount = *Swordc::VerseKey_chapterCount;
+ *verseCount = *Swordc::VerseKey_verseCount;
  sub DISOWN {
      my $self = shift;