X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=perl%2FIDZebra_wrap.c;h=e73f91541014a31251efe8303c84be6e09933140;hb=881b9293d6699c85195142af3f4a957f4982e6e2;hp=eab4a7991e66d00926e14da6559a8a863e608824;hpb=75afa0301433673a23f5c7c8e1f8c78efb4a2d4c;p=idzebra-moved-to-github.git diff --git a/perl/IDZebra_wrap.c b/perl/IDZebra_wrap.c index eab4a79..e73f915 100644 --- a/perl/IDZebra_wrap.c +++ b/perl/IDZebra_wrap.c @@ -212,7 +212,7 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { * perl5.swg * * Perl5 runtime library - * $Header: /home/cvsroot/idis/perl/Attic/IDZebra_wrap.c,v 1.18 2003-05-21 08:03:02 pop Exp $ + * $Header: /home/cvsroot/idis/perl/Attic/IDZebra_wrap.c,v 1.20 2003-07-26 16:27:46 pop Exp $ * ----------------------------------------------------------------------------- */ #define SWIGPERL @@ -4031,14 +4031,16 @@ XS(_wrap_insert_record) { ZebraHandle arg1 ; recordGroup *arg2 ; char *arg3 ; - int arg4 ; + int *arg4 ; char *arg5 ; char *arg6 ; char *arg7 ; int arg8 ; int arg9 ; int result; + int dvalue4 ; int argvi = 0; + SV * _saved[1] ; dXSARGS; if ((items < 9) || (items > 9)) { @@ -4058,7 +4060,18 @@ XS(_wrap_insert_record) { } if (!SvOK((SV*) ST(2))) arg3 = 0; else arg3 = (char *) SvPV(ST(2), PL_na); - arg4 = (int) SvIV(ST(3)); + { + SV *tempsv; + if (!SvROK(ST(3))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(3)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue4 = SvIV(tempsv); + arg4 = &dvalue4; + } if (!SvOK((SV*) ST(4))) arg5 = 0; else arg5 = (char *) SvPV(ST(4), PL_na); if (!SvOK((SV*) ST(5))) arg6 = 0; @@ -4067,10 +4080,16 @@ XS(_wrap_insert_record) { else arg7 = (char *) SvPV(ST(6), PL_na); arg8 = (int) SvIV(ST(7)); arg9 = (int) SvIV(ST(8)); + _saved[0] = ST(3); result = (int)zebra_insert_record(arg1,arg2,(char const *)arg3,arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,arg8,arg9); ST(argvi) = sv_newmortal(); sv_setiv(ST(argvi++), (IV) result); + { + SV *tempsv; + tempsv = SvRV(_saved[0]); + sv_setiv(tempsv, (IV) *arg4); + } XSRETURN(argvi); fail: (void) _swigerr; @@ -4086,14 +4105,16 @@ XS(_wrap_update_record) { ZebraHandle arg1 ; recordGroup *arg2 ; char *arg3 ; - int arg4 ; + int *arg4 ; char *arg5 ; char *arg6 ; char *arg7 ; int arg8 ; int arg9 ; int result; + int dvalue4 ; int argvi = 0; + SV * _saved[1] ; dXSARGS; if ((items < 9) || (items > 9)) { @@ -4113,7 +4134,18 @@ XS(_wrap_update_record) { } if (!SvOK((SV*) ST(2))) arg3 = 0; else arg3 = (char *) SvPV(ST(2), PL_na); - arg4 = (int) SvIV(ST(3)); + { + SV *tempsv; + if (!SvROK(ST(3))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(3)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue4 = SvIV(tempsv); + arg4 = &dvalue4; + } if (!SvOK((SV*) ST(4))) arg5 = 0; else arg5 = (char *) SvPV(ST(4), PL_na); if (!SvOK((SV*) ST(5))) arg6 = 0; @@ -4122,10 +4154,16 @@ XS(_wrap_update_record) { else arg7 = (char *) SvPV(ST(6), PL_na); arg8 = (int) SvIV(ST(7)); arg9 = (int) SvIV(ST(8)); + _saved[0] = ST(3); result = (int)zebra_update_record(arg1,arg2,(char const *)arg3,arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,arg8,arg9); ST(argvi) = sv_newmortal(); sv_setiv(ST(argvi++), (IV) result); + { + SV *tempsv; + tempsv = SvRV(_saved[0]); + sv_setiv(tempsv, (IV) *arg4); + } XSRETURN(argvi); fail: (void) _swigerr; @@ -4141,14 +4179,16 @@ XS(_wrap_delete_record) { ZebraHandle arg1 ; recordGroup *arg2 ; char *arg3 ; - int arg4 ; + int *arg4 ; char *arg5 ; char *arg6 ; char *arg7 ; int arg8 ; int arg9 ; int result; + int dvalue4 ; int argvi = 0; + SV * _saved[1] ; dXSARGS; if ((items < 9) || (items > 9)) { @@ -4168,7 +4208,18 @@ XS(_wrap_delete_record) { } if (!SvOK((SV*) ST(2))) arg3 = 0; else arg3 = (char *) SvPV(ST(2), PL_na); - arg4 = (int) SvIV(ST(3)); + { + SV *tempsv; + if (!SvROK(ST(3))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(3)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue4 = SvIV(tempsv); + arg4 = &dvalue4; + } if (!SvOK((SV*) ST(4))) arg5 = 0; else arg5 = (char *) SvPV(ST(4), PL_na); if (!SvOK((SV*) ST(5))) arg6 = 0; @@ -4177,10 +4228,16 @@ XS(_wrap_delete_record) { else arg7 = (char *) SvPV(ST(6), PL_na); arg8 = (int) SvIV(ST(7)); arg9 = (int) SvIV(ST(8)); + _saved[0] = ST(3); result = (int)zebra_delete_record(arg1,arg2,(char const *)arg3,arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,arg8,arg9); ST(argvi) = sv_newmortal(); sv_setiv(ST(argvi++), (IV) result); + { + SV *tempsv; + tempsv = SvRV(_saved[0]); + sv_setiv(tempsv, (IV) *arg4); + } XSRETURN(argvi); fail: (void) _swigerr; @@ -4196,12 +4253,15 @@ XS(_wrap_search_PQF) { ZebraHandle arg1 ; char *arg2 ; char *arg3 ; + int *arg4 ; int result; + int dvalue4 ; int argvi = 0; + SV * _saved[1] ; dXSARGS; - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: search_PQF(zh,pqf_query,setname);"); + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: search_PQF(zh,pqf_query,setname,hits);"); } { ZebraHandle * argp; @@ -4214,10 +4274,28 @@ XS(_wrap_search_PQF) { else arg2 = (char *) SvPV(ST(1), PL_na); if (!SvOK((SV*) ST(2))) arg3 = 0; else arg3 = (char *) SvPV(ST(2), PL_na); - result = (int)zebra_search_PQF(arg1,(char const *)arg2,(char const *)arg3); + { + SV *tempsv; + if (!SvROK(ST(3))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(3)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue4 = SvIV(tempsv); + arg4 = &dvalue4; + } + _saved[0] = ST(3); + result = (int)zebra_search_PQF(arg1,(char const *)arg2,(char const *)arg3,arg4); ST(argvi) = sv_newmortal(); sv_setiv(ST(argvi++), (IV) result); + { + SV *tempsv; + tempsv = SvRV(_saved[0]); + sv_setiv(tempsv, (IV) *arg4); + } XSRETURN(argvi); fail: (void) _swigerr; @@ -4552,6 +4630,106 @@ XS(_wrap_deleteResultSet) { } +XS(_wrap_resultSetTerms) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + char *arg2 ; + int arg3 ; + int *arg4 ; + int *arg5 ; + char *arg6 ; + int *arg7 ; + int result; + int dvalue4 ; + int dvalue5 ; + int dvalue7 ; + int argvi = 0; + SV * _saved[3] ; + dXSARGS; + + if ((items < 7) || (items > 7)) { + SWIG_croak("Usage: resultSetTerms(zh,setname,no,REFERENCE,REFERENCE,out,REFERENCE);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of resultSetTerms. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + arg3 = (int) SvIV(ST(2)); + { + SV *tempsv; + if (!SvROK(ST(3))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(3)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue4 = SvIV(tempsv); + arg4 = &dvalue4; + } + { + SV *tempsv; + if (!SvROK(ST(4))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(4)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue5 = SvIV(tempsv); + arg5 = &dvalue5; + } + if (!SvOK((SV*) ST(5))) arg6 = 0; + else arg6 = (char *) SvPV(ST(5), PL_na); + { + SV *tempsv; + if (!SvROK(ST(6))) { + SWIG_croak("expected a reference"); + } + tempsv = SvRV(ST(6)); + if (!SvIOK(tempsv)) { + SWIG_croak("expected a integer reference"); + } + dvalue7 = SvIV(tempsv); + arg7 = &dvalue7; + } + _saved[0] = ST(3); + _saved[1] = ST(4); + _saved[2] = ST(6); + result = (int)zebra_resultSetTerms(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + { + SV *tempsv; + tempsv = SvRV(_saved[0]); + sv_setiv(tempsv, (IV) *arg4); + } + { + SV *tempsv; + tempsv = SvRV(_saved[1]); + sv_setiv(tempsv, (IV) *arg5); + } + { + SV *tempsv; + tempsv = SvRV(_saved[2]); + sv_setiv(tempsv, (IV) *arg7); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + XS(_wrap_sort) { char _swigmsg[SWIG_MAX_ERRMSG] = ""; const char *_swigerr = _swigmsg; @@ -4605,7 +4783,7 @@ XS(_wrap_sort) { } arg5[i] = NULL; } - result = (int)sort(arg1,arg2,(char const *)arg3,(char const *)arg4,(char const **)arg5); + result = (int)zebra_sort_by_specstr(arg1,arg2,(char const *)arg3,(char const *)arg4,(char const **)arg5); ST(argvi) = sv_newmortal(); sv_setiv(ST(argvi++), (IV) result); @@ -5280,11 +5458,9 @@ XS(_wrap_data1_nodetogr) { arg4 = *argp; } { - int i; - if (!SvIOK(ST(4))) - croak("Argument 5 is not an integer."); - i = SvIV(ST(4)); - arg5 = &i; + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_nodetogr. Expected _p_int"); + } } result = (Z_GenericRecord *)data1_nodetogr(arg1,arg2,arg3,arg4,arg5); @@ -5402,11 +5578,9 @@ XS(_wrap_data1_nodetobuf) { } arg3 = (int) SvIV(ST(2)); { - int i; - if (!SvIOK(ST(3))) - croak("Argument 4 is not an integer."); - i = SvIV(ST(3)); - arg4 = &i; + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetobuf. Expected _p_int"); + } } result = (char *)data1_nodetobuf(arg1,arg2,arg3,arg4); @@ -6978,11 +7152,9 @@ XS(_wrap_data1_nodetomarc) { } arg4 = (int) SvIV(ST(3)); { - int i; - if (!SvIOK(ST(4))) - croak("Argument 5 is not an integer."); - i = SvIV(ST(4)); - arg5 = &i; + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_nodetomarc. Expected _p_int"); + } } result = (char *)data1_nodetomarc(arg1,arg2,arg3,arg4,arg5); @@ -7029,11 +7201,9 @@ XS(_wrap_data1_nodetoidsgml) { } arg3 = (int) SvIV(ST(2)); { - int i; - if (!SvIOK(ST(3))) - croak("Argument 4 is not an integer."); - i = SvIV(ST(3)); - arg4 = &i; + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetoidsgml. Expected _p_int"); + } } result = (char *)data1_nodetoidsgml(arg1,arg2,arg3,arg4); @@ -7174,11 +7344,9 @@ XS(_wrap_data1_nodetosoif) { } arg3 = (int) SvIV(ST(2)); { - int i; - if (!SvIOK(ST(3))) - croak("Argument 4 is not an integer."); - i = SvIV(ST(3)); - arg4 = &i; + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetosoif. Expected _p_int"); + } } result = (char *)data1_nodetosoif(arg1,arg2,arg3,arg4); @@ -8564,6 +8732,7 @@ static swig_command_info swig_commands[] = { {"IDZebrac::records_retrieve", _wrap_records_retrieve}, {"IDZebrac::record_retrieve", _wrap_record_retrieve}, {"IDZebrac::deleteResultSet", _wrap_deleteResultSet}, +{"IDZebrac::resultSetTerms", _wrap_resultSetTerms}, {"IDZebrac::sort", _wrap_sort}, {"IDZebrac::scan_PQF", _wrap_scan_PQF}, {"IDZebrac::getScanEntry", _wrap_getScanEntry},