/* * This file was generated automatically by ExtUtils::ParseXS version 2.18 from the * contents of KinoSearch.xs. Do not edit this file, edit KinoSearch.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "lib/KinoSearch.xs" /*********************************************** !!!! DO NOT EDIT THIS FILE !!!! This file was auto-generated by Build.PL from lib/KinoSearch/Util/PriorityQueue.pm See KinoSearch::Docs::DevGuide for details. ***********************************************/ #include "KinoSearchUtilPriorityQueue.h" #include "KinoSearchUtilMathUtils.h" #include "KinoSearchUtilIntMap.h" #include "KinoSearchUtilMemManager.h" #include "KinoSearchUtilSortExternal.h" #include "KinoSearchUtilByteBuf.h" #include "KinoSearchUtilCClass.h" #include "KinoSearchUtilVerifyArgs.h" #include "KinoSearchUtilCarp.h" #include "KinoSearchUtilBitVector.h" #include "KinoSearchUtilStringHelper.h" #include "KinoSearchIndexTermDocs.h" #include "KinoSearchIndexSegWriter.h" #include "KinoSearchIndexTermInfosWriter.h" #include "KinoSearchIndexPostingsWriter.h" #include "KinoSearchIndexSegTermEnum.h" #include "KinoSearchIndexTermInfo.h" #include "KinoSearchIndexTerm.h" #include "KinoSearchIndexDelDocs.h" #include "KinoSearchIndexSegTermDocs.h" #include "KinoSearchIndexTermBuffer.h" #include "KinoSearchIndexMultiTermDocs.h" #include "KinoSearchDocumentField.h" #include "KinoSearchSearchScorer.h" #include "KinoSearchSearchPhraseScorer.h" #include "KinoSearchSearchBooleanScorer.h" #include "KinoSearchSearchTermScorer.h" #include "KinoSearchSearchHitCollector.h" #include "KinoSearchSearchHitQueue.h" #include "KinoSearchSearchSimilarity.h" #include "KinoSearchStoreInStream.h" #include "KinoSearchStoreOutStream.h" #include "KinoSearchAnalysisStopalizer.h" #include "KinoSearchAnalysisToken.h" #include "KinoSearchAnalysisTokenBatch.h" #include "limits.h" #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #define NEED_newRV_noinc_GLOBAL #include "ppport.h" #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(var) if (0) var = var #endif #line 71 "lib/KinoSearch.c" XS(XS_KinoSearch_memory_debugging_enabled); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch_memory_debugging_enabled) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::memory_debugging_enabled", ""); PERL_UNUSED_VAR(cv); /* -W */ { IV RETVAL; dXSTARG; #line 72 "lib/KinoSearch.xs" RETVAL = KINO_MEM_LEAK_DEBUG; #line 89 "lib/KinoSearch.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Analysis__TokenBatch_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::new", "either_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * either_sv = ST(0); #line 83 "lib/KinoSearch.xs" char *class; TokenBatch *batch; #line 114 "lib/KinoSearch.c" #line 86 "lib/KinoSearch.xs" /* determine the class */ class = sv_isobject(either_sv) ? sv_reftype(either_sv, 0) : SvPV_nolen(either_sv); /* build object */ batch = Kino_TokenBatch_new(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)batch); XSRETURN(1); #line 125 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch_append); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_append) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::append", "batch, text_sv, start_offset, end_offset, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; SV * text_sv = ST(1); I32 start_offset = (I32)SvIV(ST(2)); I32 end_offset = (I32)SvIV(ST(3)); #line 103 "lib/KinoSearch.xs" char *text; STRLEN len; I32 pos_inc = 1; Token *token; #line 155 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 108 "lib/KinoSearch.xs" text = SvPV(text_sv, len); if (items == 5) pos_inc = SvIV( ST(4) ); else if (items > 5) Kino_confess("Too many arguments: %d", items); token = Kino_Token_new(text, len, start_offset, end_offset, pos_inc); Kino_TokenBatch_append(batch, token); #line 171 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch_add_many_tokens); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_add_many_tokens) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::add_many_tokens", "batch, string_sv, starts_av, ends_av"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; SV * string_sv = ST(1); AV * starts_av; AV * ends_av; #line 131 "lib/KinoSearch.xs" char *string_start; STRLEN len, start_offset, end_offset; I32 i, max; SV **start_sv_ptr; SV **end_sv_ptr; Token *token; #line 203 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); if (SvROK(ST(2)) && SvTYPE(SvRV(ST(2)))==SVt_PVAV) starts_av = (AV*)SvRV(ST(2)); else Perl_croak(aTHX_ "starts_av is not an array reference"); if (SvROK(ST(3)) && SvTYPE(SvRV(ST(3)))==SVt_PVAV) ends_av = (AV*)SvRV(ST(3)); else Perl_croak(aTHX_ "ends_av is not an array reference"); #line 138 "lib/KinoSearch.xs" { string_start = SvPV(string_sv, len); max = av_len(starts_av); for (i = 0; i <= max; i++) { /* retrieve start */ start_sv_ptr = av_fetch(starts_av, i, 0); if (start_sv_ptr == NULL) Kino_confess("Failed to retrieve @starts array element"); start_offset = SvIV(*start_sv_ptr); /* retrieve end */ end_sv_ptr = av_fetch(ends_av, i, 0); if (end_sv_ptr == NULL) Kino_confess("Failed to retrieve @ends array element"); end_offset = SvIV(*end_sv_ptr); /* sanity check the offsets to make sure they're inside the string */ if (start_offset > len) Kino_confess("start_offset > len (%d > %"UVuf")", start_offset, (UV)len); if (end_offset > len) Kino_confess("end_offset > len (%d > %"UVuf")", end_offset, (UV)len); /* calculate the start of the substring and add the token */ token = Kino_Token_new( (string_start + start_offset), (end_offset - start_offset), start_offset, end_offset, 1 ); Kino_TokenBatch_append(batch, token); } } #line 257 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch_build_posting_list); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_build_posting_list) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::build_posting_list", "batch, doc_num, field_num"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; U32 doc_num = (unsigned long)SvUV(ST(1)); U16 field_num = (unsigned short)SvUV(ST(2)); if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 200 "lib/KinoSearch.xs" Kino_TokenBatch_build_plist(batch, doc_num, field_num); #line 289 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch_set_all_texts); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_set_all_texts) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::set_all_texts", "batch, texts_av"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; AV * texts_av; #line 207 "lib/KinoSearch.xs" Token *token; I32 i, max; SV **sv_ptr; char *text; STRLEN len; #line 318 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); if (SvROK(ST(1)) && SvTYPE(SvRV(ST(1)))==SVt_PVAV) texts_av = (AV*)SvRV(ST(1)); else Perl_croak(aTHX_ "texts_av is not an array reference"); #line 213 "lib/KinoSearch.xs" { token = batch->first; max = av_len(texts_av); for (i = 0; i <= max; i++) { if (token == NULL) { Kino_confess("Batch size %d doesn't match array size %d", batch->size, (max + 1)); } sv_ptr = av_fetch(texts_av, i, 0); if (sv_ptr == NULL) { Kino_confess("Encountered a null SV* pointer"); } text = SvPV(*sv_ptr, len); Kino_Safefree(token->text); token->text = Kino_savepvn(text, len); token->len = len; token = token->next; } } #line 350 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch_get_all_texts); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_get_all_texts) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::get_all_texts", "batch"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; #line 237 "lib/KinoSearch.xs" Token *token; AV *out_av; #line 375 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 240 "lib/KinoSearch.xs" { out_av = newAV(); token = batch->first; while (token != NULL) { SV *text = newSVpvn(token->text, token->len); av_push(out_av, text); token = token->next; } XPUSHs(sv_2mortal( newRV_noinc((SV*)out_av) )); XSRETURN(1); } #line 394 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "batch, ..."); PERL_UNUSED_VAR(cv); /* -W */ { TokenBatch * batch; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 272 "lib/KinoSearch.xs" { /* fail if looking for info on a single token but there isn't one */ if ((ix < 7) && (batch->current == NULL)) Kino_confess("TokenBatch doesn't currently hold a valid token"); KINO_START_SET_OR_GET_SWITCH case 1: { Token *current = batch->current; char *text; Kino_Safefree(current->text); text = SvPV( ST(1), current->len ); current->text = Kino_savepvn( text, current->len ); } /* fall through */ case 2: RETVAL = newSVpvn(batch->current->text, batch->current->len); break; case 3: batch->current->start_offset = SvIV( ST(1) ); /* fall through */ case 4: RETVAL = newSViv(batch->current->start_offset); break; case 5: batch->current->end_offset = SvIV( ST(1) ); /* fall through */ case 6: RETVAL = newSViv(batch->current->end_offset); break; case 7: batch->current->pos_inc = SvIV( ST(1) ); /* fall through */ case 8: RETVAL = newSViv(batch->current->pos_inc); break; case 9: Kino_confess("Can't set size on a TokenBatch object"); /* fall through */ case 10: RETVAL = newSVuv(batch->size); break; case 11: Kino_confess("can't set_postings"); /* fall through */ case 12: RETVAL = newRV_inc( (SV*)batch->postings ); break; case 13: Kino_confess("can't set_tv_string"); /* fall through */ case 14: RETVAL = newSVsv(batch->tv_string); break; KINO_END_SET_OR_GET_SWITCH } #line 473 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Analysis__TokenBatch_reset); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_reset) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::reset", "batch"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 328 "lib/KinoSearch.xs" Kino_TokenBatch_reset(batch); #line 504 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__TokenBatch_next); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_next) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::next", "batch"); PERL_UNUSED_VAR(cv); /* -W */ { TokenBatch * batch; I32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 334 "lib/KinoSearch.xs" RETVAL = Kino_TokenBatch_next(batch); #line 534 "lib/KinoSearch.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Analysis__TokenBatch_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__TokenBatch_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::TokenBatch::DESTROY", "batch"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TokenBatch * batch; if (sv_derived_from(ST(0), "KinoSearch::Analysis::TokenBatch")) { batch = INT2PTR(TokenBatch *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "batch is not of type KinoSearch::Analysis::TokenBatch"); #line 341 "lib/KinoSearch.xs" Kino_TokenBatch_destroy(batch); #line 564 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Analysis__Stopalizer_analyze); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Analysis__Stopalizer_analyze) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Analysis::Stopalizer::analyze", "self_hash, batch_sv"); PERL_UNUSED_VAR(cv); /* -W */ { HV * self_hash; SV * batch_sv = ST(1); #line 352 "lib/KinoSearch.xs" TokenBatch *batch; #line 587 "lib/KinoSearch.c" SV * RETVAL; if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0)))==SVt_PVHV) self_hash = (HV*)SvRV(ST(0)); else Perl_croak(aTHX_ "self_hash is not a hash reference"); #line 354 "lib/KinoSearch.xs" Kino_extract_struct( batch_sv, batch, TokenBatch*, "KinoSearch::Analysis::TokenBatch"); Kino_Stopalizer_analyze(self_hash, batch); SvREFCNT_inc(batch_sv); RETVAL = batch_sv; #line 600 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Store__OutStream_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::new", "class, fh_sv"); PERL_UNUSED_VAR(cv); /* -W */ { char * class = (char *)SvPV_nolen(ST(0)); SV * fh_sv = ST(1); OutStream * RETVAL; #line 374 "lib/KinoSearch.xs" RETVAL = Kino_OutStream_new(class, fh_sv); #line 625 "lib/KinoSearch.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "KinoSearch::Store::OutStream", (void*)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Store__OutStream_seek); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_seek) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::seek", "outstream, target"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { OutStream * outstream; double target = (double)SvNV(ST(1)); if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 382 "lib/KinoSearch.xs" outstream->seek(outstream, target); #line 658 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__OutStream_tell); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_tell) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::tell", "outstream"); PERL_UNUSED_VAR(cv); /* -W */ { OutStream * outstream; double RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 388 "lib/KinoSearch.xs" RETVAL = outstream->tell(outstream); #line 688 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Store__OutStream_length); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_length) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::length", "outstream"); PERL_UNUSED_VAR(cv); /* -W */ { OutStream * outstream; double RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 395 "lib/KinoSearch.xs" RETVAL = Kino_OutStream_length(outstream); #line 718 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Store__OutStream_flush); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_flush) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::flush", "outstream"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { OutStream * outstream; if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 402 "lib/KinoSearch.xs" Kino_OutStream_flush(outstream); #line 748 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__OutStream_absorb); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_absorb) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::absorb", "outstream, instream"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { OutStream * outstream; InStream * instream; if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); if (sv_derived_from(ST(1), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(1))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 414 "lib/KinoSearch.xs" Kino_OutStream_absorb(outstream, instream); #line 785 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__OutStream__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "outstream, ..."); PERL_UNUSED_VAR(cv); /* -W */ { OutStream * outstream; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 423 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: Kino_confess("Can't set_fh"); /* fall through */ case 2: RETVAL = newSVsv(outstream->fh_sv); break; KINO_END_SET_OR_GET_SWITCH } #line 824 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Store__OutStream_lu_write); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_lu_write) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::lu_write", "outstream, template_sv, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { OutStream * outstream; SV * template_sv = ST(1); #line 451 "lib/KinoSearch.xs" STRLEN tpt_len; /* bytelength of template */ char *template; /* ptr to a spot in the template */ char *tpt_end; /* ptr to the end of the template */ int repeat_count; /* number of times to repeat sym */ int item_count; /* current place in @_ */ char sym; /* the current symbol in the template */ char countsym; /* used when calculating repeat counts */ I32 aI32; U32 aU32; double aDouble; SV *aSV; char *string; STRLEN string_len; #line 862 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 465 "lib/KinoSearch.xs" { /* require an object, a template, and at least 1 item */ if (items < 2) { Kino_confess("lu_write error: too few arguments"); } /* prepare the template and get pointers */ template = SvPV(template_sv, tpt_len); tpt_end = template + tpt_len; /* reject an empty template */ if (tpt_len == 0) { Kino_confess("lu_write error: TEMPLATE cannot be empty string"); } /* init counters */ repeat_count = 0; item_count = 2; while (1) { /* only process template if we're not in the midst of a repeat */ if (repeat_count == 0) { /* fast-forward past space characters */ while (*template == ' ' && template < tpt_end) { template++; } /* if we're done, return or throw error */ if (template == tpt_end || item_count == items) { if (item_count != items) { Kino_confess( "lu_write error: Too many ITEMS, not enough TEMPLATE"); } else if (template != tpt_end) { Kino_confess( "lu_write error: Too much TEMPLATE, not enough ITEMS"); } else { /* success! */ break; } } /* derive the current symbol and a possible digit repeat sym */ sym = *template++; countsym = *template; if (template == tpt_end) { /* sym is last char in template */ repeat_count = 1; } else if (countsym >= '0' && countsym <= '9') { /* calculate numerical repeat count */ repeat_count = countsym - KINO_NUM_CHAR_OFFSET; countsym = *(++template); while ( template <= tpt_end && countsym >= '0' && countsym <= '9' ) { repeat_count = (repeat_count * 10) + (countsym - KINO_NUM_CHAR_OFFSET); countsym = *(++template); } } else { /* no numeric repeat count, so process sym only once */ repeat_count = 1; } } switch(sym) { case 'a': /* arbitrary binary data */ aSV = ST(item_count); if (!SvOK(aSV)) { Kino_confess("Internal error: undef at lu_write 'a'"); } string = SvPV(aSV, string_len); if (repeat_count != string_len) { Kino_confess( "lu_write error: repeat_count != string_len: %d %d", repeat_count, string_len); } Kino_OutStream_write_bytes(outstream, string, string_len); /* trigger next sym */ repeat_count = 1; break; case 'b': /* signed byte */ case 'B': /* unsigned byte */ aI32 = SvIV( ST(item_count) ); Kino_OutStream_write_byte(outstream, (char)(aI32 & 0xff)); break; case 'i': /* signed 32-bit integer */ aI32 = SvIV( ST(item_count) ); Kino_OutStream_write_int(outstream, (U32)aI32); break; case 'I': /* unsigned 32-bit integer */ aU32 = SvUV( ST(item_count) ); Kino_OutStream_write_int(outstream, aU32); break; case 'Q': /* unsigned "64-bit" integer */ aDouble = SvNV( ST(item_count) ); Kino_OutStream_write_long(outstream, aDouble); break; case 'V': /* VInt */ aU32 = SvUV( ST(item_count) ); Kino_OutStream_write_vint(outstream, aU32); break; case 'W': /* VLong */ aDouble = SvNV( ST(item_count) ); Kino_OutStream_write_vlong(outstream, aDouble); break; case 'T': /* string */ aSV = ST(item_count); string = SvPV(aSV, string_len); Kino_OutStream_write_string(outstream, string, string_len); break; default: Kino_confess("Illegal character in template: %c", sym); } /* use up one repeat_count and one item from the stack */ repeat_count--; item_count++; } } #line 1003 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__OutStream_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__OutStream_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::OutStream::DESTROY", "outstream"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { OutStream * outstream; if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 603 "lib/KinoSearch.xs" Kino_OutStream_destroy(outstream); #line 1033 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__InStream_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::InStream::new", "class, fh_sv, ..."); PERL_UNUSED_VAR(cv); /* -W */ { char * class = (char *)SvPV_nolen(ST(0)); SV * fh_sv = ST(1); #line 633 "lib/KinoSearch.xs" double offset = 0; double len = -1; #line 1057 "lib/KinoSearch.c" InStream * RETVAL; #line 636 "lib/KinoSearch.xs" if (items > 2) { SV* offset_sv; offset_sv = ST(2); if (SvOK(offset_sv)) offset = SvNV(offset_sv); } if (items > 3) { SV *len_sv; len_sv = ST(3); if (SvOK(len_sv)) len = SvNV(len_sv); } RETVAL = Kino_InStream_new(class, fh_sv, offset, len); #line 1073 "lib/KinoSearch.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "KinoSearch::Store::InStream", (void*)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Store__InStream_seek); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream_seek) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::InStream::seek", "instream, target"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { InStream * instream; double target = (double)SvNV(ST(1)); if (sv_derived_from(ST(0), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 662 "lib/KinoSearch.xs" instream->seek(instream, target); #line 1106 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__InStream_tell); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream_tell) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::InStream::tell", "instream"); PERL_UNUSED_VAR(cv); /* -W */ { InStream * instream; double RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 673 "lib/KinoSearch.xs" RETVAL = instream->tell(instream); #line 1136 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Store__InStream_length); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream_length) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::InStream::length", "instream"); PERL_UNUSED_VAR(cv); /* -W */ { InStream * instream; double RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 685 "lib/KinoSearch.xs" RETVAL = instream->len; #line 1166 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Store__InStream__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "instream, ..."); PERL_UNUSED_VAR(cv); /* -W */ { InStream * instream; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 708 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: instream->len = SvNV( ST(1) ); /* fall through */ case 2: RETVAL = newSVnv(instream->len); break; case 3: instream->offset = SvNV( ST(1) ); /* fall through */ case 4: RETVAL = newSVnv(instream->offset); break; case 5: Kino_confess("Can't set_fh"); /* fall through */ case 6: RETVAL = newSVsv(instream->fh_sv); break; KINO_END_SET_OR_GET_SWITCH } #line 1215 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Store__InStream_lu_read); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream_lu_read) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::InStream::lu_read", "instream, template_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { InStream * instream; SV * template_sv = ST(1); #line 736 "lib/KinoSearch.xs" STRLEN tpt_len; /* bytelength of template */ char *template; /* ptr to a spot in the template */ char *tpt_end; /* ptr to the end of the template */ int repeat_count; /* number of times to repeat sym */ char sym; /* the current symbol in the template */ char countsym; /* used when calculating repeat counts */ IV aIV; SV *aSV; char aChar; char* string; STRLEN len; #line 1251 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 748 "lib/KinoSearch.xs" { /* prepare template string pointers */ template = SvPV(template_sv, tpt_len); tpt_end = SvEND(template_sv); repeat_count = 0; while (1) { if (repeat_count == 0) { /* fast-forward past space characters */ while (*template == ' ' && template < tpt_end) { template++; } /* break out of the loop if we've exhausted the template */ if (template == tpt_end) { break; } /* derive the current symbol and a possible digit repeat sym */ sym = *template++; countsym = *template; if (template == tpt_end) { /* sym is last char in template, so process once */ repeat_count = 1; } else if (countsym >= '0' && countsym <= '9') { /* calculate numerical repeat count */ repeat_count = countsym - KINO_NUM_CHAR_OFFSET; countsym = *(++template); while ( template <= tpt_end && countsym >= '0' && countsym <= '9' ) { repeat_count = (repeat_count * 10) + (countsym - KINO_NUM_CHAR_OFFSET); countsym = *(++template); } } else { /* no numeric repeat count, so process sym only once */ repeat_count = 1; } } /* thwart potential infinite loop */ if (repeat_count < 1) Kino_confess( "invalid repeat_count: %d", repeat_count); switch(sym) { case 'a': /* arbitrary binary data */ len = repeat_count; repeat_count = 1; aSV = newSV(len + 1); SvCUR_set(aSV, len); SvPOK_on(aSV); string = SvPVX(aSV); instream->read_bytes(instream, string, len); break; case 'b': /* signed byte */ case 'B': /* unsigned byte */ aChar = instream->read_byte(instream); if (sym == 'b') aIV = aChar; else aIV = (unsigned char)aChar; aSV = newSViv(aIV); break; case 'i': /* signed 32-bit integer */ aSV = newSViv( (I32)instream->read_int(instream) ); break; case 'I': /* unsigned 32-bit integer */ aSV = newSVuv( instream->read_int(instream) ); break; case 'Q': /* unsigned "64-bit integer" */ aSV = newSVnv( instream->read_long(instream) ); break; case 'T': /* string */ len = instream->read_vint(instream); aSV = newSV(len + 1); SvCUR_set(aSV, len); SvPOK_on(aSV); string = SvPVX(aSV); instream->read_chars(instream, string, 0, len); break; case 'V': /* VInt */ aSV = newSVuv( instream->read_vint(instream) ); break; case 'W': /* VLong */ aSV = newSVnv( instream->read_vlong(instream) ); break; default: aSV = NULL; /* suppress unused var compiler warning */ Kino_confess("Invalid type in template: '%c'", sym); } /* Put a scalar on the stack, use up one symbol or repeater */ XPUSHs( sv_2mortal(aSV) ); repeat_count -= 1; } } #line 1368 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Store__InStream_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Store__InStream_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Store::InStream::DESTROY", "instream"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { InStream * instream; if (sv_derived_from(ST(0), "KinoSearch::Store::InStream")) { instream = INT2PTR(InStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "instream is not of type KinoSearch::Store::InStream"); #line 862 "lib/KinoSearch.xs" Kino_InStream_destroy(instream); #line 1398 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Similarity_STORABLE_thaw); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_STORABLE_thaw) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::STORABLE_thaw", "blank_obj, cloning, serialized"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * blank_obj = ST(0); SV * cloning = ST(1); SV * serialized = ST(2); #line 882 "lib/KinoSearch.xs" { Similarity *sim = Kino_Sim_new(); SV *deep_obj = SvRV(blank_obj); sv_setiv(deep_obj, PTR2IV(sim)); } #line 1428 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Similarity_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::new", "either_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * either_sv = ST(0); #line 892 "lib/KinoSearch.xs" char *class; Similarity *sim; #line 1453 "lib/KinoSearch.c" #line 895 "lib/KinoSearch.xs" /* determine the class */ class = sv_isobject(either_sv) ? sv_reftype(either_sv, 0) : SvPV_nolen(either_sv); /* build object */ sim = Kino_Sim_new(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)sim); XSRETURN(1); #line 1465 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Similarity_lengthnorm); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_lengthnorm) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::lengthnorm", "sim, num_terms"); PERL_UNUSED_VAR(cv); /* -W */ { Similarity * sim; U32 num_terms = (unsigned long)SvUV(ST(1)); float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 918 "lib/KinoSearch.xs" num_terms = num_terms < 100 ? 100 : num_terms; RETVAL = (float)1 / sqrt(num_terms); #line 1497 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Search__Similarity_tf); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_tf) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::tf", "sim, freq"); PERL_UNUSED_VAR(cv); /* -W */ { Similarity * sim; U32 freq = (unsigned long)SvUV(ST(1)); float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 936 "lib/KinoSearch.xs" RETVAL = sim->tf(sim, freq); #line 1528 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Search__Similarity__float_to_byte); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity__float_to_byte) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::_float_to_byte", "sim, f"); PERL_UNUSED_VAR(cv); /* -W */ { Similarity * sim; float f = (float)SvNV(ST(1)); #line 954 "lib/KinoSearch.xs" char b; #line 1551 "lib/KinoSearch.c" SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 956 "lib/KinoSearch.xs" b = Kino_Sim_float2byte(sim, f); RETVAL = newSVpv(&b, 1); #line 1562 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__Similarity__byte_to_float); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity__byte_to_float) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::_byte_to_float", "sim, b"); PERL_UNUSED_VAR(cv); /* -W */ { Similarity * sim; char b = (char)*SvPV_nolen(ST(1)); float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 965 "lib/KinoSearch.xs" RETVAL = Kino_Sim_byte2float(sim, b); #line 1594 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Search__Similarity_get_norm_decoder); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_get_norm_decoder) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::get_norm_decoder", "sim"); PERL_UNUSED_VAR(cv); /* -W */ { Similarity * sim; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 981 "lib/KinoSearch.xs" RETVAL = newSVpv( (char*)sim->norm_decoder, (256 * sizeof(float)) ); #line 1623 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__Similarity_coord); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_coord) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::coord", "sim, overlap, max_overlap"); PERL_UNUSED_VAR(cv); /* -W */ { Similarity * sim; U32 overlap = (unsigned long)SvUV(ST(1)); U32 max_overlap = (unsigned long)SvUV(ST(2)); float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 990 "lib/KinoSearch.xs" RETVAL = sim->coord(sim, overlap, max_overlap); #line 1656 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Search__Similarity__use_title_tf); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity__use_title_tf) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::_use_title_tf", "sim"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Similarity * sim; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 997 "lib/KinoSearch.xs" sim->tf = Kino_Sim_title_tf; #line 1686 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Similarity_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Similarity_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Similarity::DESTROY", "sim"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Similarity * sim; if (sv_derived_from(ST(0), "KinoSearch::Search::Similarity")) { sim = INT2PTR(Similarity *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sim is not of type KinoSearch::Search::Similarity"); #line 1003 "lib/KinoSearch.xs" Kino_Sim_destroy(sim); #line 1716 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__HitQueue_define_less_than); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__HitQueue_define_less_than) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::HitQueue::define_less_than", "hitq"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { PriorityQueue * hitq; if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { hitq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hitq is not of type KinoSearch::Util::PriorityQueue"); #line 1013 "lib/KinoSearch.xs" hitq->less_than = &Kino_HitQ_less_than; #line 1746 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__HitCollector_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__HitCollector_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::HitCollector::new", "either_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * either_sv = ST(0); #line 1022 "lib/KinoSearch.xs" char *class; HitCollector *hc; #line 1771 "lib/KinoSearch.c" #line 1025 "lib/KinoSearch.xs" hc = Kino_HC_new(); class = sv_isobject(either_sv) ? sv_reftype(either_sv, 0) : SvPV_nolen(either_sv); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)hc); XSRETURN(1); #line 1780 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__HitCollector_collect); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__HitCollector_collect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::HitCollector::collect", "hc, doc_num, score"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { HitCollector * hc; U32 doc_num = (unsigned long)SvUV(ST(1)); float score = (float)SvNV(ST(2)); if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1049 "lib/KinoSearch.xs" hc->collect(hc, doc_num, score); #line 1812 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__HitCollector__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__HitCollector__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "hc, ..."); PERL_UNUSED_VAR(cv); /* -W */ { HitCollector * hc; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1064 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: SvREFCNT_dec(hc->storage_ref); hc->storage_ref = newSVsv( ST(1) ); Kino_extract_anon_struct(hc->storage_ref, hc->storage); /* fall through */ case 2: RETVAL = newSVsv(hc->storage_ref); break; case 3: hc->i = SvUV( ST(1) ); /* fall through */ case 4: RETVAL = newSVuv(hc->i); break; case 5: hc->f = SvNV( ST(1) ); /* fall through */ case 6: RETVAL = newSVnv(hc->f); break; case 7: SvREFCNT_dec(hc->filter_bits_ref); hc->filter_bits_ref = newSVsv( ST(1) ); Kino_extract_struct( hc->filter_bits_ref, hc->filter_bits, BitVector*, "KinoSearch::Util::BitVector" ); /* fall through */ case 8: RETVAL = newSVsv(hc->filter_bits_ref); break; KINO_END_SET_OR_GET_SWITCH } #line 1871 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__HitCollector_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__HitCollector_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::HitCollector::DESTROY", "hc"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { HitCollector * hc; if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1100 "lib/KinoSearch.xs" Kino_HC_destroy(hc); #line 1902 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__HitQueueCollector__define_collect); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__HitQueueCollector__define_collect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::HitQueueCollector::_define_collect", "hc"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { HitCollector * hc; if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1109 "lib/KinoSearch.xs" hc->collect = Kino_HC_collect_HitQueue; #line 1932 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__BitCollector__define_collect); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__BitCollector__define_collect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::BitCollector::_define_collect", "hc"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { HitCollector * hc; if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1117 "lib/KinoSearch.xs" hc->collect = Kino_HC_collect_BitVec; #line 1962 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__FilteredCollector__define_collect); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__FilteredCollector__define_collect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::FilteredCollector::_define_collect", "hc"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { HitCollector * hc; if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1125 "lib/KinoSearch.xs" hc->collect = Kino_HC_collect_filtered; #line 1992 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__OffsetCollector__define_collect); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__OffsetCollector__define_collect) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::OffsetCollector::_define_collect", "hc"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { HitCollector * hc; if (sv_derived_from(ST(0), "KinoSearch::Search::HitCollector")) { hc = INT2PTR(HitCollector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "hc is not of type KinoSearch::Search::HitCollector"); #line 1133 "lib/KinoSearch.xs" hc->collect = Kino_HC_collect_offset; #line 2022 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__TermScorer__init_child); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__TermScorer__init_child) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::TermScorer::_init_child", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1144 "lib/KinoSearch.xs" Kino_TermScorer_init_child(scorer); #line 2052 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__TermScorer__fill_score_cache); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__TermScorer__fill_score_cache) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::TermScorer::_fill_score_cache", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer* scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1157 "lib/KinoSearch.xs" Kino_TermScorer_fill_score_cache(scorer); #line 2082 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__TermScorer_score_batch); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__TermScorer_score_batch) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::TermScorer::score_batch", "scorer, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; #line 1163 "lib/KinoSearch.xs" HV *args_hash; U32 start, end; HitCollector *hc; #line 2108 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1167 "lib/KinoSearch.xs" /* process hash-style params */ Kino_Verify_build_args_hash(args_hash, "KinoSearch::Search::TermScorer::score_batch_args", 1); Kino_extract_struct_from_hv(args_hash, hc, "hit_collector", 13, HitCollector*, "KinoSearch::Search::HitCollector"); start = (U32)SvUV( Kino_Verify_extract_arg(args_hash, "start", 5) ); end = (U32)SvUV( Kino_Verify_extract_arg(args_hash, "end", 3) ); Kino_TermScorer_score_batch(scorer, start, end, hc); #line 2125 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "scorer, ..."); PERL_UNUSED_VAR(cv); /* -W */ { Scorer * scorer; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1190 "lib/KinoSearch.xs" { TermScorerChild *child = (TermScorerChild*)scorer->child; KINO_START_SET_OR_GET_SWITCH case 1: SvREFCNT_dec(child->term_docs_sv); child->term_docs_sv = newSVsv( ST(1) ); Kino_extract_struct( child->term_docs_sv, child->term_docs, TermDocs*, "KinoSearch::Index::TermDocs"); /* fall through */ case 2: RETVAL = newSVsv(child->term_docs_sv); break; case 3: SvREFCNT_dec(child->weight_sv); if (!sv_derived_from( ST(1), "KinoSearch::Search::Weight")) Kino_confess("not a KinoSearch::Search::Weight"); child->weight_sv = newSVsv( ST(1) ); /* fall through */ case 4: RETVAL = newSVsv(child->weight_sv); break; case 5: child->weight_value = SvNV( ST(1) ); /* fall through */ case 6: RETVAL = newSVnv(child->weight_value); break; case 7: SvREFCNT_dec(child->norms_sv); child->norms_sv = newSVsv( ST(1) ); { SV* bytes_deref_sv; bytes_deref_sv = SvRV(child->norms_sv); if (SvPOK(bytes_deref_sv)) { child->norms = (unsigned char*)SvPVX(bytes_deref_sv); } else { child->norms = NULL; } } /* fall through */ case 8: RETVAL = newSVsv(child->norms_sv); break; KINO_END_SET_OR_GET_SWITCH } #line 2198 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__TermScorer_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__TermScorer_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::TermScorer::DESTROY", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1240 "lib/KinoSearch.xs" Kino_TermScorer_destroy(scorer); #line 2229 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__BooleanScorer__init_child); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__BooleanScorer__init_child) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::BooleanScorer::_init_child", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1249 "lib/KinoSearch.xs" Kino_BoolScorer_init_child(scorer); #line 2259 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__BooleanScorer_add_subscorer); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__BooleanScorer_add_subscorer) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::BooleanScorer::add_subscorer", "scorer, subscorer_sv, occur"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; SV * subscorer_sv = ST(1); char * occur = (char *)SvPV_nolen(ST(2)); #line 1262 "lib/KinoSearch.xs" BoolScorerChild* child; Scorer *subscorer; SV *subscorer_sv_copy; #line 2287 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1266 "lib/KinoSearch.xs" child = (BoolScorerChild*)scorer->child; Kino_extract_struct(subscorer_sv, subscorer, Scorer*, "KinoSearch::Search::Scorer"); subscorer_sv_copy = newSVsv(subscorer_sv); av_push(child->subscorers_av, subscorer_sv_copy); Kino_BoolScorer_add_subscorer(scorer, subscorer, occur); #line 2301 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__BooleanScorer__boolean_scorer_set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__BooleanScorer__boolean_scorer_set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "scorer, ..."); PERL_UNUSED_VAR(cv); /* -W */ { Scorer* scorer; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1279 "lib/KinoSearch.xs" { BoolScorerChild* child = (BoolScorerChild*)scorer->child; KINO_START_SET_OR_GET_SWITCH case 2: RETVAL = newRV((SV*)child->subscorers_av); break; KINO_END_SET_OR_GET_SWITCH } #line 2340 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__BooleanScorer_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__BooleanScorer_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::BooleanScorer::DESTROY", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1295 "lib/KinoSearch.xs" Kino_BoolScorer_destroy(scorer); #line 2371 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__PhraseScorer__init_child); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__PhraseScorer__init_child) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::PhraseScorer::_init_child", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1304 "lib/KinoSearch.xs" Kino_PhraseScorer_init_child(scorer); #line 2401 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__PhraseScorer__init_elements); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__PhraseScorer__init_elements) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::PhraseScorer::_init_elements", "scorer, term_docs_av, phrase_offsets_av"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; AV * term_docs_av; AV * phrase_offsets_av; #line 1312 "lib/KinoSearch.xs" PhraseScorerChild *child; I32 i; SV **sv_ptr; IV tmp; #line 2430 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); if (SvROK(ST(1)) && SvTYPE(SvRV(ST(1)))==SVt_PVAV) term_docs_av = (AV*)SvRV(ST(1)); else Perl_croak(aTHX_ "term_docs_av is not an array reference"); if (SvROK(ST(2)) && SvTYPE(SvRV(ST(2)))==SVt_PVAV) phrase_offsets_av = (AV*)SvRV(ST(2)); else Perl_croak(aTHX_ "phrase_offsets_av is not an array reference"); #line 1317 "lib/KinoSearch.xs" { child = (PhraseScorerChild*)scorer->child; SvREFCNT_inc(term_docs_av); SvREFCNT_dec(child->term_docs_av); child->term_docs_av = term_docs_av; child->num_elements = av_len(term_docs_av) + 1; Kino_New(0, child->term_docs, child->num_elements, TermDocs*); Kino_New(0, child->phrase_offsets, child->num_elements, U32); /* create an array of TermDocs* */ for(i = 0; i < child->num_elements; i++) { sv_ptr = av_fetch(term_docs_av, i, 0); tmp = SvIV((SV*)SvRV( *sv_ptr )); child->term_docs[i] = INT2PTR(TermDocs*, tmp); sv_ptr = av_fetch(phrase_offsets_av, i, 0); child->phrase_offsets[i] = SvIV( *sv_ptr ); } } #line 2468 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "scorer, ..."); PERL_UNUSED_VAR(cv); /* -W */ { Scorer * scorer; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1349 "lib/KinoSearch.xs" { PhraseScorerChild *child = (PhraseScorerChild*)scorer->child; KINO_START_SET_OR_GET_SWITCH case 1: child->slop = SvIV( ST(1) ); /* fall through */ case 2: RETVAL = newSViv(child->slop); break; case 3: child->weight_value = SvNV( ST(1) ); /* fall through */ case 4: RETVAL = newSVnv(child->weight_value); break; case 5: SvREFCNT_dec(child->norms_sv); child->norms_sv = newSVsv( ST(1) ); { SV* bytes_deref_sv; bytes_deref_sv = SvRV(child->norms_sv); if (SvPOK(bytes_deref_sv)) { child->norms = (unsigned char*)SvPVX(bytes_deref_sv); } else { child->norms = NULL; } } /* fall through */ case 6: RETVAL = newSVsv(child->norms_sv); break; KINO_END_SET_OR_GET_SWITCH } #line 2530 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__PhraseScorer_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__PhraseScorer_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::PhraseScorer::DESTROY", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1388 "lib/KinoSearch.xs" Kino_PhraseScorer_destroy(scorer); #line 2561 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Scorer__construct_parent); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer__construct_parent) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Scorer::_construct_parent", "class"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { char * class = (char *)SvPV_nolen(ST(0)); #line 1397 "lib/KinoSearch.xs" Scorer *scorer; #line 2585 "lib/KinoSearch.c" #line 1399 "lib/KinoSearch.xs" scorer = Kino_Scorer_new(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)scorer); XSRETURN(1); #line 2591 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Scorer__scorer_set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer__scorer_set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "scorer, ..."); PERL_UNUSED_VAR(cv); /* -W */ { Scorer * scorer; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1411 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: SvREFCNT_dec(scorer->similarity_sv); scorer->similarity_sv = newSVsv( ST(1) ); Kino_extract_struct( scorer->similarity_sv, scorer->sim, Similarity*, "KinoSearch::Search::Similarity" ); /* fall through */ case 2: RETVAL = newSVsv(scorer->similarity_sv); break; KINO_END_SET_OR_GET_SWITCH } #line 2633 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__Scorer_score); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer_score) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Scorer::score", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ { Scorer* scorer; float RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1440 "lib/KinoSearch.xs" RETVAL = scorer->score(scorer); #line 2664 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Search__Scorer_next); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer_next) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Scorer::next", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ { Scorer* scorer; bool RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1458 "lib/KinoSearch.xs" RETVAL = scorer->next(scorer); #line 2693 "lib/KinoSearch.c" ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__Scorer_score_batch); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer_score_batch) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Scorer::score_batch", "scorer, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; #line 1482 "lib/KinoSearch.xs" HV *args_hash; U32 start, end; HitCollector *hc; #line 2720 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1486 "lib/KinoSearch.xs" /* process hash-style params */ Kino_Verify_build_args_hash(args_hash, "KinoSearch::Search::Scorer::score_batch_args", 1); Kino_extract_struct_from_hv(args_hash, hc, "hit_collector", 13, HitCollector*, "KinoSearch::Search::HitCollector"); start = (U32)SvUV( Kino_Verify_extract_arg(args_hash, "start", 5) ); end = (U32)SvUV( Kino_Verify_extract_arg(args_hash, "end", 3) ); /* execute scoring loop */ while (scorer->next(scorer)) { hc->collect( hc, scorer->doc(scorer), scorer->score(scorer) ); } #line 2740 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Search__Scorer_skip_to); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer_skip_to) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Scorer::skip_to", "scorer, target_doc_num"); PERL_UNUSED_VAR(cv); /* -W */ { Scorer* scorer; U32 target_doc_num = (unsigned long)SvUV(ST(1)); bool RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1512 "lib/KinoSearch.xs" RETVAL = scorer->skip_to(scorer, target_doc_num); #line 2770 "lib/KinoSearch.c" ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Search__Scorer_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Search__Scorer_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Search::Scorer::DESTROY", "scorer"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Scorer * scorer; if (sv_derived_from(ST(0), "KinoSearch::Search::Scorer")) { scorer = INT2PTR(Scorer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "scorer is not of type KinoSearch::Search::Scorer"); #line 1520 "lib/KinoSearch.xs" Kino_Scorer_destroy(scorer); #line 2801 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Document__Field__extract_tv_cache); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Document__Field__extract_tv_cache) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Document::Field::_extract_tv_cache", "tv_string_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * tv_string_sv = ST(0); #line 1537 "lib/KinoSearch.xs" HV *tv_cache_hv; #line 2825 "lib/KinoSearch.c" #line 1539 "lib/KinoSearch.xs" tv_cache_hv = Kino_Field_extract_tv_cache(tv_string_sv); XPUSHs( sv_2mortal( newRV_noinc( (SV*)tv_cache_hv ) ) ); XSRETURN(1); #line 2830 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Document__Field__unpack_posdata); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Document__Field__unpack_posdata) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Document::Field::_unpack_posdata", "posdata_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * posdata_sv = ST(0); #line 1553 "lib/KinoSearch.xs" AV *positions_av, *starts_av, *ends_av; #line 2854 "lib/KinoSearch.c" #line 1555 "lib/KinoSearch.xs" positions_av = newAV(); starts_av = newAV(); ends_av = newAV(); Kino_Field_unpack_posdata(posdata_sv, positions_av, starts_av, ends_av); XPUSHs(sv_2mortal( newRV_noinc((SV*)positions_av) )); XPUSHs(sv_2mortal( newRV_noinc((SV*)starts_av) )); XPUSHs(sv_2mortal( newRV_noinc((SV*)ends_av) )); XSRETURN(3); #line 2864 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__MultiTermDocs__init_child); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__MultiTermDocs__init_child) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::MultiTermDocs::_init_child", "term_docs, sub_term_docs_avref, starts_av"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermDocs * term_docs; SV * sub_term_docs_avref = ST(1); AV * starts_av; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); if (SvROK(ST(2)) && SvTYPE(SvRV(ST(2)))==SVt_PVAV) starts_av = (AV*)SvRV(ST(2)); else Perl_croak(aTHX_ "starts_av is not an array reference"); #line 1574 "lib/KinoSearch.xs" Kino_MultiTermDocs_init_child(term_docs, sub_term_docs_avref, starts_av); #line 2901 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__MultiTermDocs__reset_pointer); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__MultiTermDocs__reset_pointer) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::MultiTermDocs::_reset_pointer", "term_docs"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermDocs * term_docs; #line 1586 "lib/KinoSearch.xs" MultiTermDocsChild *child; #line 2925 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 1588 "lib/KinoSearch.xs" child = (MultiTermDocsChild*)term_docs->child; child->base = 0; child->pointer = 0; child->current = NULL; #line 2937 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__MultiTermDocs__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__MultiTermDocs__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "term_docs, ..."); PERL_UNUSED_VAR(cv); /* -W */ { TermDocs * term_docs; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 1601 "lib/KinoSearch.xs" { MultiTermDocsChild *child = (MultiTermDocsChild*)term_docs->child; KINO_START_SET_OR_GET_SWITCH case 1: Kino_confess("Can't set sub_term_docs"); /* fall through */ case 2: RETVAL = newSVsv( child->sub_term_docs_avref ); break; KINO_END_SET_OR_GET_SWITCH } #line 2978 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermBuffer__new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermBuffer__new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermBuffer::_new", "class, finfos_size"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { char * class = (char *)SvPV_nolen(ST(0)); I32 finfos_size = (I32)SvIV(ST(1)); #line 1623 "lib/KinoSearch.xs" TermBuffer *term_buf; #line 3004 "lib/KinoSearch.c" #line 1625 "lib/KinoSearch.xs" term_buf = Kino_TermBuf_new(finfos_size); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)term_buf); XSRETURN(1); #line 3010 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermBuffer_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermBuffer_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermBuffer::DESTROY", "term_buf"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermBuffer * term_buf; if (sv_derived_from(ST(0), "KinoSearch::Index::TermBuffer")) { term_buf = INT2PTR(TermBuffer *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_buf is not of type KinoSearch::Index::TermBuffer"); #line 1635 "lib/KinoSearch.xs" Kino_TermBuf_destroy(term_buf); #line 3040 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__SegTermDocs__init_child); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermDocs__init_child) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermDocs::_init_child", "term_docs"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermDocs * term_docs; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 1644 "lib/KinoSearch.xs" Kino_SegTermDocs_init_child(term_docs); #line 3070 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__SegTermDocs__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermDocs__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "term_docs, ..."); PERL_UNUSED_VAR(cv); /* -W */ { TermDocs * term_docs; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 1667 "lib/KinoSearch.xs" { SegTermDocsChild *child = (SegTermDocsChild*)term_docs->child; KINO_START_SET_OR_GET_SWITCH case 1: child->count = SvUV(ST(1)); /* fall through */ case 2: RETVAL = newSVuv(child->count); break; case 3: SvREFCNT_dec(child->freq_stream_sv); child->freq_stream_sv = newSVsv( ST(1) ); Kino_extract_struct( child->freq_stream_sv, child->freq_stream, InStream*, "KinoSearch::Store::InStream"); /* fall through */ case 4: RETVAL = newSVsv(child->freq_stream_sv); break; case 5: SvREFCNT_dec(child->prox_stream_sv); child->prox_stream_sv = newSVsv( ST(1) ); Kino_extract_struct( child->prox_stream_sv, child->prox_stream, InStream*, "KinoSearch::Store::InStream"); /* fall through */ case 6: RETVAL = newSVsv(child->prox_stream_sv); break; case 7: SvREFCNT_dec(child->skip_stream_sv); child->skip_stream_sv = newSVsv( ST(1) ); Kino_extract_struct( child->skip_stream_sv, child->skip_stream, InStream*, "KinoSearch::Store::InStream"); /* fall through */ case 8: RETVAL = newSVsv(child->skip_stream_sv); break; case 9: SvREFCNT_dec(child->deldocs_sv); child->deldocs_sv = newSVsv( ST(1) ); Kino_extract_struct( child->deldocs_sv, child->deldocs, BitVector*, "KinoSearch::Index::DelDocs" ); /* fall through */ case 10: RETVAL = newSVsv(child->deldocs_sv); break; case 11: SvREFCNT_dec(child->reader_sv); if (!sv_derived_from( ST(1), "KinoSearch::Index::IndexReader") ) Kino_confess("not a KinoSearch::Index::IndexReader"); child->reader_sv = newSVsv( ST(1) ); /* fall through */ case 12: RETVAL = newSVsv(child->reader_sv); break; case 13: child->read_positions = SvTRUE( ST(1) ) ? 1 : 0; /* fall through */ case 14: RETVAL = newSViv(child->read_positions); break; case 15: child->skip_interval = SvUV(ST(1)); /* fall through */ case 16: RETVAL = newSVuv(child->skip_interval); break; KINO_END_SET_OR_GET_SWITCH } #line 3161 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__DelDocs__generate_doc_map); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__DelDocs__generate_doc_map) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::DelDocs::_generate_doc_map", "deldocs, max, offset"); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * deldocs; I32 max = (I32)SvIV(ST(1)); I32 offset = (I32)SvIV(ST(2)); #line 1740 "lib/KinoSearch.xs" SV *map_sv; #line 3186 "lib/KinoSearch.c" SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { deldocs = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "deldocs is not of type KinoSearch::Util::BitVector"); #line 1742 "lib/KinoSearch.xs" map_sv = Kino_DelDocs_generate_doc_map(deldocs, max, offset); RETVAL = newRV_noinc(map_sv); #line 3197 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__DelDocs__delete_by_term_docs); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__DelDocs__delete_by_term_docs) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::DelDocs::_delete_by_term_docs", "deldocs, term_docs"); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * deldocs; TermDocs * term_docs; I32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { deldocs = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "deldocs is not of type KinoSearch::Util::BitVector"); if (sv_derived_from(ST(1), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(1))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 1751 "lib/KinoSearch.xs" RETVAL = Kino_DelDocs_delete_by_term_docs(deldocs, term_docs); #line 3235 "lib/KinoSearch.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfo_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfo_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 6) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfo::new", "class_sv, doc_freq, frq_fileptr, prx_fileptr, skip_offset, index_fileptr"); PERL_UNUSED_VAR(cv); /* -W */ { SV * class_sv = ST(0); I32 doc_freq = (I32)SvIV(ST(1)); double frq_fileptr = (double)SvNV(ST(2)); double prx_fileptr = (double)SvNV(ST(3)); I32 skip_offset = (I32)SvIV(ST(4)); double index_fileptr = (double)SvNV(ST(5)); #line 1766 "lib/KinoSearch.xs" TermInfo *tinfo; #line 3262 "lib/KinoSearch.c" TermInfo * RETVAL; #line 1768 "lib/KinoSearch.xs" class_sv = NULL; /* suppress "unused variable" warning */ Kino_New(0, tinfo, 1, TermInfo); tinfo->doc_freq = doc_freq; tinfo->frq_fileptr = frq_fileptr; tinfo->prx_fileptr = prx_fileptr; tinfo->skip_offset = skip_offset; tinfo->index_fileptr = index_fileptr; RETVAL = tinfo; #line 3273 "lib/KinoSearch.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "KinoSearch::Index::TermInfo", (void*)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfo_clone); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfo_clone) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfo::clone", "tinfo"); PERL_UNUSED_VAR(cv); /* -W */ { TermInfo * tinfo; TermInfo * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfo")) { tinfo = INT2PTR(TermInfo *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "tinfo is not of type KinoSearch::Index::TermInfo"); #line 1790 "lib/KinoSearch.xs" RETVAL = Kino_TInfo_dupe(tinfo); #line 3304 "lib/KinoSearch.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "KinoSearch::Index::TermInfo", (void*)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfo_reset); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfo_reset) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfo::reset", "tinfo"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermInfo * tinfo; if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfo")) { tinfo = INT2PTR(TermInfo *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "tinfo is not of type KinoSearch::Index::TermInfo"); #line 1802 "lib/KinoSearch.xs" Kino_TInfo_reset(tinfo); #line 3336 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermInfo__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfo__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "tinfo, ..."); PERL_UNUSED_VAR(cv); /* -W */ { TermInfo * tinfo; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfo")) { tinfo = INT2PTR(TermInfo *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "tinfo is not of type KinoSearch::Index::TermInfo"); #line 1827 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: tinfo->doc_freq = SvIV(ST(1)); /* fall through */ case 2: RETVAL = newSViv(tinfo->doc_freq); break; case 3: tinfo->frq_fileptr = SvNV(ST(1)); /* fall through */ case 4: RETVAL = newSVnv(tinfo->frq_fileptr); break; case 5: tinfo->prx_fileptr = SvNV(ST(1)); /* fall through */ case 6: RETVAL = newSVnv(tinfo->prx_fileptr); break; case 7: tinfo->skip_offset = SvIV(ST(1)); /* fall through */ case 8: RETVAL = newSViv(tinfo->skip_offset); break; case 9: tinfo->index_fileptr = SvNV(ST(1)); /* fall through */ case 10: RETVAL = newSVnv(tinfo->index_fileptr); break; KINO_END_SET_OR_GET_SWITCH } #line 3395 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfo_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfo_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfo::DESTROY", "tinfo"); PERL_UNUSED_VAR(cv); /* -W */ { TermInfo* tinfo; if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfo")) { tinfo = INT2PTR(TermInfo *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "tinfo is not of type KinoSearch::Index::TermInfo"); #line 1863 "lib/KinoSearch.xs" Kino_Safefree(tinfo); #line 3424 "lib/KinoSearch.c" } XSRETURN_EMPTY; } XS(XS_KinoSearch__Index__SegTermEnum__new_helper); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum__new_helper) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::_new_helper", "instream_sv, is_index, finfos_sv, term_buffer_sv"); PERL_UNUSED_VAR(cv); /* -W */ { SV * instream_sv = ST(0); I32 is_index = (I32)SvIV(ST(1)); SV * finfos_sv = ST(2); SV * term_buffer_sv = ST(3); SegTermEnum * RETVAL; #line 1876 "lib/KinoSearch.xs" RETVAL = Kino_SegTermEnum_new_helper(instream_sv, is_index, finfos_sv, term_buffer_sv); #line 3450 "lib/KinoSearch.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "KinoSearch::Index::SegTermEnum", (void*)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__SegTermEnum_fill_cache); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum_fill_cache) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::fill_cache", "obj"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SegTermEnum * obj; if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 1892 "lib/KinoSearch.xs" Kino_SegTermEnum_fill_cache(obj); #line 3482 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__SegTermEnum_scan_to); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum_scan_to) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::scan_to", "obj, target_termstring_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SegTermEnum * obj; SV * target_termstring_sv = ST(1); #line 1912 "lib/KinoSearch.xs" char *ptr; STRLEN len; #line 3508 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 1915 "lib/KinoSearch.xs" ptr = SvPV(target_termstring_sv, len); if (len < 2) Kino_confess("length of termstring < 2: %"UVuf, (UV)len); Kino_SegTermEnum_scan_to(obj, ptr, len); #line 3520 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__SegTermEnum_reset); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum_reset) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::reset", "obj"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SegTermEnum * obj; if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 1932 "lib/KinoSearch.xs" Kino_SegTermEnum_reset(obj); #line 3550 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__SegTermEnum_next); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum_next) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::next", "obj"); PERL_UNUSED_VAR(cv); /* -W */ { SegTermEnum * obj; IV RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 1946 "lib/KinoSearch.xs" RETVAL = Kino_SegTermEnum_next(obj); #line 3580 "lib/KinoSearch.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__SegTermEnum_scan_cache); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum_scan_cache) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::scan_cache", "obj, target_termstring_sv"); PERL_UNUSED_VAR(cv); /* -W */ { SegTermEnum * obj; SV * target_termstring_sv = ST(1); #line 1962 "lib/KinoSearch.xs" char *ptr; STRLEN len; #line 3604 "lib/KinoSearch.c" I32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 1965 "lib/KinoSearch.xs" ptr = SvPV(target_termstring_sv, len); if (len < 2) Kino_confess("length of termstring < 2: %"UVuf, (UV)len); RETVAL = Kino_SegTermEnum_scan_cache(obj, ptr, len); #line 3618 "lib/KinoSearch.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__SegTermEnum__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "obj, ..."); PERL_UNUSED_VAR(cv); /* -W */ { SegTermEnum * obj; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 2002 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 0: croak("can't call _get_or_set on it's own"); break; /* probably unreachable */ case 1: SvREFCNT_dec(obj->instream_sv); obj->instream_sv = newSVsv( ST(1) ); /* fall through */ case 2: RETVAL = newSVsv(obj->instream_sv); break; case 3: SvREFCNT_dec(obj->finfos); obj->finfos = newSVsv( ST(1) ); /* fall through */ case 4: RETVAL = newSVsv(obj->finfos); break; case 5: obj->enum_size = (I32)SvIV( ST(1) ); /* fall through */ case 6: RETVAL = newSViv(obj->enum_size); break; case 7: if ( SvOK( ST(1) ) ) { STRLEN len = SvCUR( ST(1) ); if (len < KINO_FIELD_NUM_LEN) Kino_confess("Internal error: termstring too short"); Kino_TermBuf_set_termstring(obj->term_buf, SvPVX(ST(1)), len); } else { Kino_TermBuf_reset(obj->term_buf); } /* fall through */ case 8: RETVAL = (obj->term_buf->termstring == NULL) ? &PL_sv_undef : newSVpv( obj->term_buf->termstring->ptr, obj->term_buf->termstring->size ); break; case 9: { TermInfo* new_tinfo; Kino_extract_struct( ST(1), new_tinfo, TermInfo*, "KinoSearch::Index::TermInfo"); Kino_TInfo_destroy(obj->tinfo); obj->tinfo = Kino_TInfo_dupe(new_tinfo); } /* fall through */ case 10: { TermInfo* new_tinfo; RETVAL = newSV(0); new_tinfo = Kino_TInfo_dupe(obj->tinfo); sv_setref_pv(RETVAL, "KinoSearch::Index::TermInfo", (void*)new_tinfo); } break; case 11: obj->index_interval = SvIV( ST(1) ); /* fall through */ case 12: RETVAL = newSViv(obj->index_interval); break; case 13: obj->skip_interval = SvIV( ST(1) ); /* fall through */ case 14: RETVAL = newSViv(obj->skip_interval); break; case 15: obj->position = SvIV( ST(1) ); /* fall through */ case 16: RETVAL = newSViv(obj->position); break; case 17: Kino_confess("can't set is_index"); /* fall through */ case 18: RETVAL = newSViv(obj->is_index); break; KINO_END_SET_OR_GET_SWITCH } #line 3726 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__SegTermEnum_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegTermEnum_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegTermEnum::DESTROY", "obj"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SegTermEnum* obj; if (sv_derived_from(ST(0), "KinoSearch::Index::SegTermEnum")) { obj = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::SegTermEnum"); #line 2088 "lib/KinoSearch.xs" Kino_SegTermEnum_destroy(obj); #line 3757 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__PostingsWriter__write_postings); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__PostingsWriter__write_postings) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::PostingsWriter::_write_postings", "sort_pool, tinfos_writer, frq_out, prx_out"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sort_pool; TermInfosWriter * tinfos_writer; OutStream * frq_out; OutStream * prx_out; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sort_pool = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sort_pool is not of type KinoSearch::Util::SortExternal"); if (sv_derived_from(ST(1), "KinoSearch::Index::TermInfosWriter")) { tinfos_writer = INT2PTR(TermInfosWriter *,( SvIV((SV*)SvRV(ST(1))) ) ); } else Perl_croak(aTHX_ "tinfos_writer is not of type KinoSearch::Index::TermInfosWriter"); if (sv_derived_from(ST(2), "KinoSearch::Store::OutStream")) { frq_out = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(2))) ) ); } else Perl_croak(aTHX_ "frq_out is not of type KinoSearch::Store::OutStream"); if (sv_derived_from(ST(3), "KinoSearch::Store::OutStream")) { prx_out = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(3))) ) ); } else Perl_croak(aTHX_ "prx_out is not of type KinoSearch::Store::OutStream"); #line 2100 "lib/KinoSearch.xs" Kino_PostWriter_write_postings(sort_pool, tinfos_writer, frq_out, prx_out); #line 3809 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__PostingsWriter__add_segment); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__PostingsWriter__add_segment) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::PostingsWriter::_add_segment", "sort_pool, term_enum, term_docs, doc_map_ref"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sort_pool; SegTermEnum * term_enum; TermDocs * term_docs; SV * doc_map_ref = ST(3); if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sort_pool = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sort_pool is not of type KinoSearch::Util::SortExternal"); if (sv_derived_from(ST(1), "KinoSearch::Index::SegTermEnum")) { term_enum = INT2PTR(SegTermEnum *,( SvIV((SV*)SvRV(ST(1))) ) ); } else Perl_croak(aTHX_ "term_enum is not of type KinoSearch::Index::SegTermEnum"); if (sv_derived_from(ST(2), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(2))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2110 "lib/KinoSearch.xs" Kino_PostWriter_add_segment(sort_pool, term_enum, term_docs, doc_map_ref); #line 3855 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermInfosWriter__new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfosWriter__new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfosWriter::_new", "outstream_sv, is_index, index_interval, skip_interval"); PERL_UNUSED_VAR(cv); /* -W */ { SV * outstream_sv = ST(0); I32 is_index = (I32)SvIV(ST(1)); I32 index_interval = (I32)SvIV(ST(2)); I32 skip_interval = (I32)SvIV(ST(3)); TermInfosWriter * RETVAL; #line 2123 "lib/KinoSearch.xs" RETVAL = Kino_TInfosWriter_new(outstream_sv, is_index, index_interval, skip_interval); #line 3882 "lib/KinoSearch.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "KinoSearch::Index::TermInfosWriter", (void*)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfosWriter_add); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfosWriter_add) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfosWriter::add", "obj, termstring_sv, tinfo"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermInfosWriter * obj; SV * termstring_sv = ST(1); TermInfo * tinfo; #line 2139 "lib/KinoSearch.xs" ByteBuf bb; STRLEN len; #line 3911 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfosWriter")) { obj = INT2PTR(TermInfosWriter *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::TermInfosWriter"); if (sv_derived_from(ST(2), "KinoSearch::Index::TermInfo")) { tinfo = INT2PTR(TermInfo *,( SvIV((SV*)SvRV(ST(2))) ) ); } else Perl_croak(aTHX_ "tinfo is not of type KinoSearch::Index::TermInfo"); #line 2142 "lib/KinoSearch.xs" bb.ptr = SvPV(termstring_sv, len); bb.size = len; Kino_TInfosWriter_add(obj, &bb, tinfo); #line 3928 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermInfosWriter_FORMAT); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfosWriter_FORMAT) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfosWriter::FORMAT", ""); PERL_UNUSED_VAR(cv); /* -W */ { IV RETVAL; dXSTARG; #line 2155 "lib/KinoSearch.xs" RETVAL = KINO_TINFOS_FORMAT; #line 3951 "lib/KinoSearch.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfosWriter__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfosWriter__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "obj, ..."); PERL_UNUSED_VAR(cv); /* -W */ { TermInfosWriter * obj; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfosWriter")) { obj = INT2PTR(TermInfosWriter *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::TermInfosWriter"); #line 2169 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: SvREFCNT_dec(obj->other_sv); obj->other_sv = newSVsv( ST(1) ); Kino_extract_struct(obj->other_sv, obj->other, TermInfosWriter*, "KinoSearch::Index::TermInfosWriter"); /* fall through */ case 2: RETVAL = newSVsv(obj->other_sv); break; case 4: RETVAL = newSVsv(obj->fh_sv); break; case 6: RETVAL = newSViv(obj->is_index); break; case 8: RETVAL = newSViv(obj->size); break; KINO_END_SET_OR_GET_SWITCH } #line 4002 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermInfosWriter_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermInfosWriter_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermInfosWriter::DESTROY", "obj"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermInfosWriter * obj; if (sv_derived_from(ST(0), "KinoSearch::Index::TermInfosWriter")) { obj = INT2PTR(TermInfosWriter *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "obj is not of type KinoSearch::Index::TermInfosWriter"); #line 2198 "lib/KinoSearch.xs" Kino_TInfosWriter_destroy(obj); #line 4033 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__SegWriter__write_remapped_norms); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__SegWriter__write_remapped_norms) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::SegWriter::_write_remapped_norms", "outstream, doc_map_ref, norms_ref"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { OutStream * outstream; SV * doc_map_ref = ST(1); SV * norms_ref = ST(2); if (sv_derived_from(ST(0), "KinoSearch::Store::OutStream")) { outstream = INT2PTR(OutStream *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "outstream is not of type KinoSearch::Store::OutStream"); #line 2209 "lib/KinoSearch.xs" Kino_SegWriter_write_remapped_norms(outstream, doc_map_ref, norms_ref); #line 4065 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermDocs_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermDocs::new", "either_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * either_sv = ST(0); #line 2218 "lib/KinoSearch.xs" char *class; TermDocs *term_docs; #line 4090 "lib/KinoSearch.c" #line 2221 "lib/KinoSearch.xs" /* determine the class */ class = sv_isobject(either_sv) ? sv_reftype(either_sv, 0) : SvPV_nolen(either_sv); /* build object */ term_docs = Kino_TermDocs_new(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)term_docs); XSRETURN(1); #line 4102 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermDocs_seek_tinfo); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs_seek_tinfo) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermDocs::seek_tinfo", "term_docs, maybe_tinfo_sv"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermDocs * term_docs; SV * maybe_tinfo_sv = ST(1); #line 2237 "lib/KinoSearch.xs" TermInfo *tinfo = NULL; #line 4127 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2239 "lib/KinoSearch.xs" /* if maybe_tinfo_sv is undef, tinfo is NULL */ if (SvOK(maybe_tinfo_sv)) { Kino_extract_struct(maybe_tinfo_sv, tinfo, TermInfo*, "KinoSearch::Index::TermInfo"); } term_docs->seek_tinfo(term_docs, tinfo); #line 4141 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Index__TermDocs_next); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs_next) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermDocs::next", "term_docs"); PERL_UNUSED_VAR(cv); /* -W */ { TermDocs * term_docs; bool RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2263 "lib/KinoSearch.xs" RETVAL = term_docs->next(term_docs); #line 4170 "lib/KinoSearch.c" ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermDocs_bulk_read); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs_bulk_read) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermDocs::bulk_read", "term_docs, doc_nums_sv, freqs_sv, num_wanted"); PERL_UNUSED_VAR(cv); /* -W */ { TermDocs * term_docs; SV * doc_nums_sv = ST(1); SV * freqs_sv = ST(2); U32 num_wanted = (unsigned long)SvUV(ST(3)); U32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2273 "lib/KinoSearch.xs" RETVAL = term_docs->bulk_read(term_docs, doc_nums_sv, freqs_sv, num_wanted); #line 4205 "lib/KinoSearch.c" XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermDocs_skip_to); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs_skip_to) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermDocs::skip_to", "term_docs, target"); PERL_UNUSED_VAR(cv); /* -W */ { TermDocs * term_docs; U32 target = (unsigned long)SvUV(ST(1)); bool RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2289 "lib/KinoSearch.xs" RETVAL = term_docs->skip_to(term_docs, target); #line 4235 "lib/KinoSearch.c" ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermDocs__parent_set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs__parent_set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "term_docs, ..."); PERL_UNUSED_VAR(cv); /* -W */ { TermDocs * term_docs; #line 2305 "lib/KinoSearch.xs" U32 num; #line 4259 "lib/KinoSearch.c" SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2307 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: Kino_confess("Can't set_doc"); /* fall through */ case 2: num = term_docs->get_doc(term_docs); RETVAL = num == KINO_TERM_DOCS_SENTINEL ? &PL_sv_undef : newSVuv(num); break; case 3: Kino_confess("Can't set_freq"); /* fall through */ case 4: num = term_docs->get_freq(term_docs); RETVAL = num == KINO_TERM_DOCS_SENTINEL ? &PL_sv_undef : newSVuv(num); break; case 5: Kino_confess("Can't set_positions"); /* fall through */ case 6: RETVAL = newSVsv(term_docs->get_positions(term_docs)); break; case 7: term_docs->set_doc_freq(term_docs, (U32)SvUV(ST(1)) ); /* fall through */ case 8: num = term_docs->get_doc_freq(term_docs); RETVAL = num == KINO_TERM_DOCS_SENTINEL ? &PL_sv_undef : newSVuv(num); break; KINO_END_SET_OR_GET_SWITCH } #line 4302 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Index__TermDocs_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Index__TermDocs_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Index::TermDocs::DESTROY", "term_docs"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { TermDocs * term_docs; if (sv_derived_from(ST(0), "KinoSearch::Index::TermDocs")) { term_docs = INT2PTR(TermDocs *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "term_docs is not of type KinoSearch::Index::TermDocs"); #line 2347 "lib/KinoSearch.xs" term_docs->destroy(term_docs); #line 4333 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::new", "either_sv, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * either_sv = ST(0); #line 2357 "lib/KinoSearch.xs" char *class; HV *args_hash; U32 capacity; BitVector *bit_vec; #line 4360 "lib/KinoSearch.c" #line 2362 "lib/KinoSearch.xs" /* determine the class */ class = sv_isobject(either_sv) ? sv_reftype(either_sv, 0) : SvPV_nolen(either_sv); /* process hash-style params */ Kino_Verify_build_args_hash(args_hash, "KinoSearch::Util::BitVector::instance_vars", 1); capacity = (U32)SvUV( Kino_Verify_extract_arg(args_hash, "capacity", 8) ); /* build object */ bit_vec = Kino_BitVec_new(capacity); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)bit_vec); XSRETURN(1); #line 4377 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::get", "bit_vec, num"); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * bit_vec; U32 num = (unsigned long)SvUV(ST(1)); bool RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2390 "lib/KinoSearch.xs" RETVAL = Kino_BitVec_get(bit_vec, num); #line 4407 "lib/KinoSearch.c" ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__BitVector_set); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_set) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::set", "bit_vec, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; #line 2402 "lib/KinoSearch.xs" U32 i, num; #line 4432 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2404 "lib/KinoSearch.xs" for (i = 1; i < items; i++) { num = (U32)( SvUV( ST(i) ) ); Kino_BitVec_set(bit_vec, num); } #line 4444 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_clear); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_clear) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::clear", "bit_vec, num"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; U32 num = (unsigned long)SvUV(ST(1)); if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2419 "lib/KinoSearch.xs" Kino_BitVec_clear(bit_vec, num); #line 4475 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_bulk_set); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_bulk_set) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::bulk_set", "bit_vec, first, last"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; U32 first = (unsigned long)SvUV(ST(1)); U32 last = (unsigned long)SvUV(ST(2)); if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2432 "lib/KinoSearch.xs" Kino_BitVec_bulk_set(bit_vec, first, last); #line 4507 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_bulk_clear); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_bulk_clear) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::bulk_clear", "bit_vec, first, last"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; U32 first = (unsigned long)SvUV(ST(1)); U32 last = (unsigned long)SvUV(ST(2)); if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2445 "lib/KinoSearch.xs" Kino_BitVec_bulk_clear(bit_vec, first, last); #line 4539 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_next_set_bit); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_next_set_bit) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::next_set_bit", "bit_vec, num"); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * bit_vec; U32 num = (unsigned long)SvUV(ST(1)); SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2458 "lib/KinoSearch.xs" num = Kino_BitVec_next_set_bit(bit_vec, num); RETVAL = num == KINO_BITVEC_SENTINEL ? &PL_sv_undef : newSVuv(num); #line 4570 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__BitVector_next_clear_bit); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_next_clear_bit) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::next_clear_bit", "bit_vec, num"); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * bit_vec; U32 num = (unsigned long)SvUV(ST(1)); SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2473 "lib/KinoSearch.xs" num = Kino_BitVec_next_clear_bit(bit_vec, num); RETVAL = num == KINO_BITVEC_SENTINEL ? &PL_sv_undef : newSVuv(num); #line 4602 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__BitVector_logical_and); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_logical_and) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::logical_and", "bit_vec, other"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; BitVector * other; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); if (sv_derived_from(ST(1), "KinoSearch::Util::BitVector")) { other = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(1))) ) ); } else Perl_croak(aTHX_ "other is not of type KinoSearch::Util::BitVector"); #line 2489 "lib/KinoSearch.xs" Kino_BitVec_logical_and(bit_vec, other); #line 4640 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector_count); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_count) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::count", "bit_vec"); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * bit_vec; U32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2501 "lib/KinoSearch.xs" RETVAL = Kino_BitVec_count(bit_vec); #line 4670 "lib/KinoSearch.c" XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Util__BitVector_to_arrayref); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_to_arrayref) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::to_arrayref", "bit_vec"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; #line 2514 "lib/KinoSearch.xs" AV *out_av; #line 4694 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2516 "lib/KinoSearch.xs" out_av = Kino_BitVec_to_array(bit_vec); XPUSHs(newRV_noinc( (SV*)out_av )); XSRETURN(1); #line 4705 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__BitVector__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "bit_vec, ..."); PERL_UNUSED_VAR(cv); /* -W */ { BitVector * bit_vec; #line 2536 "lib/KinoSearch.xs" STRLEN len; U32 new_capacity; char *new_bits; #line 4730 "lib/KinoSearch.c" SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2540 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: new_capacity = SvUV(ST(1)); if (new_capacity < bit_vec->capacity) { Kino_BitVec_shrink(bit_vec, new_capacity); } else if (new_capacity > bit_vec->capacity) { Kino_BitVec_grow(bit_vec, new_capacity); } /* fall through */ case 2: RETVAL = newSVuv(bit_vec->capacity); break; case 3: Kino_Safefree(bit_vec->bits); new_bits = SvPV(ST(1), len); bit_vec->bits = (unsigned char*)Kino_savepvn(new_bits, len); bit_vec->capacity = len << 3; /* fall through */ case 4: len = ceil(bit_vec->capacity / 8.0); RETVAL = newSVpv((char*)bit_vec->bits, len); break; KINO_END_SET_OR_GET_SWITCH } #line 4764 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__BitVector_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__BitVector_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::BitVector::DESTROY", "bit_vec"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { BitVector * bit_vec; if (sv_derived_from(ST(0), "KinoSearch::Util::BitVector")) { bit_vec = INT2PTR(BitVector *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "bit_vec is not of type KinoSearch::Util::BitVector"); #line 2572 "lib/KinoSearch.xs" Kino_BitVec_destroy(bit_vec); #line 4795 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__SortExternal__new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal__new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::_new", "class, outstream_sv, invindex_sv, seg_name_sv, mem_threshold"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { char * class = (char *)SvPV_nolen(ST(0)); SV * outstream_sv = ST(1); SV * invindex_sv = ST(2); SV * seg_name_sv = ST(3); I32 mem_threshold = (I32)SvIV(ST(4)); #line 2586 "lib/KinoSearch.xs" SortExternal *sortex; #line 4823 "lib/KinoSearch.c" #line 2588 "lib/KinoSearch.xs" sortex = Kino_SortEx_new(outstream_sv, invindex_sv, seg_name_sv, mem_threshold); ST(0) = sv_newmortal(); sv_setref_pv( ST(0), class, (void*)sortex ); XSRETURN(1); #line 4830 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__SortExternal_feed); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal_feed) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::feed", "sortex, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sortex; #line 2604 "lib/KinoSearch.xs" I32 i; #line 4854 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2606 "lib/KinoSearch.xs" for (i = 1; i < items; i++) { SV const * item_sv = ST(i); if (!SvPOK(item_sv)) continue; sortex->feed(sortex, SvPVX(item_sv), SvCUR(item_sv)); } #line 4868 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__SortExternal_fetch); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal_fetch) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::fetch", "sortex"); PERL_UNUSED_VAR(cv); /* -W */ { SortExternal * sortex; #line 2623 "lib/KinoSearch.xs" ByteBuf *bb; #line 4890 "lib/KinoSearch.c" SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2625 "lib/KinoSearch.xs" bb = sortex->fetch(sortex); if (bb == NULL) { RETVAL = newSV(0); } else { RETVAL = newSVpvn(bb->ptr, bb->size); Kino_BB_destroy(bb); } #line 4907 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__SortExternal__sort_cache); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal__sort_cache) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::_sort_cache", "sortex"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sortex; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2645 "lib/KinoSearch.xs" Kino_SortEx_sort_cache(sortex); #line 4938 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__SortExternal__sort_run); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal__sort_run) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::_sort_run", "sortex"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sortex; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2658 "lib/KinoSearch.xs" Kino_SortEx_sort_run(sortex); #line 4968 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__SortExternal__enable_fetch); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal__enable_fetch) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::_enable_fetch", "sortex"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sortex; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2670 "lib/KinoSearch.xs" Kino_SortEx_enable_fetch(sortex); #line 4998 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__SortExternal__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "sortex, ..."); PERL_UNUSED_VAR(cv); /* -W */ { SortExternal * sortex; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2687 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 1: SvREFCNT_dec(sortex->outstream_sv); sortex->outstream_sv = newSVsv( ST(1) ); Kino_extract_struct(sortex->outstream_sv, sortex->outstream, OutStream*, "KinoSearch::Store::OutStream"); /* fall through */ case 2: RETVAL = newSVsv(sortex->outstream_sv); break; case 3: SvREFCNT_dec(sortex->instream_sv); sortex->instream_sv = newSVsv( ST(1) ); Kino_extract_struct(sortex->instream_sv, sortex->instream, InStream*, "KinoSearch::Store::InStream"); /* fall through */ case 4: RETVAL = newSVsv(sortex->instream_sv); break; case 5: Kino_confess("can't set num_runs"); /* fall through */ case 6: RETVAL = newSViv(sortex->num_runs); break; case 7: Kino_confess("can't set_invindex"); /* fall through */ case 8: RETVAL = newSVsv(sortex->invindex_sv); break; case 9: Kino_confess("can't set_seg_name"); /* fall through */ case 10: RETVAL = newSVsv(sortex->seg_name_sv); break; KINO_END_SET_OR_GET_SWITCH } #line 5063 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__SortExternal_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__SortExternal_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::SortExternal::DESTROY", "sortex"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SortExternal * sortex; if (sv_derived_from(ST(0), "KinoSearch::Util::SortExternal")) { sortex = INT2PTR(SortExternal *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "sortex is not of type KinoSearch::Util::SortExternal"); #line 2729 "lib/KinoSearch.xs" Kino_SortEx_destroy(sortex); #line 5094 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__IntMap_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__IntMap_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::IntMap::get", "int_map_ref, orig"); PERL_UNUSED_VAR(cv); /* -W */ { SV * int_map_ref = ST(0); I32 orig = (I32)SvIV(ST(1)); #line 2745 "lib/KinoSearch.xs" I32 result; #line 5117 "lib/KinoSearch.c" SV * RETVAL; #line 2747 "lib/KinoSearch.xs" result = Kino_IntMap_get(int_map_ref, orig); RETVAL = result == -1 ? &PL_sv_undef : newSViv(result); #line 5124 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__MathUtils_ceil); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__MathUtils_ceil) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::MathUtils::ceil", "in"); PERL_UNUSED_VAR(cv); /* -W */ { double in = (double)SvNV(ST(0)); double RETVAL; dXSTARG; #line 2760 "lib/KinoSearch.xs" RETVAL = ceil(in); #line 5149 "lib/KinoSearch.c" XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_KinoSearch__Util__PriorityQueue_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::PriorityQueue::new", "either_sv, ..."); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * either_sv = ST(0); #line 2770 "lib/KinoSearch.xs" char *class; HV *args_hash; U32 max_size; PriorityQueue *pq; #line 5176 "lib/KinoSearch.c" #line 2775 "lib/KinoSearch.xs" /* determine the class */ class = sv_isobject(either_sv) ? sv_reftype(either_sv, 0) : SvPV_nolen(either_sv); /* process hash-style params */ Kino_Verify_build_args_hash(args_hash, "KinoSearch::Util::PriorityQueue::instance_vars", 1); max_size = (U32)SvUV( Kino_Verify_extract_arg(args_hash, "max_size", 8) ); /* build object */ pq = Kino_PriQ_new(max_size); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), class, (void*)pq); XSRETURN(1); #line 5193 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__PriorityQueue_insert); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue_insert) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::PriorityQueue::insert", "pq, element"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { PriorityQueue * pq; SV * element = ST(1); if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { pq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "pq is not of type KinoSearch::Util::PriorityQueue"); #line 2804 "lib/KinoSearch.xs" Kino_PriQ_insert(pq, element); #line 5224 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__PriorityQueue_pop); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue_pop) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::PriorityQueue::pop", "pq"); PERL_UNUSED_VAR(cv); /* -W */ { PriorityQueue * pq; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { pq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "pq is not of type KinoSearch::Util::PriorityQueue"); #line 2817 "lib/KinoSearch.xs" RETVAL = Kino_PriQ_pop(pq); if (RETVAL == Nullsv) { RETVAL = &PL_sv_undef; } else { RETVAL = newSVsv(RETVAL); } #line 5259 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__PriorityQueue_peek); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue_peek) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::PriorityQueue::peek", "pq"); PERL_UNUSED_VAR(cv); /* -W */ { PriorityQueue * pq; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { pq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "pq is not of type KinoSearch::Util::PriorityQueue"); #line 2837 "lib/KinoSearch.xs" RETVAL = Kino_PriQ_peek(pq); if (RETVAL == Nullsv) { RETVAL = &PL_sv_undef; } else { RETVAL = newSVsv(RETVAL); } #line 5295 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__PriorityQueue_pop_all); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue_pop_all) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::PriorityQueue::pop_all", "pq"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { PriorityQueue * pq; #line 2858 "lib/KinoSearch.xs" AV* out_av; #line 5320 "lib/KinoSearch.c" if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { pq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "pq is not of type KinoSearch::Util::PriorityQueue"); #line 2860 "lib/KinoSearch.xs" out_av = Kino_PriQ_pop_all(pq); XPUSHs( sv_2mortal(newRV_noinc( (SV*)out_av )) ); #line 5330 "lib/KinoSearch.c" PUTBACK; return; } } XS(XS_KinoSearch__Util__PriorityQueue__set_or_get); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue__set_or_get) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif dXSI32; if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", GvNAME(CvGV(cv)), "pq, ..."); PERL_UNUSED_VAR(cv); /* -W */ { PriorityQueue * pq; SV * RETVAL; if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { pq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "pq is not of type KinoSearch::Util::PriorityQueue"); #line 2871 "lib/KinoSearch.xs" { KINO_START_SET_OR_GET_SWITCH case 2: RETVAL = newSVuv(pq->size); break; case 4: RETVAL = newSVuv(pq->max_size); break; KINO_END_SET_OR_GET_SWITCH } #line 5370 "lib/KinoSearch.c" ST(0) = RETVAL; sv_2mortal(ST(0)); } XSRETURN(1); } XS(XS_KinoSearch__Util__PriorityQueue_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_KinoSearch__Util__PriorityQueue_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "KinoSearch::Util::PriorityQueue::DESTROY", "pq"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { PriorityQueue * pq; if (sv_derived_from(ST(0), "KinoSearch::Util::PriorityQueue")) { pq = INT2PTR(PriorityQueue *,( SvIV((SV*)SvRV(ST(0))) ) ); } else Perl_croak(aTHX_ "pq is not of type KinoSearch::Util::PriorityQueue"); #line 2889 "lib/KinoSearch.xs" Kino_PriQ_destroy(pq); #line 5401 "lib/KinoSearch.c" PUTBACK; return; } } #ifdef __cplusplus extern "C" #endif XS(boot_KinoSearch); /* prototype to pass -Wmissing-prototypes */ XS(boot_KinoSearch) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif char* file = __FILE__; PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ XS_VERSION_BOOTCHECK ; { CV * cv ; newXS("KinoSearch::memory_debugging_enabled", XS_KinoSearch_memory_debugging_enabled, file); newXS("KinoSearch::Analysis::TokenBatch::new", XS_KinoSearch__Analysis__TokenBatch_new, file); newXS("KinoSearch::Analysis::TokenBatch::append", XS_KinoSearch__Analysis__TokenBatch_append, file); newXS("KinoSearch::Analysis::TokenBatch::add_many_tokens", XS_KinoSearch__Analysis__TokenBatch_add_many_tokens, file); newXS("KinoSearch::Analysis::TokenBatch::build_posting_list", XS_KinoSearch__Analysis__TokenBatch_build_posting_list, file); newXS("KinoSearch::Analysis::TokenBatch::set_all_texts", XS_KinoSearch__Analysis__TokenBatch_set_all_texts, file); newXS("KinoSearch::Analysis::TokenBatch::get_all_texts", XS_KinoSearch__Analysis__TokenBatch_get_all_texts, file); cv = newXS("KinoSearch::Analysis::TokenBatch::get_tv_string", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 14 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_pos_inc", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Analysis::TokenBatch::get_pos_inc", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Analysis::TokenBatch::get_end_offset", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Analysis::TokenBatch::get_postings", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 12 ; cv = newXS("KinoSearch::Analysis::TokenBatch::_set_or_get", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_tv_string", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 13 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_start_offset", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_end_offset", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_text", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Analysis::TokenBatch::get_text", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_postings", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 11 ; cv = newXS("KinoSearch::Analysis::TokenBatch::set_size", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 9 ; cv = newXS("KinoSearch::Analysis::TokenBatch::get_start_offset", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Analysis::TokenBatch::get_size", XS_KinoSearch__Analysis__TokenBatch__set_or_get, file); XSANY.any_i32 = 10 ; newXS("KinoSearch::Analysis::TokenBatch::reset", XS_KinoSearch__Analysis__TokenBatch_reset, file); newXS("KinoSearch::Analysis::TokenBatch::next", XS_KinoSearch__Analysis__TokenBatch_next, file); newXS("KinoSearch::Analysis::TokenBatch::DESTROY", XS_KinoSearch__Analysis__TokenBatch_DESTROY, file); newXS("KinoSearch::Analysis::Stopalizer::analyze", XS_KinoSearch__Analysis__Stopalizer_analyze, file); newXS("KinoSearch::Store::OutStream::new", XS_KinoSearch__Store__OutStream_new, file); newXS("KinoSearch::Store::OutStream::seek", XS_KinoSearch__Store__OutStream_seek, file); newXS("KinoSearch::Store::OutStream::tell", XS_KinoSearch__Store__OutStream_tell, file); newXS("KinoSearch::Store::OutStream::length", XS_KinoSearch__Store__OutStream_length, file); newXS("KinoSearch::Store::OutStream::flush", XS_KinoSearch__Store__OutStream_flush, file); newXS("KinoSearch::Store::OutStream::absorb", XS_KinoSearch__Store__OutStream_absorb, file); cv = newXS("KinoSearch::Store::OutStream::set_fh", XS_KinoSearch__Store__OutStream__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Store::OutStream::get_fh", XS_KinoSearch__Store__OutStream__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Store::OutStream::_set_or_get", XS_KinoSearch__Store__OutStream__set_or_get, file); XSANY.any_i32 = 0 ; newXS("KinoSearch::Store::OutStream::lu_write", XS_KinoSearch__Store__OutStream_lu_write, file); newXS("KinoSearch::Store::OutStream::DESTROY", XS_KinoSearch__Store__OutStream_DESTROY, file); newXS("KinoSearch::Store::InStream::new", XS_KinoSearch__Store__InStream_new, file); newXS("KinoSearch::Store::InStream::seek", XS_KinoSearch__Store__InStream_seek, file); newXS("KinoSearch::Store::InStream::tell", XS_KinoSearch__Store__InStream_tell, file); newXS("KinoSearch::Store::InStream::length", XS_KinoSearch__Store__InStream_length, file); cv = newXS("KinoSearch::Store::InStream::set_fh", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Store::InStream::get_len", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Store::InStream::set_offset", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Store::InStream::_set_or_get", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Store::InStream::get_offset", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Store::InStream::set_len", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Store::InStream::get_fh", XS_KinoSearch__Store__InStream__set_or_get, file); XSANY.any_i32 = 6 ; newXS("KinoSearch::Store::InStream::lu_read", XS_KinoSearch__Store__InStream_lu_read, file); newXS("KinoSearch::Store::InStream::DESTROY", XS_KinoSearch__Store__InStream_DESTROY, file); newXS("KinoSearch::Search::Similarity::STORABLE_thaw", XS_KinoSearch__Search__Similarity_STORABLE_thaw, file); newXS("KinoSearch::Search::Similarity::new", XS_KinoSearch__Search__Similarity_new, file); newXS("KinoSearch::Search::Similarity::lengthnorm", XS_KinoSearch__Search__Similarity_lengthnorm, file); newXS("KinoSearch::Search::Similarity::tf", XS_KinoSearch__Search__Similarity_tf, file); newXS("KinoSearch::Search::Similarity::_float_to_byte", XS_KinoSearch__Search__Similarity__float_to_byte, file); newXS("KinoSearch::Search::Similarity::_byte_to_float", XS_KinoSearch__Search__Similarity__byte_to_float, file); newXS("KinoSearch::Search::Similarity::get_norm_decoder", XS_KinoSearch__Search__Similarity_get_norm_decoder, file); newXS("KinoSearch::Search::Similarity::coord", XS_KinoSearch__Search__Similarity_coord, file); newXS("KinoSearch::Search::Similarity::_use_title_tf", XS_KinoSearch__Search__Similarity__use_title_tf, file); newXS("KinoSearch::Search::Similarity::DESTROY", XS_KinoSearch__Search__Similarity_DESTROY, file); newXS("KinoSearch::Search::HitQueue::define_less_than", XS_KinoSearch__Search__HitQueue_define_less_than, file); newXS("KinoSearch::Search::HitCollector::new", XS_KinoSearch__Search__HitCollector_new, file); newXS("KinoSearch::Search::HitCollector::collect", XS_KinoSearch__Search__HitCollector_collect, file); cv = newXS("KinoSearch::Search::HitCollector::_set_storage", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Search::HitCollector::_set_or_get", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Search::HitCollector::_set_i", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Search::HitCollector::_set_filter_bits", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Search::HitCollector::_get_filter_bits", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Search::HitCollector::_get_f", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Search::HitCollector::get_storage", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Search::HitCollector::_set_f", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Search::HitCollector::get_i", XS_KinoSearch__Search__HitCollector__set_or_get, file); XSANY.any_i32 = 4 ; newXS("KinoSearch::Search::HitCollector::DESTROY", XS_KinoSearch__Search__HitCollector_DESTROY, file); newXS("KinoSearch::Search::HitQueueCollector::_define_collect", XS_KinoSearch__Search__HitQueueCollector__define_collect, file); newXS("KinoSearch::Search::BitCollector::_define_collect", XS_KinoSearch__Search__BitCollector__define_collect, file); newXS("KinoSearch::Search::FilteredCollector::_define_collect", XS_KinoSearch__Search__FilteredCollector__define_collect, file); newXS("KinoSearch::Search::OffsetCollector::_define_collect", XS_KinoSearch__Search__OffsetCollector__define_collect, file); newXS("KinoSearch::Search::TermScorer::_init_child", XS_KinoSearch__Search__TermScorer__init_child, file); newXS("KinoSearch::Search::TermScorer::_fill_score_cache", XS_KinoSearch__Search__TermScorer__fill_score_cache, file); newXS("KinoSearch::Search::TermScorer::score_batch", XS_KinoSearch__Search__TermScorer_score_batch, file); cv = newXS("KinoSearch::Search::TermScorer::_set_term_docs", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Search::TermScorer::_set_norms", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Search::TermScorer::_get_norms", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Search::TermScorer::_term_scorer_set_or_get", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Search::TermScorer::_set_weight", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Search::TermScorer::_get_weight_value", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Search::TermScorer::_set_weight_value", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Search::TermScorer::_get_weight", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Search::TermScorer::_get_term_docs", XS_KinoSearch__Search__TermScorer__term_scorer_set_or_get, file); XSANY.any_i32 = 2 ; newXS("KinoSearch::Search::TermScorer::DESTROY", XS_KinoSearch__Search__TermScorer_DESTROY, file); newXS("KinoSearch::Search::BooleanScorer::_init_child", XS_KinoSearch__Search__BooleanScorer__init_child, file); newXS("KinoSearch::Search::BooleanScorer::add_subscorer", XS_KinoSearch__Search__BooleanScorer_add_subscorer, file); cv = newXS("KinoSearch::Search::BooleanScorer::_boolean_scorer_set_or_get", XS_KinoSearch__Search__BooleanScorer__boolean_scorer_set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Search::BooleanScorer::_get_subscorer_storage", XS_KinoSearch__Search__BooleanScorer__boolean_scorer_set_or_get, file); XSANY.any_i32 = 2 ; newXS("KinoSearch::Search::BooleanScorer::DESTROY", XS_KinoSearch__Search__BooleanScorer_DESTROY, file); newXS("KinoSearch::Search::PhraseScorer::_init_child", XS_KinoSearch__Search__PhraseScorer__init_child, file); newXS("KinoSearch::Search::PhraseScorer::_init_elements", XS_KinoSearch__Search__PhraseScorer__init_elements, file); cv = newXS("KinoSearch::Search::PhraseScorer::_get_norms", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Search::PhraseScorer::_set_weight_value", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Search::PhraseScorer::_set_slop", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Search::PhraseScorer::_get_slop", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Search::PhraseScorer::_phrase_scorer_set_or_get", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Search::PhraseScorer::_set_norms", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Search::PhraseScorer::_get_weight_value", XS_KinoSearch__Search__PhraseScorer__phrase_scorer_set_or_get, file); XSANY.any_i32 = 4 ; newXS("KinoSearch::Search::PhraseScorer::DESTROY", XS_KinoSearch__Search__PhraseScorer_DESTROY, file); newXS("KinoSearch::Search::Scorer::_construct_parent", XS_KinoSearch__Search__Scorer__construct_parent, file); cv = newXS("KinoSearch::Search::Scorer::_scorer_set_or_get", XS_KinoSearch__Search__Scorer__scorer_set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Search::Scorer::get_similarity", XS_KinoSearch__Search__Scorer__scorer_set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Search::Scorer::set_similarity", XS_KinoSearch__Search__Scorer__scorer_set_or_get, file); XSANY.any_i32 = 1 ; newXS("KinoSearch::Search::Scorer::score", XS_KinoSearch__Search__Scorer_score, file); newXS("KinoSearch::Search::Scorer::next", XS_KinoSearch__Search__Scorer_next, file); newXS("KinoSearch::Search::Scorer::score_batch", XS_KinoSearch__Search__Scorer_score_batch, file); newXS("KinoSearch::Search::Scorer::skip_to", XS_KinoSearch__Search__Scorer_skip_to, file); newXS("KinoSearch::Search::Scorer::DESTROY", XS_KinoSearch__Search__Scorer_DESTROY, file); newXS("KinoSearch::Document::Field::_extract_tv_cache", XS_KinoSearch__Document__Field__extract_tv_cache, file); newXS("KinoSearch::Document::Field::_unpack_posdata", XS_KinoSearch__Document__Field__unpack_posdata, file); newXS("KinoSearch::Index::MultiTermDocs::_init_child", XS_KinoSearch__Index__MultiTermDocs__init_child, file); newXS("KinoSearch::Index::MultiTermDocs::_reset_pointer", XS_KinoSearch__Index__MultiTermDocs__reset_pointer, file); cv = newXS("KinoSearch::Index::MultiTermDocs::_get_sub_term_docs", XS_KinoSearch__Index__MultiTermDocs__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Index::MultiTermDocs::_set_sub_term_docs", XS_KinoSearch__Index__MultiTermDocs__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Index::MultiTermDocs::_set_or_get", XS_KinoSearch__Index__MultiTermDocs__set_or_get, file); XSANY.any_i32 = 0 ; newXS("KinoSearch::Index::TermBuffer::_new", XS_KinoSearch__Index__TermBuffer__new, file); newXS("KinoSearch::Index::TermBuffer::DESTROY", XS_KinoSearch__Index__TermBuffer_DESTROY, file); newXS("KinoSearch::Index::SegTermDocs::_init_child", XS_KinoSearch__Index__SegTermDocs__init_child, file); cv = newXS("KinoSearch::Index::SegTermDocs::set_read_positions", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 13 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_reader", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 11 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_prox_stream", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_count", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_skip_stream", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_freq_stream", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_skip_interval", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 16 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_prox_stream", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_or_get", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_skip_stream", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_count", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_reader", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 12 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_freq_stream", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_deldocs", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 9 ; cv = newXS("KinoSearch::Index::SegTermDocs::_get_deldocs", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 10 ; cv = newXS("KinoSearch::Index::SegTermDocs::get_read_positions", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 14 ; cv = newXS("KinoSearch::Index::SegTermDocs::_set_skip_interval", XS_KinoSearch__Index__SegTermDocs__set_or_get, file); XSANY.any_i32 = 15 ; newXS("KinoSearch::Index::DelDocs::_generate_doc_map", XS_KinoSearch__Index__DelDocs__generate_doc_map, file); newXS("KinoSearch::Index::DelDocs::_delete_by_term_docs", XS_KinoSearch__Index__DelDocs__delete_by_term_docs, file); newXS("KinoSearch::Index::TermInfo::new", XS_KinoSearch__Index__TermInfo_new, file); newXS("KinoSearch::Index::TermInfo::clone", XS_KinoSearch__Index__TermInfo_clone, file); newXS("KinoSearch::Index::TermInfo::reset", XS_KinoSearch__Index__TermInfo_reset, file); cv = newXS("KinoSearch::Index::TermInfo::set_skip_offset", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Index::TermInfo::get_frq_fileptr", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Index::TermInfo::_set_or_get", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Index::TermInfo::get_prx_fileptr", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Index::TermInfo::get_skip_offset", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Index::TermInfo::set_index_fileptr", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 9 ; cv = newXS("KinoSearch::Index::TermInfo::get_doc_freq", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Index::TermInfo::set_prx_fileptr", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Index::TermInfo::set_frq_fileptr", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Index::TermInfo::set_doc_freq", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Index::TermInfo::get_index_fileptr", XS_KinoSearch__Index__TermInfo__set_or_get, file); XSANY.any_i32 = 10 ; newXS("KinoSearch::Index::TermInfo::DESTROY", XS_KinoSearch__Index__TermInfo_DESTROY, file); newXS("KinoSearch::Index::SegTermEnum::_new_helper", XS_KinoSearch__Index__SegTermEnum__new_helper, file); newXS("KinoSearch::Index::SegTermEnum::fill_cache", XS_KinoSearch__Index__SegTermEnum_fill_cache, file); newXS("KinoSearch::Index::SegTermEnum::scan_to", XS_KinoSearch__Index__SegTermEnum_scan_to, file); newXS("KinoSearch::Index::SegTermEnum::reset", XS_KinoSearch__Index__SegTermEnum_reset, file); newXS("KinoSearch::Index::SegTermEnum::next", XS_KinoSearch__Index__SegTermEnum_next, file); newXS("KinoSearch::Index::SegTermEnum::scan_cache", XS_KinoSearch__Index__SegTermEnum_scan_cache, file); cv = newXS("KinoSearch::Index::SegTermEnum::_set_position", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 15 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_term_info", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 9 ; cv = newXS("KinoSearch::Index::SegTermEnum::get_skip_interval", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 14 ; cv = newXS("KinoSearch::Index::SegTermEnum::_get_instream", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Index::SegTermEnum::get_termstring", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Index::SegTermEnum::get_size", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_is_index", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 17 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_instream", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Index::SegTermEnum::_get_position", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 16 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_skip_interval", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 13 ; cv = newXS("KinoSearch::Index::SegTermEnum::get_term_info", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 10 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_termstring", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Index::SegTermEnum::get_index_interval", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 12 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_size", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Index::SegTermEnum::_get_finfos", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_or_get", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Index::SegTermEnum::is_index", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 18 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_finfos", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Index::SegTermEnum::_set_index_interval", XS_KinoSearch__Index__SegTermEnum__set_or_get, file); XSANY.any_i32 = 11 ; newXS("KinoSearch::Index::SegTermEnum::DESTROY", XS_KinoSearch__Index__SegTermEnum_DESTROY, file); newXS("KinoSearch::Index::PostingsWriter::_write_postings", XS_KinoSearch__Index__PostingsWriter__write_postings, file); newXS("KinoSearch::Index::PostingsWriter::_add_segment", XS_KinoSearch__Index__PostingsWriter__add_segment, file); newXS("KinoSearch::Index::TermInfosWriter::_new", XS_KinoSearch__Index__TermInfosWriter__new, file); newXS("KinoSearch::Index::TermInfosWriter::add", XS_KinoSearch__Index__TermInfosWriter_add, file); newXS("KinoSearch::Index::TermInfosWriter::FORMAT", XS_KinoSearch__Index__TermInfosWriter_FORMAT, file); cv = newXS("KinoSearch::Index::TermInfosWriter::_get_outstream", XS_KinoSearch__Index__TermInfosWriter__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Index::TermInfosWriter::_get_size", XS_KinoSearch__Index__TermInfosWriter__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Index::TermInfosWriter::_get_is_index", XS_KinoSearch__Index__TermInfosWriter__set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Index::TermInfosWriter::_set_other", XS_KinoSearch__Index__TermInfosWriter__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Index::TermInfosWriter::_get_other", XS_KinoSearch__Index__TermInfosWriter__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Index::TermInfosWriter::_set_or_get", XS_KinoSearch__Index__TermInfosWriter__set_or_get, file); XSANY.any_i32 = 0 ; newXS("KinoSearch::Index::TermInfosWriter::DESTROY", XS_KinoSearch__Index__TermInfosWriter_DESTROY, file); newXS("KinoSearch::Index::SegWriter::_write_remapped_norms", XS_KinoSearch__Index__SegWriter__write_remapped_norms, file); newXS("KinoSearch::Index::TermDocs::new", XS_KinoSearch__Index__TermDocs_new, file); newXS("KinoSearch::Index::TermDocs::seek_tinfo", XS_KinoSearch__Index__TermDocs_seek_tinfo, file); newXS("KinoSearch::Index::TermDocs::next", XS_KinoSearch__Index__TermDocs_next, file); newXS("KinoSearch::Index::TermDocs::bulk_read", XS_KinoSearch__Index__TermDocs_bulk_read, file); newXS("KinoSearch::Index::TermDocs::skip_to", XS_KinoSearch__Index__TermDocs_skip_to, file); cv = newXS("KinoSearch::Index::TermDocs::get_freq", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Index::TermDocs::get_positions", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 6 ; cv = newXS("KinoSearch::Index::TermDocs::set_doc", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Index::TermDocs::set_positions", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Index::TermDocs::set_freq", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Index::TermDocs::_parent_set_or_get", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Index::TermDocs::set_doc_freq", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Index::TermDocs::get_doc_freq", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Index::TermDocs::get_doc", XS_KinoSearch__Index__TermDocs__parent_set_or_get, file); XSANY.any_i32 = 2 ; newXS("KinoSearch::Index::TermDocs::DESTROY", XS_KinoSearch__Index__TermDocs_DESTROY, file); newXS("KinoSearch::Util::BitVector::new", XS_KinoSearch__Util__BitVector_new, file); newXS("KinoSearch::Util::BitVector::get", XS_KinoSearch__Util__BitVector_get, file); newXS("KinoSearch::Util::BitVector::set", XS_KinoSearch__Util__BitVector_set, file); newXS("KinoSearch::Util::BitVector::clear", XS_KinoSearch__Util__BitVector_clear, file); newXS("KinoSearch::Util::BitVector::bulk_set", XS_KinoSearch__Util__BitVector_bulk_set, file); newXS("KinoSearch::Util::BitVector::bulk_clear", XS_KinoSearch__Util__BitVector_bulk_clear, file); newXS("KinoSearch::Util::BitVector::next_set_bit", XS_KinoSearch__Util__BitVector_next_set_bit, file); newXS("KinoSearch::Util::BitVector::next_clear_bit", XS_KinoSearch__Util__BitVector_next_clear_bit, file); newXS("KinoSearch::Util::BitVector::logical_and", XS_KinoSearch__Util__BitVector_logical_and, file); newXS("KinoSearch::Util::BitVector::count", XS_KinoSearch__Util__BitVector_count, file); newXS("KinoSearch::Util::BitVector::to_arrayref", XS_KinoSearch__Util__BitVector_to_arrayref, file); cv = newXS("KinoSearch::Util::BitVector::get_bits", XS_KinoSearch__Util__BitVector__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Util::BitVector::_set_or_get", XS_KinoSearch__Util__BitVector__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Util::BitVector::set_capacity", XS_KinoSearch__Util__BitVector__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Util::BitVector::set_bits", XS_KinoSearch__Util__BitVector__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Util::BitVector::get_capacity", XS_KinoSearch__Util__BitVector__set_or_get, file); XSANY.any_i32 = 2 ; newXS("KinoSearch::Util::BitVector::DESTROY", XS_KinoSearch__Util__BitVector_DESTROY, file); newXS("KinoSearch::Util::SortExternal::_new", XS_KinoSearch__Util__SortExternal__new, file); newXS("KinoSearch::Util::SortExternal::feed", XS_KinoSearch__Util__SortExternal_feed, file); newXS("KinoSearch::Util::SortExternal::fetch", XS_KinoSearch__Util__SortExternal_fetch, file); newXS("KinoSearch::Util::SortExternal::_sort_cache", XS_KinoSearch__Util__SortExternal__sort_cache, file); newXS("KinoSearch::Util::SortExternal::_sort_run", XS_KinoSearch__Util__SortExternal__sort_run, file); newXS("KinoSearch::Util::SortExternal::_enable_fetch", XS_KinoSearch__Util__SortExternal__enable_fetch, file); cv = newXS("KinoSearch::Util::SortExternal::_set_num_runs", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 5 ; cv = newXS("KinoSearch::Util::SortExternal::_get_seg_name", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 10 ; cv = newXS("KinoSearch::Util::SortExternal::_get_outstream", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Util::SortExternal::_set_or_get", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 0 ; cv = newXS("KinoSearch::Util::SortExternal::_get_invindex", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 8 ; cv = newXS("KinoSearch::Util::SortExternal::_set_invindex", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 7 ; cv = newXS("KinoSearch::Util::SortExternal::_set_instream", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 3 ; cv = newXS("KinoSearch::Util::SortExternal::_set_outstream", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 1 ; cv = newXS("KinoSearch::Util::SortExternal::_get_instream", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Util::SortExternal::_set_seg_name", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 9 ; cv = newXS("KinoSearch::Util::SortExternal::_get_num_runs", XS_KinoSearch__Util__SortExternal__set_or_get, file); XSANY.any_i32 = 6 ; newXS("KinoSearch::Util::SortExternal::DESTROY", XS_KinoSearch__Util__SortExternal_DESTROY, file); newXS("KinoSearch::Util::IntMap::get", XS_KinoSearch__Util__IntMap_get, file); newXS("KinoSearch::Util::MathUtils::ceil", XS_KinoSearch__Util__MathUtils_ceil, file); newXS("KinoSearch::Util::PriorityQueue::new", XS_KinoSearch__Util__PriorityQueue_new, file); newXS("KinoSearch::Util::PriorityQueue::insert", XS_KinoSearch__Util__PriorityQueue_insert, file); newXS("KinoSearch::Util::PriorityQueue::pop", XS_KinoSearch__Util__PriorityQueue_pop, file); newXS("KinoSearch::Util::PriorityQueue::peek", XS_KinoSearch__Util__PriorityQueue_peek, file); newXS("KinoSearch::Util::PriorityQueue::pop_all", XS_KinoSearch__Util__PriorityQueue_pop_all, file); cv = newXS("KinoSearch::Util::PriorityQueue::get_max_size", XS_KinoSearch__Util__PriorityQueue__set_or_get, file); XSANY.any_i32 = 4 ; cv = newXS("KinoSearch::Util::PriorityQueue::get_size", XS_KinoSearch__Util__PriorityQueue__set_or_get, file); XSANY.any_i32 = 2 ; cv = newXS("KinoSearch::Util::PriorityQueue::_set_or_get", XS_KinoSearch__Util__PriorityQueue__set_or_get, file); XSANY.any_i32 = 0 ; newXS("KinoSearch::Util::PriorityQueue::DESTROY", XS_KinoSearch__Util__PriorityQueue_DESTROY, file); } /* Initialisation Section */ #line 62 "lib/KinoSearch.xs" items = 0; #line 5831 "lib/KinoSearch.c" /* End of Initialisation Section */ XSRETURN_YES; }