/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.45 from the
 * contents of Lucy.xs. Do not edit this file, edit Lucy.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "lib/Lucy.xs"
/*
 * ***********************************************
 * 
 * !!!! DO NOT EDIT !!!!
 * 
 * This file was auto-generated by Build.PL.
 * 
 * ***********************************************
 * 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define CFP_LUCY

#include "XSBind.h"
#include "lucy_perl.h"
#include "Lucy/Util/Sleep.h"
#include "Lucy/Util/Debug.h"
#include "Lucy/Util/ProcessID.h"
#include "Lucy/Util/IndexFileNames.h"
#include "Lucy/Util/StringHelper.h"
#include "Lucy/Util/NumberUtils.h"
#include "Lucy/Util/Freezer.h"
#include "Lucy/Store/ErrorMessage.h"
#include "Lucy/Analysis/Token.h"
#include "Lucy/Analysis/Inversion.h"
#include "Lucy/Analysis/Analyzer.h"
#include "Lucy/Analysis/SnowballStemmer.h"
#include "Lucy/Analysis/Normalizer.h"
#include "Lucy/Analysis/EasyAnalyzer.h"
#include "Lucy/Analysis/CaseFolder.h"
#include "Lucy/Analysis/PolyAnalyzer.h"
#include "Lucy/Analysis/SnowballStopFilter.h"
#include "Lucy/Analysis/RegexTokenizer.h"
#include "Lucy/Analysis/StandardTokenizer.h"
#include "Lucy/Util/MemoryPool.h"
#include "Lucy/Util/Json.h"
#include "Lucy/Util/SortExternal.h"
#include "Lucy/Util/BlobSortEx.h"
#include "Lucy/Index/PostingPool.h"
#include "Lucy/Index/SortFieldWriter.h"
#include "Lucy/Util/Stepper.h"
#include "Lucy/Index/TermStepper.h"
#include "Lucy/Plan/TextType.h"
#include "Lucy/Index/Posting/MatchPosting.h"
#include "Lucy/Index/Posting.h"
#include "Lucy/Index/Posting/RawPosting.h"
#include "Lucy/Index/Posting/MatchPosting.h"
#include "Lucy/Index/Posting/ScorePosting.h"
#include "Lucy/Index/Posting/RichPosting.h"
#include "Lucy/Index/SkipStepper.h"
#include "Lucy/Util/PriorityQueue.h"
#include "Lucy/Search/HitQueue.h"
#include "Lucy/Index/PolyLexicon.h"
#include "Lucy/Highlight/Highlighter.h"
#include "Lucy/Highlight/HeatMap.h"
#include "Lucy/Plan/FieldType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/NumericType.h"
#include "Lucy/Plan/BlobType.h"
#include "Lucy/Plan/TextType.h"
#include "Lucy/Plan/FullTextType.h"
#include "Lucy/Plan/StringType.h"
#include "Lucy/Plan/Schema.h"
#include "Lucy/Plan/Architecture.h"
#include "Lucy/Document/Doc.h"
#include "Lucy/Document/HitDoc.h"
#include "Lucy/Search/Searcher.h"
#include "Lucy/Search/PolySearcher.h"
#include "Lucy/Search/IndexSearcher.h"
#include "Lucy/Search/MatchDoc.h"
#include "Lucy/Search/QueryParser/ParserElem.h"
#include "Lucy/Search/QueryParser/QueryLexer.h"
#include "Lucy/Search/Span.h"
#include "Lucy/Search/TopDocs.h"
#include "Lucy/Search/Hits.h"
#include "Lucy/Search/Collector.h"
#include "Lucy/Search/Collector.h"
#include "Lucy/Search/Collector.h"
#include "Lucy/Search/Collector/SortCollector.h"
#include "Lucy/Search/QueryParser.h"
#include "Lucy/Search/Matcher.h"
#include "LucyX/Search/MockMatcher.h"
#include "LucyX/Search/ProximityMatcher.h"
#include "LucyX/Search/FilterMatcher.h"
#include "Lucy/Search/PhraseMatcher.h"
#include "Lucy/Search/MatchAllMatcher.h"
#include "Lucy/Search/SeriesMatcher.h"
#include "Lucy/Search/TermMatcher.h"
#include "Lucy/Index/Posting/MatchPosting.h"
#include "Lucy/Index/Posting/ScorePosting.h"
#include "Lucy/Index/Posting/RichPosting.h"
#include "Lucy/Search/BitVecMatcher.h"
#include "Lucy/Search/NoMatchMatcher.h"
#include "Lucy/Search/PolyMatcher.h"
#include "Lucy/Search/ANDMatcher.h"
#include "Lucy/Search/ORMatcher.h"
#include "Lucy/Search/ORMatcher.h"
#include "Lucy/Search/RequiredOptionalMatcher.h"
#include "Lucy/Search/NOTMatcher.h"
#include "Lucy/Search/RangeMatcher.h"
#include "Lucy/Index/PostingList.h"
#include "Lucy/Index/RawPostingList.h"
#include "Lucy/Index/SegPostingList.h"
#include "Lucy/Search/SortSpec.h"
#include "Lucy/Search/Query.h"
#include "LucyX/Search/ProximityQuery.h"
#include "Lucy/Search/PhraseQuery.h"
#include "Lucy/Search/TermQuery.h"
#include "Lucy/Search/MatchAllQuery.h"
#include "Lucy/Search/RangeQuery.h"
#include "Lucy/Search/NoMatchQuery.h"
#include "Lucy/Search/PolyQuery.h"
#include "Lucy/Search/ORQuery.h"
#include "Lucy/Search/NOTQuery.h"
#include "Lucy/Search/RequiredOptionalQuery.h"
#include "Lucy/Search/ANDQuery.h"
#include "Lucy/Search/LeafQuery.h"
#include "Lucy/Search/Compiler.h"
#include "LucyX/Search/ProximityQuery.h"
#include "Lucy/Search/PhraseQuery.h"
#include "Lucy/Search/TermQuery.h"
#include "Lucy/Search/MatchAllQuery.h"
#include "Lucy/Search/RangeQuery.h"
#include "Lucy/Search/NoMatchQuery.h"
#include "Lucy/Search/PolyQuery.h"
#include "Lucy/Search/ORQuery.h"
#include "Lucy/Search/NOTQuery.h"
#include "Lucy/Search/RequiredOptionalQuery.h"
#include "Lucy/Search/ANDQuery.h"
#include "Lucy/Search/SortRule.h"
#include "Lucy/Simple.h"
#include "Lucy/Object/BitVector.h"
#include "Lucy/Index/BitVecDelDocs.h"
#include "Lucy/Object/I32Array.h"
#include "Lucy/Index/Segment.h"
#include "Lucy/Index/Similarity.h"
#include "Lucy/Index/TermInfo.h"
#include "Lucy/Index/DataWriter.h"
#include "Lucy/Index/LexiconWriter.h"
#include "Lucy/Index/HighlightWriter.h"
#include "Lucy/Index/SortWriter.h"
#include "Lucy/Index/DeletionsWriter.h"
#include "Lucy/Index/DeletionsWriter.h"
#include "Lucy/Index/DocWriter.h"
#include "Lucy/Index/Posting.h"
#include "Lucy/Index/Posting/RawPosting.h"
#include "Lucy/Index/Posting/MatchPosting.h"
#include "Lucy/Index/SegWriter.h"
#include "Lucy/Index/PostingListWriter.h"
#include "Lucy/Index/Snapshot.h"
#include "Lucy/Index/SortCache.h"
#include "Lucy/Index/SortCache/TextSortCache.h"
#include "Lucy/Index/SortCache/NumericSortCache.h"
#include "Lucy/Index/SortCache/NumericSortCache.h"
#include "Lucy/Index/SortCache/NumericSortCache.h"
#include "Lucy/Index/SortCache/NumericSortCache.h"
#include "Lucy/Index/SortCache/NumericSortCache.h"
#include "Lucy/Index/DataReader.h"
#include "Lucy/Index/LexiconReader.h"
#include "Lucy/Index/LexiconReader.h"
#include "Lucy/Index/LexiconReader.h"
#include "Lucy/Index/HighlightReader.h"
#include "Lucy/Index/HighlightReader.h"
#include "Lucy/Index/HighlightReader.h"
#include "Lucy/Index/PostingListReader.h"
#include "Lucy/Index/PostingListReader.h"
#include "Lucy/Index/SortReader.h"
#include "Lucy/Index/SortReader.h"
#include "Lucy/Index/IndexReader.h"
#include "Lucy/Index/PolyReader.h"
#include "Lucy/Index/SegReader.h"
#include "Lucy/Index/DeletionsReader.h"
#include "Lucy/Index/DeletionsReader.h"
#include "Lucy/Index/DeletionsReader.h"
#include "Lucy/Index/DocReader.h"
#include "Lucy/Index/DocReader.h"
#include "Lucy/Index/DocReader.h"
#include "Lucy/Index/SortWriter.h"
#include "Lucy/Index/SortFieldWriter.h"
#include "Lucy/Index/FilePurger.h"
#include "Lucy/Index/BackgroundMerger.h"
#include "Lucy/Index/Lexicon.h"
#include "Lucy/Index/RawLexicon.h"
#include "Lucy/Index/SegLexicon.h"
#include "Lucy/Index/LexIndex.h"
#include "Lucy/Index/PolyLexicon.h"
#include "Lucy/Index/Indexer.h"
#include "Lucy/Index/TermVector.h"
#include "Lucy/Index/DocVector.h"
#include "Lucy/Index/Inverter.h"
#include "Lucy/Index/Inverter.h"
#include "Lucy/Index/IndexManager.h"
#include "Lucy/Store/RAMFile.h"
#include "Lucy/Store/Lock.h"
#include "Lucy/Store/Lock.h"
#include "Lucy/Store/SharedLock.h"
#include "Lucy/Store/OutStream.h"
#include "Lucy/Store/InStream.h"
#include "Lucy/Store/FileHandle.h"
#include "Lucy/Store/FSFileHandle.h"
#include "Lucy/Store/RAMFileHandle.h"
#include "Lucy/Store/Folder.h"
#include "Lucy/Store/FSFolder.h"
#include "Lucy/Store/RAMFolder.h"
#include "Lucy/Store/CompoundFileReader.h"
#include "Lucy/Store/DirHandle.h"
#include "Lucy/Store/FSDirHandle.h"
#include "Lucy/Store/CompoundFileReader.h"
#include "Lucy/Store/RAMDirHandle.h"
#include "Lucy/Store/CompoundFileWriter.h"
#include "Lucy/Store/FileWindow.h"
#include "Lucy/Store/LockFactory.h"
#include "Lucy/Store/Lock.h"

#ifndef XS_INTERNAL
  #define XS_INTERNAL XS
#endif

XS_INTERNAL(XS_Lucy_Analysis_Token_get_start_offset);
XS_INTERNAL(XS_Lucy_Analysis_Token_get_start_offset) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Get_Start_Offset_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Get_Start_Offset);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Token_get_end_offset);
XS_INTERNAL(XS_Lucy_Analysis_Token_get_end_offset) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Get_End_Offset_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Get_End_Offset);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Token_get_boost);
XS_INTERNAL(XS_Lucy_Analysis_Token_get_boost) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Get_Boost_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Get_Boost);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Token_get_pos_inc);
XS_INTERNAL(XS_Lucy_Analysis_Token_get_pos_inc) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Get_Pos_Inc_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Get_Pos_Inc);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Token_get_pos);
XS_INTERNAL(XS_Lucy_Analysis_Token_get_pos) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Get_Pos_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Get_Pos);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Token_get_len);
XS_INTERNAL(XS_Lucy_Analysis_Token_get_len) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Get_Len_t method;
    size_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Get_Len);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Token_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_Token_DESTROY) {
    dXSARGS;
    lucy_Token* arg_self;
    LUCY_Token_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOKEN, LUCY_Token_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_Inversion_append);
XS_INTERNAL(XS_Lucy_Analysis_Inversion_append) {
    dXSARGS;
    SV *sv;
    lucy_Inversion* arg_self;
    lucy_Token* arg_token;
    LUCY_Inversion_Append_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, token");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inversion*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERSION, NULL);
    sv = ST(1);
    arg_token = (lucy_Token*)XSBind_arg_to_cfish(aTHX_ sv, "token", LUCY_TOKEN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERSION, LUCY_Inversion_Append);
    arg_token = (lucy_Token*)CFISH_INCREF(arg_token);
    method(arg_self, arg_token);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_Inversion_next);
XS_INTERNAL(XS_Lucy_Analysis_Inversion_next) {
    dXSARGS;
    lucy_Inversion* arg_self;
    LUCY_Inversion_Next_t method;
    lucy_Token* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inversion*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERSION, LUCY_Inversion_Next);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Inversion_reset);
XS_INTERNAL(XS_Lucy_Analysis_Inversion_reset) {
    dXSARGS;
    lucy_Inversion* arg_self;
    LUCY_Inversion_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inversion*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERSION, LUCY_Inversion_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_Inversion_invert);
XS_INTERNAL(XS_Lucy_Analysis_Inversion_invert) {
    dXSARGS;
    lucy_Inversion* arg_self;
    LUCY_Inversion_Invert_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inversion*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERSION, LUCY_Inversion_Invert);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_Inversion_get_size);
XS_INTERNAL(XS_Lucy_Analysis_Inversion_get_size) {
    dXSARGS;
    lucy_Inversion* arg_self;
    LUCY_Inversion_Get_Size_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inversion*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERSION, LUCY_Inversion_Get_Size);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Inversion_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_Inversion_DESTROY) {
    dXSARGS;
    lucy_Inversion* arg_self;
    LUCY_Inversion_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inversion*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERSION, LUCY_Inversion_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_Analyzer_new);
XS_INTERNAL(XS_Lucy_Analysis_Analyzer_new) {
    dXSARGS;
    lucy_Analyzer* arg_self;
    lucy_Analyzer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Analyzer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Analyzer_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_Analyzer_transform);
XS_INTERNAL(XS_Lucy_Analysis_Analyzer_transform) {
    dXSARGS;
    SV *sv;
    lucy_Analyzer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_Analyzer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Analyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANALYZER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANALYZER, LUCY_Analyzer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Analyzer_transform_text);
XS_INTERNAL(XS_Lucy_Analysis_Analyzer_transform_text) {
    dXSARGS;
    SV *sv;
    lucy_Analyzer* arg_self;
    cfish_String* arg_text;
    LUCY_Analyzer_Transform_Text_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Analyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANALYZER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANALYZER, LUCY_Analyzer_Transform_Text);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Analyzer_split);
XS_INTERNAL(XS_Lucy_Analysis_Analyzer_split) {
    dXSARGS;
    SV *sv;
    lucy_Analyzer* arg_self;
    cfish_String* arg_text;
    LUCY_Analyzer_Split_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Analyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANALYZER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANALYZER, LUCY_Analyzer_Split);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Analyzer_dump);
XS_INTERNAL(XS_Lucy_Analysis_Analyzer_dump) {
    dXSARGS;
    lucy_Analyzer* arg_self;
    LUCY_Analyzer_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Analyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANALYZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANALYZER, LUCY_Analyzer_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Analyzer_load);
XS_INTERNAL(XS_Lucy_Analysis_Analyzer_load) {
    dXSARGS;
    SV *sv;
    lucy_Analyzer* arg_self;
    cfish_Obj* arg_dump;
    LUCY_Analyzer_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Analyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANALYZER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANALYZER, LUCY_Analyzer_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_new);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("language", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_SnowballStemmer* arg_self;
    cfish_String* arg_language;
    lucy_SnowballStemmer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_language = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "language", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_SnowballStemmer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SnowStemmer_init(arg_self, arg_language);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_transform);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_transform) {
    dXSARGS;
    SV *sv;
    lucy_SnowballStemmer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_SnowStemmer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStemmer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTEMMER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTEMMER, LUCY_SnowStemmer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_dump);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_dump) {
    dXSARGS;
    lucy_SnowballStemmer* arg_self;
    LUCY_SnowStemmer_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStemmer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTEMMER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTEMMER, LUCY_SnowStemmer_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_load);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_load) {
    dXSARGS;
    SV *sv;
    lucy_SnowballStemmer* arg_self;
    cfish_Obj* arg_dump;
    LUCY_SnowStemmer_Load_t method;
    lucy_SnowballStemmer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStemmer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTEMMER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTEMMER, LUCY_SnowStemmer_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_equals);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_equals) {
    dXSARGS;
    SV *sv;
    lucy_SnowballStemmer* arg_self;
    cfish_Obj* arg_other;
    LUCY_SnowStemmer_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStemmer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTEMMER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTEMMER, LUCY_SnowStemmer_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStemmer_DESTROY) {
    dXSARGS;
    lucy_SnowballStemmer* arg_self;
    LUCY_SnowStemmer_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStemmer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTEMMER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTEMMER, LUCY_SnowStemmer_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_Normalizer_new);
XS_INTERNAL(XS_Lucy_Analysis_Normalizer_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("normalization_form", 0),
        XSBIND_PARAM("case_fold", 0),
        XSBIND_PARAM("strip_accents", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Normalizer* arg_self;
    cfish_String* arg_normalization_form;
    bool arg_case_fold;
    bool arg_strip_accents;
    lucy_Normalizer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_normalization_form = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "normalization_form", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_case_fold = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[2]);
    arg_strip_accents = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_Normalizer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Normalizer_init(arg_self, arg_normalization_form, arg_case_fold, arg_strip_accents);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_Normalizer_transform);
XS_INTERNAL(XS_Lucy_Analysis_Normalizer_transform) {
    dXSARGS;
    SV *sv;
    lucy_Normalizer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_Normalizer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Normalizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NORMALIZER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NORMALIZER, LUCY_Normalizer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Normalizer_dump);
XS_INTERNAL(XS_Lucy_Analysis_Normalizer_dump) {
    dXSARGS;
    lucy_Normalizer* arg_self;
    LUCY_Normalizer_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Normalizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NORMALIZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NORMALIZER, LUCY_Normalizer_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Normalizer_load);
XS_INTERNAL(XS_Lucy_Analysis_Normalizer_load) {
    dXSARGS;
    SV *sv;
    lucy_Normalizer* arg_self;
    cfish_Obj* arg_dump;
    LUCY_Normalizer_Load_t method;
    lucy_Normalizer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Normalizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NORMALIZER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NORMALIZER, LUCY_Normalizer_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_Normalizer_equals);
XS_INTERNAL(XS_Lucy_Analysis_Normalizer_equals) {
    dXSARGS;
    SV *sv;
    lucy_Normalizer* arg_self;
    cfish_Obj* arg_other;
    LUCY_Normalizer_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Normalizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NORMALIZER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NORMALIZER, LUCY_Normalizer_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_new);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("language", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_EasyAnalyzer* arg_self;
    cfish_String* arg_language;
    lucy_EasyAnalyzer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_language = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "language", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    arg_self = (lucy_EasyAnalyzer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_EasyAnalyzer_init(arg_self, arg_language);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_transform);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_transform) {
    dXSARGS;
    SV *sv;
    lucy_EasyAnalyzer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_EasyAnalyzer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_EasyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_EASYANALYZER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_EASYANALYZER, LUCY_EasyAnalyzer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_transform_text);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_transform_text) {
    dXSARGS;
    SV *sv;
    lucy_EasyAnalyzer* arg_self;
    cfish_String* arg_text;
    LUCY_EasyAnalyzer_Transform_Text_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_EasyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_EASYANALYZER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_EASYANALYZER, LUCY_EasyAnalyzer_Transform_Text);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_dump);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_dump) {
    dXSARGS;
    lucy_EasyAnalyzer* arg_self;
    LUCY_EasyAnalyzer_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_EasyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_EASYANALYZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_EASYANALYZER, LUCY_EasyAnalyzer_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_load);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_load) {
    dXSARGS;
    SV *sv;
    lucy_EasyAnalyzer* arg_self;
    cfish_Obj* arg_dump;
    LUCY_EasyAnalyzer_Load_t method;
    lucy_EasyAnalyzer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_EasyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_EASYANALYZER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_EASYANALYZER, LUCY_EasyAnalyzer_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_equals);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_equals) {
    dXSARGS;
    SV *sv;
    lucy_EasyAnalyzer* arg_self;
    cfish_Obj* arg_other;
    LUCY_EasyAnalyzer_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_EasyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_EASYANALYZER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_EASYANALYZER, LUCY_EasyAnalyzer_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_EasyAnalyzer_DESTROY) {
    dXSARGS;
    lucy_EasyAnalyzer* arg_self;
    LUCY_EasyAnalyzer_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_EasyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_EASYANALYZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_EASYANALYZER, LUCY_EasyAnalyzer_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_new);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_new) {
    dXSARGS;
    lucy_CaseFolder* arg_self;
    lucy_CaseFolder* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_CaseFolder*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_CaseFolder_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_transform);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_transform) {
    dXSARGS;
    SV *sv;
    lucy_CaseFolder* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_CaseFolder_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CaseFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CASEFOLDER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CASEFOLDER, LUCY_CaseFolder_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_transform_text);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_transform_text) {
    dXSARGS;
    SV *sv;
    lucy_CaseFolder* arg_self;
    cfish_String* arg_text;
    LUCY_CaseFolder_Transform_Text_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CaseFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CASEFOLDER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CASEFOLDER, LUCY_CaseFolder_Transform_Text);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_equals);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_equals) {
    dXSARGS;
    SV *sv;
    lucy_CaseFolder* arg_self;
    cfish_Obj* arg_other;
    LUCY_CaseFolder_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CaseFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CASEFOLDER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CASEFOLDER, LUCY_CaseFolder_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_dump);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_dump) {
    dXSARGS;
    lucy_CaseFolder* arg_self;
    LUCY_CaseFolder_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CaseFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CASEFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CASEFOLDER, LUCY_CaseFolder_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_load);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_load) {
    dXSARGS;
    SV *sv;
    lucy_CaseFolder* arg_self;
    cfish_Obj* arg_dump;
    LUCY_CaseFolder_Load_t method;
    lucy_CaseFolder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CaseFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CASEFOLDER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CASEFOLDER, LUCY_CaseFolder_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_CaseFolder_DESTROY) {
    dXSARGS;
    lucy_CaseFolder* arg_self;
    LUCY_CaseFolder_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CaseFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CASEFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CASEFOLDER, LUCY_CaseFolder_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_new);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("language", 0),
        XSBIND_PARAM("analyzers", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyAnalyzer* arg_self;
    cfish_String* arg_language;
    cfish_Vector* arg_analyzers;
    lucy_PolyAnalyzer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_language = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "language", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_analyzers = locations[1] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "analyzers", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_PolyAnalyzer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyAnalyzer_init(arg_self, arg_language, arg_analyzers);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_get_analyzers);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_get_analyzers) {
    dXSARGS;
    lucy_PolyAnalyzer* arg_self;
    LUCY_PolyAnalyzer_Get_Analyzers_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Get_Analyzers);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_transform);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_transform) {
    dXSARGS;
    SV *sv;
    lucy_PolyAnalyzer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_PolyAnalyzer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_transform_text);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_transform_text) {
    dXSARGS;
    SV *sv;
    lucy_PolyAnalyzer* arg_self;
    cfish_String* arg_text;
    LUCY_PolyAnalyzer_Transform_Text_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Transform_Text);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_equals);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_equals) {
    dXSARGS;
    SV *sv;
    lucy_PolyAnalyzer* arg_self;
    cfish_Obj* arg_other;
    LUCY_PolyAnalyzer_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_dump);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_dump) {
    dXSARGS;
    lucy_PolyAnalyzer* arg_self;
    LUCY_PolyAnalyzer_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_load);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_load) {
    dXSARGS;
    SV *sv;
    lucy_PolyAnalyzer* arg_self;
    cfish_Obj* arg_dump;
    LUCY_PolyAnalyzer_Load_t method;
    lucy_PolyAnalyzer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_PolyAnalyzer_DESTROY) {
    dXSARGS;
    lucy_PolyAnalyzer* arg_self;
    LUCY_PolyAnalyzer_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyAnalyzer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYANALYZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYANALYZER, LUCY_PolyAnalyzer_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_new);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("language", 0),
        XSBIND_PARAM("stoplist", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SnowballStopFilter* arg_self;
    cfish_String* arg_language;
    cfish_Hash* arg_stoplist;
    lucy_SnowballStopFilter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_language = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "language", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_stoplist = locations[1] < items ? (cfish_Hash*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "stoplist", CFISH_HASH, NULL) : NULL;
    arg_self = (lucy_SnowballStopFilter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SnowStop_init(arg_self, arg_language, arg_stoplist);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_transform);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_transform) {
    dXSARGS;
    SV *sv;
    lucy_SnowballStopFilter* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_SnowStop_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStopFilter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTOPFILTER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTOPFILTER, LUCY_SnowStop_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_equals);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_equals) {
    dXSARGS;
    SV *sv;
    lucy_SnowballStopFilter* arg_self;
    cfish_Obj* arg_other;
    LUCY_SnowStop_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStopFilter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTOPFILTER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTOPFILTER, LUCY_SnowStop_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_dump);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_dump) {
    dXSARGS;
    lucy_SnowballStopFilter* arg_self;
    LUCY_SnowStop_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStopFilter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTOPFILTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTOPFILTER, LUCY_SnowStop_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_load);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_load) {
    dXSARGS;
    SV *sv;
    lucy_SnowballStopFilter* arg_self;
    cfish_Obj* arg_dump;
    LUCY_SnowStop_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStopFilter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTOPFILTER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTOPFILTER, LUCY_SnowStop_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_SnowballStopFilter_DESTROY) {
    dXSARGS;
    lucy_SnowballStopFilter* arg_self;
    LUCY_SnowStop_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SnowballStopFilter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNOWBALLSTOPFILTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNOWBALLSTOPFILTER, LUCY_SnowStop_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer__new);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer__new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("pattern", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_RegexTokenizer* arg_self;
    cfish_String* arg_pattern;
    lucy_RegexTokenizer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_pattern = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "pattern", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    arg_self = (lucy_RegexTokenizer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RegexTokenizer_init(arg_self, arg_pattern);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_transform);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_transform) {
    dXSARGS;
    SV *sv;
    lucy_RegexTokenizer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_RegexTokenizer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RegexTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REGEXTOKENIZER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REGEXTOKENIZER, LUCY_RegexTokenizer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_transform_text);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_transform_text) {
    dXSARGS;
    SV *sv;
    lucy_RegexTokenizer* arg_self;
    cfish_String* arg_text;
    LUCY_RegexTokenizer_Transform_Text_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RegexTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REGEXTOKENIZER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REGEXTOKENIZER, LUCY_RegexTokenizer_Transform_Text);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_dump);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_dump) {
    dXSARGS;
    lucy_RegexTokenizer* arg_self;
    LUCY_RegexTokenizer_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RegexTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REGEXTOKENIZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REGEXTOKENIZER, LUCY_RegexTokenizer_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_load);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_load) {
    dXSARGS;
    SV *sv;
    lucy_RegexTokenizer* arg_self;
    cfish_Obj* arg_dump;
    LUCY_RegexTokenizer_Load_t method;
    lucy_RegexTokenizer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RegexTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REGEXTOKENIZER, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REGEXTOKENIZER, LUCY_RegexTokenizer_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_equals);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_equals) {
    dXSARGS;
    SV *sv;
    lucy_RegexTokenizer* arg_self;
    cfish_Obj* arg_other;
    LUCY_RegexTokenizer_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RegexTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REGEXTOKENIZER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REGEXTOKENIZER, LUCY_RegexTokenizer_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_DESTROY);
XS_INTERNAL(XS_Lucy_Analysis_RegexTokenizer_DESTROY) {
    dXSARGS;
    lucy_RegexTokenizer* arg_self;
    LUCY_RegexTokenizer_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RegexTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REGEXTOKENIZER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REGEXTOKENIZER, LUCY_RegexTokenizer_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_new);
XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_new) {
    dXSARGS;
    lucy_StandardTokenizer* arg_self;
    lucy_StandardTokenizer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_StandardTokenizer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_StandardTokenizer_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_transform);
XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_transform) {
    dXSARGS;
    SV *sv;
    lucy_StandardTokenizer* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_StandardTokenizer_Transform_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StandardTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STANDARDTOKENIZER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STANDARDTOKENIZER, LUCY_StandardTokenizer_Transform);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_transform_text);
XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_transform_text) {
    dXSARGS;
    SV *sv;
    lucy_StandardTokenizer* arg_self;
    cfish_String* arg_text;
    LUCY_StandardTokenizer_Transform_Text_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StandardTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STANDARDTOKENIZER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STANDARDTOKENIZER, LUCY_StandardTokenizer_Transform_Text);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_equals);
XS_INTERNAL(XS_Lucy_Analysis_StandardTokenizer_equals) {
    dXSARGS;
    SV *sv;
    lucy_StandardTokenizer* arg_self;
    cfish_Obj* arg_other;
    LUCY_StandardTokenizer_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StandardTokenizer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STANDARDTOKENIZER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STANDARDTOKENIZER, LUCY_StandardTokenizer_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_MemoryPool_new);
XS_INTERNAL(XS_Lucy_Util_MemoryPool_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("arena_size", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_MemoryPool* arg_self;
    uint32_t arg_arena_size;
    lucy_MemoryPool* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "arena_size");
    }
    arg_arena_size = (uint32_t)SvUV(sv);
    arg_self = (lucy_MemoryPool*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MemPool_init(arg_self, arg_arena_size);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Util_MemoryPool_release_all);
XS_INTERNAL(XS_Lucy_Util_MemoryPool_release_all) {
    dXSARGS;
    lucy_MemoryPool* arg_self;
    LUCY_MemPool_Release_All_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MemoryPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MEMORYPOOL, LUCY_MemPool_Release_All);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_MemoryPool_get_consumed);
XS_INTERNAL(XS_Lucy_Util_MemoryPool_get_consumed) {
    dXSARGS;
    lucy_MemoryPool* arg_self;
    LUCY_MemPool_Get_Consumed_t method;
    size_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MemoryPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MEMORYPOOL, LUCY_MemPool_Get_Consumed);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_MemoryPool_DESTROY);
XS_INTERNAL(XS_Lucy_Util_MemoryPool_DESTROY) {
    dXSARGS;
    lucy_MemoryPool* arg_self;
    LUCY_MemPool_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MemoryPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MEMORYPOOL, LUCY_MemPool_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_new);
XS_INTERNAL(XS_Lucy_Util_SortExternal_new) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    lucy_SortExternal* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_SortExternal*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortEx_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Util_SortExternal_flush);
XS_INTERNAL(XS_Lucy_Util_SortExternal_flush) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Flush_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Flush);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_feed);
XS_INTERNAL(XS_Lucy_Util_SortExternal_feed) {
    dXSARGS;
    SV *sv;
    lucy_SortExternal* arg_self;
    cfish_Obj* arg_item;
    LUCY_SortEx_Feed_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, item");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);
    sv = ST(1);
    arg_item = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "item", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Feed);
    arg_item = (cfish_Obj*)CFISH_INCREF(arg_item);
    method(arg_self, arg_item);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_flip);
XS_INTERNAL(XS_Lucy_Util_SortExternal_flip) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Flip_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Flip);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_fetch);
XS_INTERNAL(XS_Lucy_Util_SortExternal_fetch) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Fetch_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Fetch);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_peek);
XS_INTERNAL(XS_Lucy_Util_SortExternal_peek) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Peek_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Peek);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_add_run);
XS_INTERNAL(XS_Lucy_Util_SortExternal_add_run) {
    dXSARGS;
    SV *sv;
    lucy_SortExternal* arg_self;
    lucy_SortExternal* arg_run;
    LUCY_SortEx_Add_Run_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, run");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);
    sv = ST(1);
    arg_run = (lucy_SortExternal*)XSBind_arg_to_cfish(aTHX_ sv, "run", LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Add_Run);
    arg_run = (lucy_SortExternal*)CFISH_INCREF(arg_run);
    method(arg_self, arg_run);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_shrink);
XS_INTERNAL(XS_Lucy_Util_SortExternal_shrink) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Shrink_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Shrink);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_refill);
XS_INTERNAL(XS_Lucy_Util_SortExternal_refill) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Refill_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Refill);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_sort_buffer);
XS_INTERNAL(XS_Lucy_Util_SortExternal_sort_buffer) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Sort_Buffer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Sort_Buffer);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_clear_buffer);
XS_INTERNAL(XS_Lucy_Util_SortExternal_clear_buffer) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Clear_Buffer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Clear_Buffer);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_buffer_count);
XS_INTERNAL(XS_Lucy_Util_SortExternal_buffer_count) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Buffer_Count_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Buffer_Count);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_grow_buffer);
XS_INTERNAL(XS_Lucy_Util_SortExternal_grow_buffer) {
    dXSARGS;
    SV *sv;
    lucy_SortExternal* arg_self;
    uint32_t arg_cap;
    LUCY_SortEx_Grow_Buffer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, cap");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cap");
    }
    arg_cap = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Grow_Buffer);
    method(arg_self, arg_cap);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_set_mem_thresh);
XS_INTERNAL(XS_Lucy_Util_SortExternal_set_mem_thresh) {
    dXSARGS;
    SV *sv;
    lucy_SortExternal* arg_self;
    uint32_t arg_mem_thresh;
    LUCY_SortEx_Set_Mem_Thresh_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, mem_thresh");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "mem_thresh");
    }
    arg_mem_thresh = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Set_Mem_Thresh);
    method(arg_self, arg_mem_thresh);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_SortExternal_DESTROY);
XS_INTERNAL(XS_Lucy_Util_SortExternal_DESTROY) {
    dXSARGS;
    lucy_SortExternal* arg_self;
    LUCY_SortEx_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortExternal*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTEXTERNAL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTEXTERNAL, LUCY_SortEx_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_new);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("mem_thresh", 0),
        XSBIND_PARAM("external", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_BlobSortEx* arg_self;
    uint32_t arg_mem_thresh;
    cfish_Vector* arg_external;
    lucy_BlobSortEx* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_mem_thresh = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 0x1000000;
    sv = ST(locations[1]);
    arg_external = locations[1] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "external", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_BlobSortEx*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BlobSortEx_init(arg_self, arg_mem_thresh, arg_external);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Util_BlobSortEx_feed);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_feed) {
    dXSARGS;
    SV *sv;
    lucy_BlobSortEx* arg_self;
    cfish_Obj* arg_item;
    LUCY_BlobSortEx_Feed_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, item");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);
    sv = ST(1);
    arg_item = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "item", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Feed);
    arg_item = (cfish_Obj*)CFISH_INCREF(arg_item);
    method(arg_self, arg_item);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_flush);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_flush) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Flush_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Flush);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_refill);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_refill) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Refill_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Refill);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_clear_buffer);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_clear_buffer) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Clear_Buffer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Clear_Buffer);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_flip);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_flip) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Flip_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Flip);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_peek_cache);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_peek_cache) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Peek_Cache_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Peek_Cache);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_peek_last);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_peek_last) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Peek_Last_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Peek_Last);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_get_num_runs);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_get_num_runs) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Get_Num_Runs_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Get_Num_Runs);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_BlobSortEx_DESTROY);
XS_INTERNAL(XS_Lucy_Util_BlobSortEx_DESTROY) {
    dXSARGS;
    lucy_BlobSortEx* arg_self;
    LUCY_BlobSortEx_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobSortEx*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBSORTEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBSORTEX, LUCY_BlobSortEx_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_new);
XS_INTERNAL(XS_Lucy_Index_PostingPool_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[10] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("lex_writer", 1),
        XSBIND_PARAM("mem_pool", 1),
        XSBIND_PARAM("lex_temp_out", 1),
        XSBIND_PARAM("post_temp_out", 1),
        XSBIND_PARAM("skip_out", 1)
    };
    int32_t locations[10];
    SV *sv;
    lucy_PostingPool* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    cfish_String* arg_field;
    lucy_LexiconWriter* arg_lex_writer;
    lucy_MemoryPool* arg_mem_pool;
    lucy_OutStream* arg_lex_temp_out;
    lucy_OutStream* arg_post_temp_out;
    lucy_OutStream* arg_skip_out;
    lucy_PostingPool* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 10);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[5]);
    arg_lex_writer = (lucy_LexiconWriter*)XSBind_arg_to_cfish(aTHX_ sv, "lex_writer", LUCY_LEXICONWRITER, NULL);
    sv = ST(locations[6]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);
    sv = ST(locations[7]);
    arg_lex_temp_out = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "lex_temp_out", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[8]);
    arg_post_temp_out = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "post_temp_out", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[9]);
    arg_skip_out = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "skip_out", LUCY_OUTSTREAM, NULL);
    arg_self = (lucy_PostingPool*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PostPool_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_field, arg_lex_writer, arg_mem_pool, arg_lex_temp_out, arg_post_temp_out, arg_skip_out);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PostingPool_add_inversion);
XS_INTERNAL(XS_Lucy_Index_PostingPool_add_inversion) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("inversion", 1),
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("doc_boost", 1),
        XSBIND_PARAM("length_norm", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_PostingPool* arg_self;
    lucy_Inversion* arg_inversion;
    int32_t arg_doc_id;
    float arg_doc_boost;
    float arg_length_norm;
    LUCY_PostPool_Add_Inversion_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);
    sv = ST(locations[0]);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_boost");
    }
    arg_doc_boost = (float)SvNV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length_norm");
    }
    arg_length_norm = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Add_Inversion);
    method(arg_self, arg_inversion, arg_doc_id, arg_doc_boost, arg_length_norm);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_get_mem_pool);
XS_INTERNAL(XS_Lucy_Index_PostingPool_get_mem_pool) {
    dXSARGS;
    lucy_PostingPool* arg_self;
    LUCY_PostPool_Get_Mem_Pool_t method;
    lucy_MemoryPool* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Get_Mem_Pool);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_add_segment);
XS_INTERNAL(XS_Lucy_Index_PostingPool_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 1),
        XSBIND_PARAM("doc_base", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PostingPool* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    int32_t arg_doc_base;
    LUCY_PostPool_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_base");
    }
    arg_doc_base = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map, arg_doc_base);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_flip);
XS_INTERNAL(XS_Lucy_Index_PostingPool_flip) {
    dXSARGS;
    lucy_PostingPool* arg_self;
    LUCY_PostPool_Flip_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Flip);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_refill);
XS_INTERNAL(XS_Lucy_Index_PostingPool_refill) {
    dXSARGS;
    lucy_PostingPool* arg_self;
    LUCY_PostPool_Refill_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Refill);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_finish);
XS_INTERNAL(XS_Lucy_Index_PostingPool_finish) {
    dXSARGS;
    lucy_PostingPool* arg_self;
    LUCY_PostPool_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_flush);
XS_INTERNAL(XS_Lucy_Index_PostingPool_flush) {
    dXSARGS;
    lucy_PostingPool* arg_self;
    LUCY_PostPool_Flush_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Flush);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingPool_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PostingPool_DESTROY) {
    dXSARGS;
    lucy_PostingPool* arg_self;
    LUCY_PostPool_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingPool*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGPOOL, LUCY_PostPool_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_new);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[10] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("counter", 1),
        XSBIND_PARAM("mem_thresh", 1),
        XSBIND_PARAM("temp_ord_out", 1),
        XSBIND_PARAM("temp_ix_out", 1),
        XSBIND_PARAM("temp_dat_out", 1)
    };
    int32_t locations[10];
    SV *sv;
    lucy_SortFieldWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    cfish_String* arg_field;
    lucy_Counter* arg_counter;
    uint32_t arg_mem_thresh;
    lucy_OutStream* arg_temp_ord_out;
    lucy_OutStream* arg_temp_ix_out;
    lucy_OutStream* arg_temp_dat_out;
    lucy_SortFieldWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 10);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[5]);
    arg_counter = (lucy_Counter*)XSBind_arg_to_cfish(aTHX_ sv, "counter", LUCY_COUNTER, NULL);
    sv = ST(locations[6]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "mem_thresh");
    }
    arg_mem_thresh = (uint32_t)SvUV(sv);
    sv = ST(locations[7]);
    arg_temp_ord_out = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "temp_ord_out", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[8]);
    arg_temp_ix_out = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "temp_ix_out", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[9]);
    arg_temp_dat_out = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "temp_dat_out", LUCY_OUTSTREAM, NULL);
    arg_self = (lucy_SortFieldWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortFieldWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_field, arg_counter, arg_mem_thresh, arg_temp_ord_out, arg_temp_ix_out, arg_temp_dat_out);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_add);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_add) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SortFieldWriter* arg_self;
    int32_t arg_doc_id;
    cfish_Obj* arg_value;
    LUCY_SortFieldWriter_Add_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Add);
    method(arg_self, arg_doc_id, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 1),
        XSBIND_PARAM("sort_cache", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_SortFieldWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    lucy_SortCache* arg_sort_cache;
    LUCY_SortFieldWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL);
    sv = ST(locations[2]);
    arg_sort_cache = (lucy_SortCache*)XSBind_arg_to_cfish(aTHX_ sv, "sort_cache", LUCY_SORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map, arg_sort_cache);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_flush);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_flush) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Flush_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Flush);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_flip);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_flip) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Flip_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Flip);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_refill);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_refill) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Refill_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Refill);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_finish);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_finish) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Finish_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Finish);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_get_null_ord);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_get_null_ord) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Get_Null_Ord_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Get_Null_Ord);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_get_ord_width);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_get_ord_width) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Get_Ord_Width_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Get_Ord_Width);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_DESTROY) {
    dXSARGS;
    lucy_SortFieldWriter* arg_self;
    LUCY_SortFieldWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortFieldWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTFIELDWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTFIELDWRITER, LUCY_SortFieldWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_Stepper_new);
XS_INTERNAL(XS_Lucy_Util_Stepper_new) {
    dXSARGS;
    lucy_Stepper* arg_self;
    lucy_Stepper* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Stepper*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Stepper_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Util_Stepper_reset);
XS_INTERNAL(XS_Lucy_Util_Stepper_reset) {
    dXSARGS;
    lucy_Stepper* arg_self;
    LUCY_Stepper_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Stepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STEPPER, LUCY_Stepper_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_Stepper_write_key_frame);
XS_INTERNAL(XS_Lucy_Util_Stepper_write_key_frame) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Stepper* arg_self;
    lucy_OutStream* arg_outstream;
    cfish_Obj* arg_value;
    LUCY_Stepper_Write_Key_Frame_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Stepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STEPPER, LUCY_Stepper_Write_Key_Frame);
    method(arg_self, arg_outstream, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_Stepper_write_delta);
XS_INTERNAL(XS_Lucy_Util_Stepper_write_delta) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Stepper* arg_self;
    lucy_OutStream* arg_outstream;
    cfish_Obj* arg_value;
    LUCY_Stepper_Write_Delta_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Stepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STEPPER, LUCY_Stepper_Write_Delta);
    method(arg_self, arg_outstream, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_Stepper_read_key_frame);
XS_INTERNAL(XS_Lucy_Util_Stepper_read_key_frame) {
    dXSARGS;
    SV *sv;
    lucy_Stepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Stepper_Read_Key_Frame_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Stepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STEPPER, LUCY_Stepper_Read_Key_Frame);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_Stepper_read_delta);
XS_INTERNAL(XS_Lucy_Util_Stepper_read_delta) {
    dXSARGS;
    SV *sv;
    lucy_Stepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Stepper_Read_Delta_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Stepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STEPPER, LUCY_Stepper_Read_Delta);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Util_Stepper_read_record);
XS_INTERNAL(XS_Lucy_Util_Stepper_read_record) {
    dXSARGS;
    SV *sv;
    lucy_Stepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Stepper_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Stepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STEPPER, LUCY_Stepper_Read_Record);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_new);
XS_INTERNAL(XS_Lucy_Index_TermStepper_new) {
    dXSARGS;
    lucy_TermStepper* arg_self;
    lucy_TermStepper* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_TermStepper*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TermStepper_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_TermStepper_set_value);
XS_INTERNAL(XS_Lucy_Index_TermStepper_set_value) {
    dXSARGS;
    SV *sv;
    lucy_TermStepper* arg_self;
    cfish_Obj* arg_value;
    LUCY_TermStepper_Set_Value_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [value]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMSTEPPER, NULL);
    sv = ST(1);
    arg_value = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMSTEPPER, LUCY_TermStepper_Set_Value);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_get_value);
XS_INTERNAL(XS_Lucy_Index_TermStepper_get_value) {
    dXSARGS;
    lucy_TermStepper* arg_self;
    LUCY_TermStepper_Get_Value_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMSTEPPER, LUCY_TermStepper_Get_Value);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_DESTROY);
XS_INTERNAL(XS_Lucy_Index_TermStepper_DESTROY) {
    dXSARGS;
    lucy_TermStepper* arg_self;
    LUCY_TermStepper_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMSTEPPER, LUCY_TermStepper_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_new);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_new) {
    dXSARGS;
    lucy_TextTermStepper* arg_self;
    lucy_TextTermStepper* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_TextTermStepper*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TextTermStepper_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_DESTROY);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_DESTROY) {
    dXSARGS;
    lucy_TextTermStepper* arg_self;
    LUCY_TextTermStepper_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_reset);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_reset) {
    dXSARGS;
    lucy_TextTermStepper* arg_self;
    LUCY_TextTermStepper_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_set_value);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_set_value) {
    dXSARGS;
    SV *sv;
    lucy_TextTermStepper* arg_self;
    cfish_Obj* arg_value;
    LUCY_TextTermStepper_Set_Value_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [value]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);
    sv = ST(1);
    arg_value = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Set_Value);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_get_value);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_get_value) {
    dXSARGS;
    lucy_TextTermStepper* arg_self;
    LUCY_TextTermStepper_Get_Value_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Get_Value);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_write_key_frame);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_write_key_frame) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_TextTermStepper* arg_self;
    lucy_OutStream* arg_outstream;
    cfish_Obj* arg_value;
    LUCY_TextTermStepper_Write_Key_Frame_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Write_Key_Frame);
    method(arg_self, arg_outstream, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_write_delta);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_write_delta) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_TextTermStepper* arg_self;
    lucy_OutStream* arg_outstream;
    cfish_Obj* arg_value;
    LUCY_TextTermStepper_Write_Delta_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Write_Delta);
    method(arg_self, arg_outstream, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_read_key_frame);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_read_key_frame) {
    dXSARGS;
    SV *sv;
    lucy_TextTermStepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_TextTermStepper_Read_Key_Frame_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Read_Key_Frame);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_read_delta);
XS_INTERNAL(XS_Lucy_Index_TermStepper_TextTermStepper_read_delta) {
    dXSARGS;
    SV *sv;
    lucy_TextTermStepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_TextTermStepper_Read_Delta_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextTermStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTERMSTEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTERMSTEPPER, LUCY_TextTermStepper_Read_Delta);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_new);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("schema", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_MatchTermInfoStepper* arg_self;
    lucy_Schema* arg_schema;
    lucy_MatchTermInfoStepper* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    arg_self = (lucy_MatchTermInfoStepper*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchTInfoStepper_init(arg_self, arg_schema);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_reset);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_reset) {
    dXSARGS;
    lucy_MatchTermInfoStepper* arg_self;
    LUCY_MatchTInfoStepper_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchTermInfoStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHTERMINFOSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHTERMINFOSTEPPER, LUCY_MatchTInfoStepper_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_write_key_frame);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_write_key_frame) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_MatchTermInfoStepper* arg_self;
    lucy_OutStream* arg_outstream;
    cfish_Obj* arg_value;
    LUCY_MatchTInfoStepper_Write_Key_Frame_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_MatchTermInfoStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHTERMINFOSTEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHTERMINFOSTEPPER, LUCY_MatchTInfoStepper_Write_Key_Frame);
    method(arg_self, arg_outstream, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_write_delta);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_write_delta) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_MatchTermInfoStepper* arg_self;
    lucy_OutStream* arg_outstream;
    cfish_Obj* arg_value;
    LUCY_MatchTInfoStepper_Write_Delta_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_MatchTermInfoStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHTERMINFOSTEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHTERMINFOSTEPPER, LUCY_MatchTInfoStepper_Write_Delta);
    method(arg_self, arg_outstream, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_read_key_frame);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_read_key_frame) {
    dXSARGS;
    SV *sv;
    lucy_MatchTermInfoStepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_MatchTInfoStepper_Read_Key_Frame_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchTermInfoStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHTERMINFOSTEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHTERMINFOSTEPPER, LUCY_MatchTInfoStepper_Read_Key_Frame);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_read_delta);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_read_delta) {
    dXSARGS;
    SV *sv;
    lucy_MatchTermInfoStepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_MatchTInfoStepper_Read_Delta_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchTermInfoStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHTERMINFOSTEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHTERMINFOSTEPPER, LUCY_MatchTInfoStepper_Read_Delta);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_new);
XS_INTERNAL(XS_Lucy_Index_Posting_new) {
    dXSARGS;
    lucy_Posting* arg_self;
    lucy_Posting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Posting*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Post_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_read_raw);
XS_INTERNAL(XS_Lucy_Index_Posting_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("instream", 1),
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Posting* arg_self;
    lucy_InStream* arg_instream;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_Post_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_Posting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTING, NULL);
    sv = ST(locations[0]);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTING, LUCY_Post_Read_Raw);
    retval = method(arg_self, arg_instream, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_add_inversion_to_pool);
XS_INTERNAL(XS_Lucy_Index_Posting_add_inversion_to_pool) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[6] = {
        XSBIND_PARAM("post_pool", 1),
        XSBIND_PARAM("inversion", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("doc_boost", 1),
        XSBIND_PARAM("length_norm", 1)
    };
    int32_t locations[6];
    SV *sv;
    lucy_Posting* arg_self;
    lucy_PostingPool* arg_post_pool;
    lucy_Inversion* arg_inversion;
    lucy_FieldType* arg_type;
    int32_t arg_doc_id;
    float arg_doc_boost;
    float arg_length_norm;
    LUCY_Post_Add_Inversion_To_Pool_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 6);
    arg_self = (lucy_Posting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTING, NULL);
    sv = ST(locations[0]);
    arg_post_pool = (lucy_PostingPool*)XSBind_arg_to_cfish(aTHX_ sv, "post_pool", LUCY_POSTINGPOOL, NULL);
    sv = ST(locations[1]);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);
    sv = ST(locations[2]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_boost");
    }
    arg_doc_boost = (float)SvNV(sv);
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length_norm");
    }
    arg_length_norm = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTING, LUCY_Post_Add_Inversion_To_Pool);
    method(arg_self, arg_post_pool, arg_inversion, arg_type, arg_doc_id, arg_doc_boost, arg_length_norm);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_set_doc_id);
XS_INTERNAL(XS_Lucy_Index_Posting_set_doc_id) {
    dXSARGS;
    SV *sv;
    lucy_Posting* arg_self;
    int32_t arg_doc_id;
    LUCY_Post_Set_Doc_ID_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Posting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTING, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTING, LUCY_Post_Set_Doc_ID);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_get_doc_id);
XS_INTERNAL(XS_Lucy_Index_Posting_get_doc_id) {
    dXSARGS;
    lucy_Posting* arg_self;
    LUCY_Post_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Posting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTING, LUCY_Post_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_make_matcher);
XS_INTERNAL(XS_Lucy_Index_Posting_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("sim", 1),
        XSBIND_PARAM("plist", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Posting* arg_self;
    lucy_Similarity* arg_sim;
    lucy_PostingList* arg_plist;
    lucy_Compiler* arg_compiler;
    bool arg_need_score;
    LUCY_Post_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_Posting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTING, NULL);
    sv = ST(locations[0]);
    arg_sim = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "sim", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_plist = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "plist", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTING, LUCY_Post_Make_Matcher);
    retval = method(arg_self, arg_sim, arg_plist, arg_compiler, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawPosting_compare_to);
XS_INTERNAL(XS_Lucy_Index_RawPosting_compare_to) {
    dXSARGS;
    SV *sv;
    lucy_RawPosting* arg_self;
    cfish_Obj* arg_other;
    LUCY_RawPost_Compare_To_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTING, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTING, LUCY_RawPost_Compare_To);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawPosting_DESTROY);
XS_INTERNAL(XS_Lucy_Index_RawPosting_DESTROY) {
    dXSARGS;
    lucy_RawPosting* arg_self;
    LUCY_RawPost_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTING, LUCY_RawPost_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_new);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("similarity", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_MatchPosting* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_MatchPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    arg_self = (lucy_MatchPosting*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchPost_init(arg_self, arg_similarity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_DESTROY) {
    dXSARGS;
    lucy_MatchPosting* arg_self;
    LUCY_MatchPost_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_get_freq);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_get_freq) {
    dXSARGS;
    lucy_MatchPosting* arg_self;
    LUCY_MatchPost_Get_Freq_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Get_Freq);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_read_record);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_read_record) {
    dXSARGS;
    SV *sv;
    lucy_MatchPosting* arg_self;
    lucy_InStream* arg_instream;
    LUCY_MatchPost_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Read_Record);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_read_raw);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("instream", 1),
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_MatchPosting* arg_self;
    lucy_InStream* arg_instream;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_MatchPost_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);
    sv = ST(locations[0]);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Read_Raw);
    retval = method(arg_self, arg_instream, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_add_inversion_to_pool);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_add_inversion_to_pool) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[6] = {
        XSBIND_PARAM("post_pool", 1),
        XSBIND_PARAM("inversion", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("doc_boost", 1),
        XSBIND_PARAM("length_norm", 1)
    };
    int32_t locations[6];
    SV *sv;
    lucy_MatchPosting* arg_self;
    lucy_PostingPool* arg_post_pool;
    lucy_Inversion* arg_inversion;
    lucy_FieldType* arg_type;
    int32_t arg_doc_id;
    float arg_doc_boost;
    float arg_length_norm;
    LUCY_MatchPost_Add_Inversion_To_Pool_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 6);
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);
    sv = ST(locations[0]);
    arg_post_pool = (lucy_PostingPool*)XSBind_arg_to_cfish(aTHX_ sv, "post_pool", LUCY_POSTINGPOOL, NULL);
    sv = ST(locations[1]);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);
    sv = ST(locations[2]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_boost");
    }
    arg_doc_boost = (float)SvNV(sv);
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length_norm");
    }
    arg_length_norm = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Add_Inversion_To_Pool);
    method(arg_self, arg_post_pool, arg_inversion, arg_type, arg_doc_id, arg_doc_boost, arg_length_norm);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_reset);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_reset) {
    dXSARGS;
    lucy_MatchPosting* arg_self;
    LUCY_MatchPost_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_make_matcher);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPosting_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("sim", 1),
        XSBIND_PARAM("plist", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_MatchPosting* arg_self;
    lucy_Similarity* arg_sim;
    lucy_PostingList* arg_plist;
    lucy_Compiler* arg_compiler;
    bool arg_need_score;
    LUCY_MatchPost_Make_Matcher_t method;
    lucy_MatchPostingMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_MatchPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTING, NULL);
    sv = ST(locations[0]);
    arg_sim = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "sim", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_plist = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "plist", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTING, LUCY_MatchPost_Make_Matcher);
    retval = method(arg_self, arg_sim, arg_plist, arg_compiler, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_new);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("similarity", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_ScorePosting* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_ScorePosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    arg_self = (lucy_ScorePosting*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ScorePost_init(arg_self, arg_similarity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_DESTROY) {
    dXSARGS;
    lucy_ScorePosting* arg_self;
    LUCY_ScorePost_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTING, LUCY_ScorePost_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_read_record);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_read_record) {
    dXSARGS;
    SV *sv;
    lucy_ScorePosting* arg_self;
    lucy_InStream* arg_instream;
    LUCY_ScorePost_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTING, LUCY_ScorePost_Read_Record);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_read_raw);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("instream", 1),
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_ScorePosting* arg_self;
    lucy_InStream* arg_instream;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_ScorePost_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL);
    sv = ST(locations[0]);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTING, LUCY_ScorePost_Read_Raw);
    retval = method(arg_self, arg_instream, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_add_inversion_to_pool);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_add_inversion_to_pool) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[6] = {
        XSBIND_PARAM("post_pool", 1),
        XSBIND_PARAM("inversion", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("doc_boost", 1),
        XSBIND_PARAM("length_norm", 1)
    };
    int32_t locations[6];
    SV *sv;
    lucy_ScorePosting* arg_self;
    lucy_PostingPool* arg_post_pool;
    lucy_Inversion* arg_inversion;
    lucy_FieldType* arg_type;
    int32_t arg_doc_id;
    float arg_doc_boost;
    float arg_length_norm;
    LUCY_ScorePost_Add_Inversion_To_Pool_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 6);
    arg_self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL);
    sv = ST(locations[0]);
    arg_post_pool = (lucy_PostingPool*)XSBind_arg_to_cfish(aTHX_ sv, "post_pool", LUCY_POSTINGPOOL, NULL);
    sv = ST(locations[1]);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);
    sv = ST(locations[2]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_boost");
    }
    arg_doc_boost = (float)SvNV(sv);
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length_norm");
    }
    arg_length_norm = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTING, LUCY_ScorePost_Add_Inversion_To_Pool);
    method(arg_self, arg_post_pool, arg_inversion, arg_type, arg_doc_id, arg_doc_boost, arg_length_norm);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_reset);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_reset) {
    dXSARGS;
    lucy_ScorePosting* arg_self;
    LUCY_ScorePost_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTING, LUCY_ScorePost_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_make_matcher);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePosting_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("sim", 1),
        XSBIND_PARAM("plist", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_ScorePosting* arg_self;
    lucy_Similarity* arg_sim;
    lucy_PostingList* arg_plist;
    lucy_Compiler* arg_compiler;
    bool arg_need_score;
    LUCY_ScorePost_Make_Matcher_t method;
    lucy_ScorePostingMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL);
    sv = ST(locations[0]);
    arg_sim = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "sim", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_plist = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "plist", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTING, LUCY_ScorePost_Make_Matcher);
    retval = method(arg_self, arg_sim, arg_plist, arg_compiler, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_new);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("similarity", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_RichPosting* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_RichPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    arg_self = (lucy_RichPosting*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RichPost_init(arg_self, arg_similarity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_DESTROY) {
    dXSARGS;
    lucy_RichPosting* arg_self;
    LUCY_RichPost_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RichPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RICHPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RICHPOSTING, LUCY_RichPost_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_read_record);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_read_record) {
    dXSARGS;
    SV *sv;
    lucy_RichPosting* arg_self;
    lucy_InStream* arg_instream;
    LUCY_RichPost_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RichPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RICHPOSTING, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RICHPOSTING, LUCY_RichPost_Read_Record);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_read_raw);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("instream", 1),
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_RichPosting* arg_self;
    lucy_InStream* arg_instream;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_RichPost_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_RichPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RICHPOSTING, NULL);
    sv = ST(locations[0]);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RICHPOSTING, LUCY_RichPost_Read_Raw);
    retval = method(arg_self, arg_instream, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_add_inversion_to_pool);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_add_inversion_to_pool) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[6] = {
        XSBIND_PARAM("post_pool", 1),
        XSBIND_PARAM("inversion", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("doc_boost", 1),
        XSBIND_PARAM("length_norm", 1)
    };
    int32_t locations[6];
    SV *sv;
    lucy_RichPosting* arg_self;
    lucy_PostingPool* arg_post_pool;
    lucy_Inversion* arg_inversion;
    lucy_FieldType* arg_type;
    int32_t arg_doc_id;
    float arg_doc_boost;
    float arg_length_norm;
    LUCY_RichPost_Add_Inversion_To_Pool_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 6);
    arg_self = (lucy_RichPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RICHPOSTING, NULL);
    sv = ST(locations[0]);
    arg_post_pool = (lucy_PostingPool*)XSBind_arg_to_cfish(aTHX_ sv, "post_pool", LUCY_POSTINGPOOL, NULL);
    sv = ST(locations[1]);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);
    sv = ST(locations[2]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_boost");
    }
    arg_doc_boost = (float)SvNV(sv);
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length_norm");
    }
    arg_length_norm = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RICHPOSTING, LUCY_RichPost_Add_Inversion_To_Pool);
    method(arg_self, arg_post_pool, arg_inversion, arg_type, arg_doc_id, arg_doc_boost, arg_length_norm);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_make_matcher);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPosting_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("sim", 1),
        XSBIND_PARAM("plist", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_RichPosting* arg_self;
    lucy_Similarity* arg_sim;
    lucy_PostingList* arg_plist;
    lucy_Compiler* arg_compiler;
    bool arg_need_score;
    LUCY_RichPost_Make_Matcher_t method;
    lucy_RichPostingMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_RichPosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RICHPOSTING, NULL);
    sv = ST(locations[0]);
    arg_sim = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "sim", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_plist = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "plist", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RICHPOSTING, LUCY_RichPost_Make_Matcher);
    retval = method(arg_self, arg_sim, arg_plist, arg_compiler, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SkipStepper_read_record);
XS_INTERNAL(XS_Lucy_Index_SkipStepper_read_record) {
    dXSARGS;
    SV *sv;
    lucy_SkipStepper* arg_self;
    lucy_InStream* arg_instream;
    LUCY_SkipStepper_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SkipStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SKIPSTEPPER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SKIPSTEPPER, LUCY_SkipStepper_Read_Record);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SkipStepper_write_record);
XS_INTERNAL(XS_Lucy_Index_SkipStepper_write_record) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("outstream", 1),
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("last_filepos", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_SkipStepper* arg_self;
    lucy_OutStream* arg_outstream;
    int32_t arg_last_doc_id;
    int64_t arg_last_filepos;
    LUCY_SkipStepper_Write_Record_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_SkipStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SKIPSTEPPER, NULL);
    sv = ST(locations[0]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_filepos");
    }
    arg_last_filepos = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SKIPSTEPPER, LUCY_SkipStepper_Write_Record);
    method(arg_self, arg_outstream, arg_last_doc_id, arg_last_filepos);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SkipStepper_set_id_and_filepos);
XS_INTERNAL(XS_Lucy_Index_SkipStepper_set_id_and_filepos) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("filepos", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SkipStepper* arg_self;
    int32_t arg_doc_id;
    int64_t arg_filepos;
    LUCY_SkipStepper_Set_ID_And_Filepos_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SkipStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SKIPSTEPPER, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "filepos");
    }
    arg_filepos = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SKIPSTEPPER, LUCY_SkipStepper_Set_ID_And_Filepos);
    method(arg_self, arg_doc_id, arg_filepos);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SkipStepper_to_string);
XS_INTERNAL(XS_Lucy_Index_SkipStepper_to_string) {
    dXSARGS;
    lucy_SkipStepper* arg_self;
    LUCY_SkipStepper_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SkipStepper*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SKIPSTEPPER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SKIPSTEPPER, LUCY_SkipStepper_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_new);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("max_size", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_PriorityQueue* arg_self;
    uint32_t arg_max_size;
    lucy_PriorityQueue* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "max_size");
    }
    arg_max_size = (uint32_t)SvUV(sv);
    arg_self = (lucy_PriorityQueue*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PriQ_init(arg_self, arg_max_size);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Util_PriorityQueue_less_than);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_less_than) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("a", 1),
        XSBIND_PARAM("b", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PriorityQueue* arg_self;
    cfish_Obj* arg_a;
    cfish_Obj* arg_b;
    LUCY_PriQ_Less_Than_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);
    sv = ST(locations[0]);
    arg_a = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "a", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_b = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "b", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Less_Than);
    retval = method(arg_self, arg_a, arg_b);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_insert);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_insert) {
    dXSARGS;
    SV *sv;
    lucy_PriorityQueue* arg_self;
    cfish_Obj* arg_element;
    LUCY_PriQ_Insert_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, element");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);
    sv = ST(1);
    arg_element = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "element", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Insert);
    arg_element = (cfish_Obj*)CFISH_INCREF(arg_element);
    retval = method(arg_self, arg_element);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_jostle);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_jostle) {
    dXSARGS;
    SV *sv;
    lucy_PriorityQueue* arg_self;
    cfish_Obj* arg_element;
    LUCY_PriQ_Jostle_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, element");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);
    sv = ST(1);
    arg_element = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "element", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Jostle);
    arg_element = (cfish_Obj*)CFISH_INCREF(arg_element);
    retval = method(arg_self, arg_element);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_pop);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_pop) {
    dXSARGS;
    lucy_PriorityQueue* arg_self;
    LUCY_PriQ_Pop_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Pop);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_pop_all);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_pop_all) {
    dXSARGS;
    lucy_PriorityQueue* arg_self;
    LUCY_PriQ_Pop_All_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Pop_All);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_peek);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_peek) {
    dXSARGS;
    lucy_PriorityQueue* arg_self;
    LUCY_PriQ_Peek_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Peek);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_get_size);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_get_size) {
    dXSARGS;
    lucy_PriorityQueue* arg_self;
    LUCY_PriQ_Get_Size_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Get_Size);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Util_PriorityQueue_DESTROY);
XS_INTERNAL(XS_Lucy_Util_PriorityQueue_DESTROY) {
    dXSARGS;
    lucy_PriorityQueue* arg_self;
    LUCY_PriQ_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PriorityQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PRIORITYQUEUE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PRIORITYQUEUE, LUCY_PriQ_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_HitQueue_new);
XS_INTERNAL(XS_Lucy_Search_HitQueue_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("sort_spec", 0),
        XSBIND_PARAM("wanted", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_HitQueue* arg_self;
    lucy_Schema* arg_schema;
    lucy_SortSpec* arg_sort_spec;
    uint32_t arg_wanted;
    lucy_HitQueue* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_sort_spec = locations[1] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "wanted");
    }
    arg_wanted = (uint32_t)SvUV(sv);
    arg_self = (lucy_HitQueue*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_HitQ_init(arg_self, arg_schema, arg_sort_spec, arg_wanted);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_HitQueue_DESTROY);
XS_INTERNAL(XS_Lucy_Search_HitQueue_DESTROY) {
    dXSARGS;
    lucy_HitQueue* arg_self;
    LUCY_HitQ_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITQUEUE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITQUEUE, LUCY_HitQ_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_HitQueue_jostle);
XS_INTERNAL(XS_Lucy_Search_HitQueue_jostle) {
    dXSARGS;
    SV *sv;
    lucy_HitQueue* arg_self;
    cfish_Obj* arg_element;
    LUCY_HitQ_Jostle_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, element");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITQUEUE, NULL);
    sv = ST(1);
    arg_element = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "element", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITQUEUE, LUCY_HitQ_Jostle);
    arg_element = (cfish_Obj*)CFISH_INCREF(arg_element);
    retval = method(arg_self, arg_element);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_HitQueue_less_than);
XS_INTERNAL(XS_Lucy_Search_HitQueue_less_than) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("a", 1),
        XSBIND_PARAM("b", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_HitQueue* arg_self;
    cfish_Obj* arg_a;
    cfish_Obj* arg_b;
    LUCY_HitQ_Less_Than_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_HitQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITQUEUE, NULL);
    sv = ST(locations[0]);
    arg_a = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "a", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_b = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "b", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITQUEUE, LUCY_HitQ_Less_Than);
    retval = method(arg_self, arg_a, arg_b);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexQueue_less_than);
XS_INTERNAL(XS_Lucy_Index_SegLexQueue_less_than) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("a", 1),
        XSBIND_PARAM("b", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegLexQueue* arg_self;
    cfish_Obj* arg_a;
    cfish_Obj* arg_b;
    LUCY_SegLexQ_Less_Than_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegLexQueue*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXQUEUE, NULL);
    sv = ST(locations[0]);
    arg_a = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "a", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_b = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "b", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXQUEUE, LUCY_SegLexQ_Less_Than);
    retval = method(arg_self, arg_a, arg_b);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_new);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("excerpt_length", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Highlighter* arg_self;
    lucy_Searcher* arg_searcher;
    cfish_Obj* arg_query;
    cfish_String* arg_field;
    uint32_t arg_excerpt_length;
    lucy_Highlighter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_query = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "query", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_excerpt_length = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 200;
    arg_self = (lucy_Highlighter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Highlighter_init(arg_self, arg_searcher, arg_query, arg_field, arg_excerpt_length);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Highlight_Highlighter_create_excerpt);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_create_excerpt) {
    dXSARGS;
    SV *sv;
    lucy_Highlighter* arg_self;
    lucy_HitDoc* arg_hit_doc;
    LUCY_Highlighter_Create_Excerpt_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, hit_doc");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);
    sv = ST(1);
    arg_hit_doc = (lucy_HitDoc*)XSBind_arg_to_cfish(aTHX_ sv, "hit_doc", LUCY_HITDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Create_Excerpt);
    retval = method(arg_self, arg_hit_doc);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_encode);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_encode) {
    dXSARGS;
    SV *sv;
    lucy_Highlighter* arg_self;
    cfish_String* arg_text;
    LUCY_Highlighter_Encode_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Encode);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_highlight);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_highlight) {
    dXSARGS;
    SV *sv;
    lucy_Highlighter* arg_self;
    cfish_String* arg_text;
    LUCY_Highlighter_Highlight_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, text");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);
    sv = ST(1);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Highlight);
    retval = method(arg_self, arg_text);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_set_pre_tag);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_set_pre_tag) {
    dXSARGS;
    SV *sv;
    lucy_Highlighter* arg_self;
    cfish_String* arg_pre_tag;
    LUCY_Highlighter_Set_Pre_Tag_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, pre_tag");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);
    sv = ST(1);
    arg_pre_tag = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "pre_tag", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Set_Pre_Tag);
    method(arg_self, arg_pre_tag);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_set_post_tag);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_set_post_tag) {
    dXSARGS;
    SV *sv;
    lucy_Highlighter* arg_self;
    cfish_String* arg_post_tag;
    LUCY_Highlighter_Set_Post_Tag_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, post_tag");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);
    sv = ST(1);
    arg_post_tag = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "post_tag", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Set_Post_Tag);
    method(arg_self, arg_post_tag);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_pre_tag);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_pre_tag) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Pre_Tag_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Pre_Tag);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_post_tag);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_post_tag) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Post_Tag_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Post_Tag);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_field);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_field) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_excerpt_length);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_excerpt_length) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Excerpt_Length_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Excerpt_Length);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_searcher);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_searcher) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Searcher_t method;
    lucy_Searcher* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Searcher);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_query);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_query) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Query);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_compiler);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_get_compiler) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Get_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Get_Compiler);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter__highlight_excerpt);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter__highlight_excerpt) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("spans", 1),
        XSBIND_PARAM("raw_excerpt", 1),
        XSBIND_PARAM("top", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Highlighter* arg_self;
    cfish_Vector* arg_spans;
    cfish_String* arg_raw_excerpt;
    int32_t arg_top;
    LUCY_Highlighter_Highlight_Excerpt_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);
    sv = ST(locations[0]);
    arg_spans = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "spans", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_raw_excerpt = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "raw_excerpt", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "top");
    }
    arg_top = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Highlight_Excerpt);
    retval = method(arg_self, arg_spans, arg_raw_excerpt, arg_top);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_Highlighter_DESTROY);
XS_INTERNAL(XS_Lucy_Highlight_Highlighter_DESTROY) {
    dXSARGS;
    lucy_Highlighter* arg_self;
    LUCY_Highlighter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Highlighter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTER, LUCY_Highlighter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Highlight_HeatMap_new);
XS_INTERNAL(XS_Lucy_Highlight_HeatMap_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("spans", 1),
        XSBIND_PARAM("window", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_HeatMap* arg_self;
    cfish_Vector* arg_spans;
    uint32_t arg_window;
    lucy_HeatMap* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_spans = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "spans", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_window = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 133;
    arg_self = (lucy_HeatMap*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_HeatMap_init(arg_self, arg_spans, arg_window);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Highlight_HeatMap_flatten_spans);
XS_INTERNAL(XS_Lucy_Highlight_HeatMap_flatten_spans) {
    dXSARGS;
    SV *sv;
    lucy_HeatMap* arg_self;
    cfish_Vector* arg_spans;
    LUCY_HeatMap_Flatten_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, spans");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HeatMap*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HEATMAP, NULL);
    sv = ST(1);
    arg_spans = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "spans", CFISH_VECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HEATMAP, LUCY_HeatMap_Flatten_Spans);
    retval = method(arg_self, arg_spans);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_HeatMap_calc_proximity_boost);
XS_INTERNAL(XS_Lucy_Highlight_HeatMap_calc_proximity_boost) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("span1", 1),
        XSBIND_PARAM("span2", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_HeatMap* arg_self;
    lucy_Span* arg_span1;
    lucy_Span* arg_span2;
    LUCY_HeatMap_Calc_Proximity_Boost_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_HeatMap*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HEATMAP, NULL);
    sv = ST(locations[0]);
    arg_span1 = (lucy_Span*)XSBind_arg_to_cfish(aTHX_ sv, "span1", LUCY_SPAN, NULL);
    sv = ST(locations[1]);
    arg_span2 = (lucy_Span*)XSBind_arg_to_cfish(aTHX_ sv, "span2", LUCY_SPAN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HEATMAP, LUCY_HeatMap_Calc_Proximity_Boost);
    retval = method(arg_self, arg_span1, arg_span2);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_HeatMap_generate_proximity_boosts);
XS_INTERNAL(XS_Lucy_Highlight_HeatMap_generate_proximity_boosts) {
    dXSARGS;
    SV *sv;
    lucy_HeatMap* arg_self;
    cfish_Vector* arg_spans;
    LUCY_HeatMap_Generate_Proximity_Boosts_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, spans");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HeatMap*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HEATMAP, NULL);
    sv = ST(1);
    arg_spans = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "spans", CFISH_VECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HEATMAP, LUCY_HeatMap_Generate_Proximity_Boosts);
    retval = method(arg_self, arg_spans);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_HeatMap_get_spans);
XS_INTERNAL(XS_Lucy_Highlight_HeatMap_get_spans) {
    dXSARGS;
    lucy_HeatMap* arg_self;
    LUCY_HeatMap_Get_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HeatMap*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HEATMAP, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HEATMAP, LUCY_HeatMap_Get_Spans);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Highlight_HeatMap_DESTROY);
XS_INTERNAL(XS_Lucy_Highlight_HeatMap_DESTROY) {
    dXSARGS;
    lucy_HeatMap* arg_self;
    LUCY_HeatMap_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HeatMap*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HEATMAP, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HEATMAP, LUCY_HeatMap_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_new);
XS_INTERNAL(XS_Lucy_Plan_FieldType_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_FieldType* arg_self;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    lucy_FieldType* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[1]);
    arg_indexed = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    sv = ST(locations[2]);
    arg_stored = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    sv = ST(locations[3]);
    arg_sortable = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_FieldType*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FType_init2(arg_self, arg_boost, arg_indexed, arg_stored, arg_sortable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_FieldType_set_boost);
XS_INTERNAL(XS_Lucy_Plan_FieldType_set_boost) {
    dXSARGS;
    SV *sv;
    lucy_FieldType* arg_self;
    float arg_boost;
    LUCY_FType_Set_Boost_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, boost");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Set_Boost);
    method(arg_self, arg_boost);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_get_boost);
XS_INTERNAL(XS_Lucy_Plan_FieldType_get_boost) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Get_Boost_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Get_Boost);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_set_indexed);
XS_INTERNAL(XS_Lucy_Plan_FieldType_set_indexed) {
    dXSARGS;
    SV *sv;
    lucy_FieldType* arg_self;
    bool arg_indexed;
    LUCY_FType_Set_Indexed_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, indexed");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "indexed");
    }
    arg_indexed = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Set_Indexed);
    method(arg_self, arg_indexed);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_indexed);
XS_INTERNAL(XS_Lucy_Plan_FieldType_indexed) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Indexed_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Indexed);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_set_stored);
XS_INTERNAL(XS_Lucy_Plan_FieldType_set_stored) {
    dXSARGS;
    SV *sv;
    lucy_FieldType* arg_self;
    bool arg_stored;
    LUCY_FType_Set_Stored_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, stored");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "stored");
    }
    arg_stored = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Set_Stored);
    method(arg_self, arg_stored);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_stored);
XS_INTERNAL(XS_Lucy_Plan_FieldType_stored) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Stored_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Stored);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_set_sortable);
XS_INTERNAL(XS_Lucy_Plan_FieldType_set_sortable) {
    dXSARGS;
    SV *sv;
    lucy_FieldType* arg_self;
    bool arg_sortable;
    LUCY_FType_Set_Sortable_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, sortable");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "sortable");
    }
    arg_sortable = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Set_Sortable);
    method(arg_self, arg_sortable);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_sortable);
XS_INTERNAL(XS_Lucy_Plan_FieldType_sortable) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Sortable_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Sortable);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_binary);
XS_INTERNAL(XS_Lucy_Plan_FieldType_binary) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Binary_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Binary);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_compare_values);
XS_INTERNAL(XS_Lucy_Plan_FieldType_compare_values) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("a", 1),
        XSBIND_PARAM("b", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FieldType* arg_self;
    cfish_Obj* arg_a;
    cfish_Obj* arg_b;
    LUCY_FType_Compare_Values_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(locations[0]);
    arg_a = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "a", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_b = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "b", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Compare_Values);
    retval = method(arg_self, arg_a, arg_b);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_make_term_stepper);
XS_INTERNAL(XS_Lucy_Plan_FieldType_make_term_stepper) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Make_Term_Stepper_t method;
    lucy_TermStepper* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Make_Term_Stepper);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_FieldType_primitive_id) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_dump_for_schema);
XS_INTERNAL(XS_Lucy_Plan_FieldType_dump_for_schema) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Dump_For_Schema_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Dump_For_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_dump);
XS_INTERNAL(XS_Lucy_Plan_FieldType_dump) {
    dXSARGS;
    lucy_FieldType* arg_self;
    LUCY_FType_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_load);
XS_INTERNAL(XS_Lucy_Plan_FieldType_load) {
    dXSARGS;
    SV *sv;
    lucy_FieldType* arg_self;
    cfish_Obj* arg_dump;
    LUCY_FType_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FieldType_equals);
XS_INTERNAL(XS_Lucy_Plan_FieldType_equals) {
    dXSARGS;
    SV *sv;
    lucy_FieldType* arg_self;
    cfish_Obj* arg_other;
    LUCY_FType_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FieldType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FIELDTYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FIELDTYPE, LUCY_FType_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_NumericType_new);
XS_INTERNAL(XS_Lucy_Plan_NumericType_new) {
    dXSARGS;
    lucy_NumericType* arg_self;
    lucy_NumericType* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_NumericType*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NumType_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_NumericType_binary);
XS_INTERNAL(XS_Lucy_Plan_NumericType_binary) {
    dXSARGS;
    lucy_NumericType* arg_self;
    LUCY_NumType_Binary_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NumericType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NUMERICTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NUMERICTYPE, LUCY_NumType_Binary);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_NumericType_specifier);
XS_INTERNAL(XS_Lucy_Plan_NumericType_specifier) {
    dXSARGS;
    lucy_NumericType* arg_self;
    LUCY_NumType_Specifier_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NumericType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NUMERICTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NUMERICTYPE, LUCY_NumType_Specifier);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_NumericType_dump_for_schema);
XS_INTERNAL(XS_Lucy_Plan_NumericType_dump_for_schema) {
    dXSARGS;
    lucy_NumericType* arg_self;
    LUCY_NumType_Dump_For_Schema_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NumericType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NUMERICTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NUMERICTYPE, LUCY_NumType_Dump_For_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_NumericType_dump);
XS_INTERNAL(XS_Lucy_Plan_NumericType_dump) {
    dXSARGS;
    lucy_NumericType* arg_self;
    LUCY_NumType_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NumericType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NUMERICTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NUMERICTYPE, LUCY_NumType_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_NumericType_load);
XS_INTERNAL(XS_Lucy_Plan_NumericType_load) {
    dXSARGS;
    SV *sv;
    lucy_NumericType* arg_self;
    cfish_Obj* arg_dump;
    LUCY_NumType_Load_t method;
    lucy_NumericType* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NumericType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NUMERICTYPE, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NUMERICTYPE, LUCY_NumType_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Float64Type_new);
XS_INTERNAL(XS_Lucy_Plan_Float64Type_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Float64Type* arg_self;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    lucy_Float64Type* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[1]);
    arg_indexed = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[2]);
    arg_stored = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[3]);
    arg_sortable = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    arg_self = (lucy_Float64Type*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Float64Type_init2(arg_self, arg_boost, arg_indexed, arg_stored, arg_sortable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_Float64Type_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_Float64Type_primitive_id) {
    dXSARGS;
    lucy_Float64Type* arg_self;
    LUCY_Float64Type_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Float64Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FLOAT64TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FLOAT64TYPE, LUCY_Float64Type_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Float64Type_specifier);
XS_INTERNAL(XS_Lucy_Plan_Float64Type_specifier) {
    dXSARGS;
    lucy_Float64Type* arg_self;
    LUCY_Float64Type_Specifier_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Float64Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FLOAT64TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FLOAT64TYPE, LUCY_Float64Type_Specifier);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Float64Type_equals);
XS_INTERNAL(XS_Lucy_Plan_Float64Type_equals) {
    dXSARGS;
    SV *sv;
    lucy_Float64Type* arg_self;
    cfish_Obj* arg_other;
    LUCY_Float64Type_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Float64Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FLOAT64TYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FLOAT64TYPE, LUCY_Float64Type_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Float32Type_new);
XS_INTERNAL(XS_Lucy_Plan_Float32Type_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Float32Type* arg_self;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    lucy_Float32Type* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[1]);
    arg_indexed = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[2]);
    arg_stored = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[3]);
    arg_sortable = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_Float32Type*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Float32Type_init2(arg_self, arg_boost, arg_indexed, arg_stored, arg_sortable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_Float32Type_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_Float32Type_primitive_id) {
    dXSARGS;
    lucy_Float32Type* arg_self;
    LUCY_Float32Type_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Float32Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FLOAT32TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FLOAT32TYPE, LUCY_Float32Type_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Float32Type_specifier);
XS_INTERNAL(XS_Lucy_Plan_Float32Type_specifier) {
    dXSARGS;
    lucy_Float32Type* arg_self;
    LUCY_Float32Type_Specifier_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Float32Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FLOAT32TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FLOAT32TYPE, LUCY_Float32Type_Specifier);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Float32Type_equals);
XS_INTERNAL(XS_Lucy_Plan_Float32Type_equals) {
    dXSARGS;
    SV *sv;
    lucy_Float32Type* arg_self;
    cfish_Obj* arg_other;
    LUCY_Float32Type_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Float32Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FLOAT32TYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FLOAT32TYPE, LUCY_Float32Type_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Int32Type_new);
XS_INTERNAL(XS_Lucy_Plan_Int32Type_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Int32Type* arg_self;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    lucy_Int32Type* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[1]);
    arg_indexed = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[2]);
    arg_stored = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[3]);
    arg_sortable = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_Int32Type*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Int32Type_init2(arg_self, arg_boost, arg_indexed, arg_stored, arg_sortable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_Int32Type_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_Int32Type_primitive_id) {
    dXSARGS;
    lucy_Int32Type* arg_self;
    LUCY_Int32Type_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Int32Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INT32TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INT32TYPE, LUCY_Int32Type_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Int32Type_specifier);
XS_INTERNAL(XS_Lucy_Plan_Int32Type_specifier) {
    dXSARGS;
    lucy_Int32Type* arg_self;
    LUCY_Int32Type_Specifier_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Int32Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INT32TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INT32TYPE, LUCY_Int32Type_Specifier);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Int32Type_equals);
XS_INTERNAL(XS_Lucy_Plan_Int32Type_equals) {
    dXSARGS;
    SV *sv;
    lucy_Int32Type* arg_self;
    cfish_Obj* arg_other;
    LUCY_Int32Type_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Int32Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INT32TYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INT32TYPE, LUCY_Int32Type_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Int64Type_new);
XS_INTERNAL(XS_Lucy_Plan_Int64Type_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Int64Type* arg_self;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    lucy_Int64Type* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[1]);
    arg_indexed = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[2]);
    arg_stored = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[3]);
    arg_sortable = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_Int64Type*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Int64Type_init2(arg_self, arg_boost, arg_indexed, arg_stored, arg_sortable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_Int64Type_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_Int64Type_primitive_id) {
    dXSARGS;
    lucy_Int64Type* arg_self;
    LUCY_Int64Type_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Int64Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INT64TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INT64TYPE, LUCY_Int64Type_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Int64Type_specifier);
XS_INTERNAL(XS_Lucy_Plan_Int64Type_specifier) {
    dXSARGS;
    lucy_Int64Type* arg_self;
    LUCY_Int64Type_Specifier_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Int64Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INT64TYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INT64TYPE, LUCY_Int64Type_Specifier);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Int64Type_equals);
XS_INTERNAL(XS_Lucy_Plan_Int64Type_equals) {
    dXSARGS;
    SV *sv;
    lucy_Int64Type* arg_self;
    cfish_Obj* arg_other;
    LUCY_Int64Type_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Int64Type*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INT64TYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INT64TYPE, LUCY_Int64Type_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_new);
XS_INTERNAL(XS_Lucy_Plan_BlobType_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("stored", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_BlobType* arg_self;
    bool arg_stored;
    lucy_BlobType* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "stored");
    }
    arg_stored = XSBind_sv_true(aTHX_ sv);
    arg_self = (lucy_BlobType*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BlobType_init(arg_self, arg_stored);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_BlobType_binary);
XS_INTERNAL(XS_Lucy_Plan_BlobType_binary) {
    dXSARGS;
    lucy_BlobType* arg_self;
    LUCY_BlobType_Binary_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Binary);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_set_sortable);
XS_INTERNAL(XS_Lucy_Plan_BlobType_set_sortable) {
    dXSARGS;
    SV *sv;
    lucy_BlobType* arg_self;
    bool arg_sortable;
    LUCY_BlobType_Set_Sortable_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, sortable");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "sortable");
    }
    arg_sortable = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Set_Sortable);
    method(arg_self, arg_sortable);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_BlobType_primitive_id) {
    dXSARGS;
    lucy_BlobType* arg_self;
    LUCY_BlobType_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_dump_for_schema);
XS_INTERNAL(XS_Lucy_Plan_BlobType_dump_for_schema) {
    dXSARGS;
    lucy_BlobType* arg_self;
    LUCY_BlobType_Dump_For_Schema_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Dump_For_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_dump);
XS_INTERNAL(XS_Lucy_Plan_BlobType_dump) {
    dXSARGS;
    lucy_BlobType* arg_self;
    LUCY_BlobType_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_load);
XS_INTERNAL(XS_Lucy_Plan_BlobType_load) {
    dXSARGS;
    SV *sv;
    lucy_BlobType* arg_self;
    cfish_Obj* arg_dump;
    LUCY_BlobType_Load_t method;
    lucy_BlobType* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_BlobType_equals);
XS_INTERNAL(XS_Lucy_Plan_BlobType_equals) {
    dXSARGS;
    SV *sv;
    lucy_BlobType* arg_self;
    cfish_Obj* arg_other;
    LUCY_BlobType_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BlobType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BLOBTYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BLOBTYPE, LUCY_BlobType_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_TextType_make_term_stepper);
XS_INTERNAL(XS_Lucy_Plan_TextType_make_term_stepper) {
    dXSARGS;
    lucy_TextType* arg_self;
    LUCY_TextType_Make_Term_Stepper_t method;
    lucy_TermStepper* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTYPE, LUCY_TextType_Make_Term_Stepper);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_TextType_primitive_id);
XS_INTERNAL(XS_Lucy_Plan_TextType_primitive_id) {
    dXSARGS;
    lucy_TextType* arg_self;
    LUCY_TextType_Primitive_ID_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTTYPE, LUCY_TextType_Primitive_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_new);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[6] = {
        XSBIND_PARAM("analyzer", 1),
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0),
        XSBIND_PARAM("highlightable", 0)
    };
    int32_t locations[6];
    SV *sv;
    lucy_FullTextType* arg_self;
    lucy_Analyzer* arg_analyzer;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    bool arg_highlightable;
    lucy_FullTextType* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 6);
    sv = ST(locations[0]);
    arg_analyzer = (lucy_Analyzer*)XSBind_arg_to_cfish(aTHX_ sv, "analyzer", LUCY_ANALYZER, NULL);
    sv = ST(locations[1]);
    arg_boost = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[2]);
    arg_indexed = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[3]);
    arg_stored = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[4]);
    arg_sortable = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    sv = ST(locations[5]);
    arg_highlightable = locations[5] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_FullTextType*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FullTextType_init2(arg_self, arg_analyzer, arg_boost, arg_indexed, arg_stored, arg_sortable, arg_highlightable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_FullTextType_set_highlightable);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_set_highlightable) {
    dXSARGS;
    SV *sv;
    lucy_FullTextType* arg_self;
    bool arg_highlightable;
    LUCY_FullTextType_Set_Highlightable_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, highlightable");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "highlightable");
    }
    arg_highlightable = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Set_Highlightable);
    method(arg_self, arg_highlightable);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_highlightable);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_highlightable) {
    dXSARGS;
    lucy_FullTextType* arg_self;
    LUCY_FullTextType_Highlightable_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Highlightable);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_get_analyzer);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_get_analyzer) {
    dXSARGS;
    lucy_FullTextType* arg_self;
    LUCY_FullTextType_Get_Analyzer_t method;
    lucy_Analyzer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Get_Analyzer);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_make_similarity);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_make_similarity) {
    dXSARGS;
    lucy_FullTextType* arg_self;
    LUCY_FullTextType_Make_Similarity_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Make_Similarity);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_dump_for_schema);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_dump_for_schema) {
    dXSARGS;
    lucy_FullTextType* arg_self;
    LUCY_FullTextType_Dump_For_Schema_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Dump_For_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_dump);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_dump) {
    dXSARGS;
    lucy_FullTextType* arg_self;
    LUCY_FullTextType_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_load);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_load) {
    dXSARGS;
    SV *sv;
    lucy_FullTextType* arg_self;
    cfish_Obj* arg_dump;
    LUCY_FullTextType_Load_t method;
    lucy_FullTextType* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_equals);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_equals) {
    dXSARGS;
    SV *sv;
    lucy_FullTextType* arg_self;
    cfish_Obj* arg_other;
    LUCY_FullTextType_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_FullTextType_DESTROY);
XS_INTERNAL(XS_Lucy_Plan_FullTextType_DESTROY) {
    dXSARGS;
    lucy_FullTextType* arg_self;
    LUCY_FullTextType_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FullTextType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FULLTEXTTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FULLTEXTTYPE, LUCY_FullTextType_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_StringType_new);
XS_INTERNAL(XS_Lucy_Plan_StringType_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("boost", 0),
        XSBIND_PARAM("indexed", 0),
        XSBIND_PARAM("stored", 0),
        XSBIND_PARAM("sortable", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_StringType* arg_self;
    float arg_boost;
    bool arg_indexed;
    bool arg_stored;
    bool arg_sortable;
    lucy_StringType* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    sv = ST(locations[1]);
    arg_indexed = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[2]);
    arg_stored = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[3]);
    arg_sortable = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_StringType*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_StringType_init2(arg_self, arg_boost, arg_indexed, arg_stored, arg_sortable);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_StringType_make_similarity);
XS_INTERNAL(XS_Lucy_Plan_StringType_make_similarity) {
    dXSARGS;
    lucy_StringType* arg_self;
    LUCY_StringType_Make_Similarity_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StringType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STRINGTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STRINGTYPE, LUCY_StringType_Make_Similarity);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_StringType_dump_for_schema);
XS_INTERNAL(XS_Lucy_Plan_StringType_dump_for_schema) {
    dXSARGS;
    lucy_StringType* arg_self;
    LUCY_StringType_Dump_For_Schema_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StringType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STRINGTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STRINGTYPE, LUCY_StringType_Dump_For_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_StringType_dump);
XS_INTERNAL(XS_Lucy_Plan_StringType_dump) {
    dXSARGS;
    lucy_StringType* arg_self;
    LUCY_StringType_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StringType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STRINGTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STRINGTYPE, LUCY_StringType_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_StringType_load);
XS_INTERNAL(XS_Lucy_Plan_StringType_load) {
    dXSARGS;
    SV *sv;
    lucy_StringType* arg_self;
    cfish_Obj* arg_dump;
    LUCY_StringType_Load_t method;
    lucy_StringType* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StringType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STRINGTYPE, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STRINGTYPE, LUCY_StringType_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_StringType_equals);
XS_INTERNAL(XS_Lucy_Plan_StringType_equals) {
    dXSARGS;
    SV *sv;
    lucy_StringType* arg_self;
    cfish_Obj* arg_other;
    LUCY_StringType_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_StringType*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_STRINGTYPE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_STRINGTYPE, LUCY_StringType_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_new);
XS_INTERNAL(XS_Lucy_Plan_Schema_new) {
    dXSARGS;
    lucy_Schema* arg_self;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Schema*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Schema_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_Schema_architecture);
XS_INTERNAL(XS_Lucy_Plan_Schema_architecture) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_Architecture_t method;
    lucy_Architecture* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Architecture);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_spec_field);
XS_INTERNAL(XS_Lucy_Plan_Schema_spec_field) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("type", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Schema* arg_self;
    cfish_String* arg_name;
    lucy_FieldType* arg_type;
    LUCY_Schema_Spec_Field_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Spec_Field);
    method(arg_self, arg_name, arg_type);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_fetch_type);
XS_INTERNAL(XS_Lucy_Plan_Schema_fetch_type) {
    dXSARGS;
    SV *sv;
    lucy_Schema* arg_self;
    cfish_String* arg_field;
    LUCY_Schema_Fetch_Type_t method;
    lucy_FieldType* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Fetch_Type);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_fetch_analyzer);
XS_INTERNAL(XS_Lucy_Plan_Schema_fetch_analyzer) {
    dXSARGS;
    SV *sv;
    lucy_Schema* arg_self;
    cfish_String* arg_field;
    LUCY_Schema_Fetch_Analyzer_t method;
    lucy_Analyzer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [field]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(1);
    arg_field = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Fetch_Analyzer);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_fetch_sim);
XS_INTERNAL(XS_Lucy_Plan_Schema_fetch_sim) {
    dXSARGS;
    SV *sv;
    lucy_Schema* arg_self;
    cfish_String* arg_field;
    LUCY_Schema_Fetch_Sim_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [field]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(1);
    arg_field = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Fetch_Sim);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_num_fields);
XS_INTERNAL(XS_Lucy_Plan_Schema_num_fields) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_Num_Fields_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Num_Fields);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_all_fields);
XS_INTERNAL(XS_Lucy_Plan_Schema_all_fields) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_All_Fields_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_All_Fields);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_get_architecture);
XS_INTERNAL(XS_Lucy_Plan_Schema_get_architecture) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_Get_Architecture_t method;
    lucy_Architecture* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Get_Architecture);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_get_similarity);
XS_INTERNAL(XS_Lucy_Plan_Schema_get_similarity) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_Get_Similarity_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Get_Similarity);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_dump);
XS_INTERNAL(XS_Lucy_Plan_Schema_dump) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_load);
XS_INTERNAL(XS_Lucy_Plan_Schema_load) {
    dXSARGS;
    SV *sv;
    lucy_Schema* arg_self;
    cfish_Obj* arg_dump;
    LUCY_Schema_Load_t method;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_eat);
XS_INTERNAL(XS_Lucy_Plan_Schema_eat) {
    dXSARGS;
    SV *sv;
    lucy_Schema* arg_self;
    lucy_Schema* arg_other;
    LUCY_Schema_Eat_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(1);
    arg_other = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "other", LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Eat);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_write);
XS_INTERNAL(XS_Lucy_Plan_Schema_write) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("filename", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Schema* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_filename;
    LUCY_Schema_Write_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_filename = locations[1] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "filename", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Write);
    method(arg_self, arg_folder, arg_filename);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Schema_DESTROY);
XS_INTERNAL(XS_Lucy_Plan_Schema_DESTROY) {
    dXSARGS;
    lucy_Schema* arg_self;
    LUCY_Schema_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Schema*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCHEMA, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCHEMA, LUCY_Schema_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_new);
XS_INTERNAL(XS_Lucy_Plan_Architecture_new) {
    dXSARGS;
    lucy_Architecture* arg_self;
    lucy_Architecture* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Architecture*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Arch_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Plan_Architecture_init_seg_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_init_seg_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Init_Seg_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Init_Seg_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_lexicon_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_lexicon_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Register_Lexicon_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Lexicon_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_posting_list_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_posting_list_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Register_Posting_List_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Posting_List_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_doc_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_doc_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Register_Doc_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Doc_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_sort_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_sort_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Register_Sort_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Sort_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_highlight_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_highlight_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Register_Highlight_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Highlight_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_deletions_writer);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_deletions_writer) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegWriter* arg_writer;
    LUCY_Arch_Register_Deletions_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_writer = (lucy_SegWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Deletions_Writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_init_seg_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_init_seg_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Init_Seg_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Init_Seg_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_doc_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_doc_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Register_Doc_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Doc_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_posting_list_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_posting_list_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Register_Posting_List_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Posting_List_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_sort_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_sort_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Register_Sort_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Sort_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_highlight_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_highlight_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Register_Highlight_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Highlight_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_lexicon_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_lexicon_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Register_Lexicon_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Lexicon_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_register_deletions_reader);
XS_INTERNAL(XS_Lucy_Plan_Architecture_register_deletions_reader) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Arch_Register_Deletions_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Register_Deletions_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_make_similarity);
XS_INTERNAL(XS_Lucy_Plan_Architecture_make_similarity) {
    dXSARGS;
    lucy_Architecture* arg_self;
    LUCY_Arch_Make_Similarity_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Make_Similarity);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_index_interval);
XS_INTERNAL(XS_Lucy_Plan_Architecture_index_interval) {
    dXSARGS;
    lucy_Architecture* arg_self;
    LUCY_Arch_Index_Interval_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Index_Interval);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_skip_interval);
XS_INTERNAL(XS_Lucy_Plan_Architecture_skip_interval) {
    dXSARGS;
    lucy_Architecture* arg_self;
    LUCY_Arch_Skip_Interval_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Skip_Interval);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Plan_Architecture_equals);
XS_INTERNAL(XS_Lucy_Plan_Architecture_equals) {
    dXSARGS;
    SV *sv;
    lucy_Architecture* arg_self;
    cfish_Obj* arg_other;
    LUCY_Arch_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Architecture*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ARCHITECTURE, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ARCHITECTURE, LUCY_Arch_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_set_doc_id);
XS_INTERNAL(XS_Lucy_Document_Doc_set_doc_id) {
    dXSARGS;
    SV *sv;
    lucy_Doc* arg_self;
    int32_t arg_doc_id;
    LUCY_Doc_Set_Doc_ID_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Set_Doc_ID);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Document_Doc_get_doc_id);
XS_INTERNAL(XS_Lucy_Document_Doc_get_doc_id) {
    dXSARGS;
    lucy_Doc* arg_self;
    LUCY_Doc_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_get_size);
XS_INTERNAL(XS_Lucy_Document_Doc_get_size) {
    dXSARGS;
    lucy_Doc* arg_self;
    LUCY_Doc_Get_Size_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Get_Size);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_extract);
XS_INTERNAL(XS_Lucy_Document_Doc_extract) {
    dXSARGS;
    SV *sv;
    lucy_Doc* arg_self;
    cfish_String* arg_field;
    LUCY_Doc_Extract_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Extract);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_field_names);
XS_INTERNAL(XS_Lucy_Document_Doc_field_names) {
    dXSARGS;
    lucy_Doc* arg_self;
    LUCY_Doc_Field_Names_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Field_Names);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_equals);
XS_INTERNAL(XS_Lucy_Document_Doc_equals) {
    dXSARGS;
    SV *sv;
    lucy_Doc* arg_self;
    cfish_Obj* arg_other;
    LUCY_Doc_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_serialize);
XS_INTERNAL(XS_Lucy_Document_Doc_serialize) {
    dXSARGS;
    SV *sv;
    lucy_Doc* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_Doc_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Document_Doc_deserialize);
XS_INTERNAL(XS_Lucy_Document_Doc_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_Doc* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Doc_Deserialize_t method;
    lucy_Doc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Deserialize);
    arg_self = (lucy_Doc*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_dump);
XS_INTERNAL(XS_Lucy_Document_Doc_dump) {
    dXSARGS;
    lucy_Doc* arg_self;
    LUCY_Doc_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_load);
XS_INTERNAL(XS_Lucy_Document_Doc_load) {
    dXSARGS;
    SV *sv;
    lucy_Doc* arg_self;
    cfish_Obj* arg_dump;
    LUCY_Doc_Load_t method;
    lucy_Doc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_Doc_DESTROY);
XS_INTERNAL(XS_Lucy_Document_Doc_DESTROY) {
    dXSARGS;
    lucy_Doc* arg_self;
    LUCY_Doc_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOC, LUCY_Doc_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_set_score);
XS_INTERNAL(XS_Lucy_Document_HitDoc_set_score) {
    dXSARGS;
    SV *sv;
    lucy_HitDoc* arg_self;
    float arg_score;
    LUCY_HitDoc_Set_Score_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, score");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "score");
    }
    arg_score = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Set_Score);
    method(arg_self, arg_score);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_get_score);
XS_INTERNAL(XS_Lucy_Document_HitDoc_get_score) {
    dXSARGS;
    lucy_HitDoc* arg_self;
    LUCY_HitDoc_Get_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Get_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_equals);
XS_INTERNAL(XS_Lucy_Document_HitDoc_equals) {
    dXSARGS;
    SV *sv;
    lucy_HitDoc* arg_self;
    cfish_Obj* arg_other;
    LUCY_HitDoc_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_dump);
XS_INTERNAL(XS_Lucy_Document_HitDoc_dump) {
    dXSARGS;
    lucy_HitDoc* arg_self;
    LUCY_HitDoc_Dump_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_load);
XS_INTERNAL(XS_Lucy_Document_HitDoc_load) {
    dXSARGS;
    SV *sv;
    lucy_HitDoc* arg_self;
    cfish_Obj* arg_dump;
    LUCY_HitDoc_Load_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_serialize);
XS_INTERNAL(XS_Lucy_Document_HitDoc_serialize) {
    dXSARGS;
    SV *sv;
    lucy_HitDoc* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_HitDoc_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Document_HitDoc_deserialize);
XS_INTERNAL(XS_Lucy_Document_HitDoc_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_HitDoc* arg_self;
    lucy_InStream* arg_instream;
    LUCY_HitDoc_Deserialize_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HitDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITDOC, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITDOC, LUCY_HitDoc_Deserialize);
    arg_self = (lucy_HitDoc*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_new);
XS_INTERNAL(XS_Lucy_Search_Searcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("schema", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_Searcher* arg_self;
    lucy_Schema* arg_schema;
    lucy_Searcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    arg_self = (lucy_Searcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Searcher_init(arg_self, arg_schema);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Searcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Searcher_DESTROY) {
    dXSARGS;
    lucy_Searcher* arg_self;
    LUCY_Searcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_doc_max);
XS_INTERNAL(XS_Lucy_Search_Searcher_doc_max) {
    dXSARGS;
    lucy_Searcher* arg_self;
    LUCY_Searcher_Doc_Max_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Doc_Max);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_doc_freq);
XS_INTERNAL(XS_Lucy_Search_Searcher_doc_freq) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Searcher* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_Searcher_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Doc_Freq);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_glean_query);
XS_INTERNAL(XS_Lucy_Search_Searcher_glean_query) {
    dXSARGS;
    SV *sv;
    lucy_Searcher* arg_self;
    cfish_Obj* arg_query;
    LUCY_Searcher_Glean_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [query]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(1);
    arg_query = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "query", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Glean_Query);
    retval = method(arg_self, arg_query);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_hits);
XS_INTERNAL(XS_Lucy_Search_Searcher_hits) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("offset", 0),
        XSBIND_PARAM("num_wanted", 0),
        XSBIND_PARAM("sort_spec", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Searcher* arg_self;
    cfish_Obj* arg_query;
    uint32_t arg_offset;
    uint32_t arg_num_wanted;
    lucy_SortSpec* arg_sort_spec;
    LUCY_Searcher_Hits_t method;
    lucy_Hits* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "query", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_offset = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 0;
    sv = ST(locations[2]);
    arg_num_wanted = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 10;
    sv = ST(locations[3]);
    arg_sort_spec = locations[3] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Hits);
    retval = method(arg_self, arg_query, arg_offset, arg_num_wanted, arg_sort_spec);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_collect);
XS_INTERNAL(XS_Lucy_Search_Searcher_collect) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("collector", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Searcher* arg_self;
    lucy_Query* arg_query;
    lucy_Collector* arg_collector;
    LUCY_Searcher_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_collector = (lucy_Collector*)XSBind_arg_to_cfish(aTHX_ sv, "collector", LUCY_COLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Collect);
    method(arg_self, arg_query, arg_collector);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_top_docs);
XS_INTERNAL(XS_Lucy_Search_Searcher_top_docs) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("num_wanted", 1),
        XSBIND_PARAM("sort_spec", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Searcher* arg_self;
    lucy_Query* arg_query;
    uint32_t arg_num_wanted;
    lucy_SortSpec* arg_sort_spec;
    LUCY_Searcher_Top_Docs_t method;
    lucy_TopDocs* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "num_wanted");
    }
    arg_num_wanted = (uint32_t)SvUV(sv);
    sv = ST(locations[2]);
    arg_sort_spec = locations[2] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Top_Docs);
    retval = method(arg_self, arg_query, arg_num_wanted, arg_sort_spec);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_fetch_doc);
XS_INTERNAL(XS_Lucy_Search_Searcher_fetch_doc) {
    dXSARGS;
    SV *sv;
    lucy_Searcher* arg_self;
    int32_t arg_doc_id;
    LUCY_Searcher_Fetch_Doc_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Fetch_Doc);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_fetch_doc_vec);
XS_INTERNAL(XS_Lucy_Search_Searcher_fetch_doc_vec) {
    dXSARGS;
    SV *sv;
    lucy_Searcher* arg_self;
    int32_t arg_doc_id;
    LUCY_Searcher_Fetch_Doc_Vec_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Fetch_Doc_Vec);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_get_schema);
XS_INTERNAL(XS_Lucy_Search_Searcher_get_schema) {
    dXSARGS;
    lucy_Searcher* arg_self;
    LUCY_Searcher_Get_Schema_t method;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Get_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Searcher_close);
XS_INTERNAL(XS_Lucy_Search_Searcher_close) {
    dXSARGS;
    lucy_Searcher* arg_self;
    LUCY_Searcher_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Searcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEARCHER, LUCY_Searcher_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_new);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("searchers", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolySearcher* arg_self;
    lucy_Schema* arg_schema;
    cfish_Vector* arg_searchers;
    lucy_PolySearcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_searchers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "searchers", CFISH_VECTOR, NULL);
    arg_self = (lucy_PolySearcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolySearcher_init(arg_self, arg_schema, arg_searchers);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PolySearcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_DESTROY) {
    dXSARGS;
    lucy_PolySearcher* arg_self;
    LUCY_PolySearcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_doc_max);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_doc_max) {
    dXSARGS;
    lucy_PolySearcher* arg_self;
    LUCY_PolySearcher_Doc_Max_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Doc_Max);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_doc_freq);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_doc_freq) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolySearcher* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_PolySearcher_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Doc_Freq);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_collect);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_collect) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("collector", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolySearcher* arg_self;
    lucy_Query* arg_query;
    lucy_Collector* arg_collector;
    LUCY_PolySearcher_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_collector = (lucy_Collector*)XSBind_arg_to_cfish(aTHX_ sv, "collector", LUCY_COLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Collect);
    method(arg_self, arg_query, arg_collector);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_top_docs);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_top_docs) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("num_wanted", 1),
        XSBIND_PARAM("sort_spec", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PolySearcher* arg_self;
    lucy_Query* arg_query;
    uint32_t arg_num_wanted;
    lucy_SortSpec* arg_sort_spec;
    LUCY_PolySearcher_Top_Docs_t method;
    lucy_TopDocs* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "num_wanted");
    }
    arg_num_wanted = (uint32_t)SvUV(sv);
    sv = ST(locations[2]);
    arg_sort_spec = locations[2] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Top_Docs);
    retval = method(arg_self, arg_query, arg_num_wanted, arg_sort_spec);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_fetch_doc);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_fetch_doc) {
    dXSARGS;
    SV *sv;
    lucy_PolySearcher* arg_self;
    int32_t arg_doc_id;
    LUCY_PolySearcher_Fetch_Doc_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Fetch_Doc);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolySearcher_fetch_doc_vec);
XS_INTERNAL(XS_Lucy_Search_PolySearcher_fetch_doc_vec) {
    dXSARGS;
    SV *sv;
    lucy_PolySearcher* arg_self;
    int32_t arg_doc_id;
    LUCY_PolySearcher_Fetch_Doc_Vec_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolySearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYSEARCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYSEARCHER, LUCY_PolySearcher_Fetch_Doc_Vec);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_new);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("index", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_IndexSearcher* arg_self;
    cfish_Obj* arg_index;
    lucy_IndexSearcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_index = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "index", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_IndexSearcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_IxSearcher_init(arg_self, arg_index);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_IndexSearcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_DESTROY) {
    dXSARGS;
    lucy_IndexSearcher* arg_self;
    LUCY_IxSearcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_doc_max);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_doc_max) {
    dXSARGS;
    lucy_IndexSearcher* arg_self;
    LUCY_IxSearcher_Doc_Max_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Doc_Max);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_doc_freq);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_doc_freq) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_IndexSearcher* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_IxSearcher_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Doc_Freq);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_collect);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_collect) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("collector", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_IndexSearcher* arg_self;
    lucy_Query* arg_query;
    lucy_Collector* arg_collector;
    LUCY_IxSearcher_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_collector = (lucy_Collector*)XSBind_arg_to_cfish(aTHX_ sv, "collector", LUCY_COLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Collect);
    method(arg_self, arg_query, arg_collector);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_top_docs);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_top_docs) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("num_wanted", 1),
        XSBIND_PARAM("sort_spec", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_IndexSearcher* arg_self;
    lucy_Query* arg_query;
    uint32_t arg_num_wanted;
    lucy_SortSpec* arg_sort_spec;
    LUCY_IxSearcher_Top_Docs_t method;
    lucy_TopDocs* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);
    sv = ST(locations[0]);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "num_wanted");
    }
    arg_num_wanted = (uint32_t)SvUV(sv);
    sv = ST(locations[2]);
    arg_sort_spec = locations[2] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Top_Docs);
    retval = method(arg_self, arg_query, arg_num_wanted, arg_sort_spec);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_fetch_doc);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_fetch_doc) {
    dXSARGS;
    SV *sv;
    lucy_IndexSearcher* arg_self;
    int32_t arg_doc_id;
    LUCY_IxSearcher_Fetch_Doc_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Fetch_Doc);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_fetch_doc_vec);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_fetch_doc_vec) {
    dXSARGS;
    SV *sv;
    lucy_IndexSearcher* arg_self;
    int32_t arg_doc_id;
    LUCY_IxSearcher_Fetch_Doc_Vec_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Fetch_Doc_Vec);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_get_reader);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_get_reader) {
    dXSARGS;
    lucy_IndexSearcher* arg_self;
    LUCY_IxSearcher_Get_Reader_t method;
    lucy_IndexReader* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Get_Reader);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_IndexSearcher_close);
XS_INTERNAL(XS_Lucy_Search_IndexSearcher_close) {
    dXSARGS;
    lucy_IndexSearcher* arg_self;
    LUCY_IxSearcher_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexSearcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXSEARCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXSEARCHER, LUCY_IxSearcher_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_new);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("score", 1),
        XSBIND_PARAM("values", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_MatchDoc* arg_self;
    int32_t arg_doc_id;
    float arg_score;
    cfish_Vector* arg_values;
    lucy_MatchDoc* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "score");
    }
    arg_score = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_values = locations[2] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "values", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_MatchDoc*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchDoc_init(arg_self, arg_doc_id, arg_score, arg_values);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_MatchDoc_serialize);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_serialize) {
    dXSARGS;
    SV *sv;
    lucy_MatchDoc* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_MatchDoc_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_deserialize);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_MatchDoc* arg_self;
    lucy_InStream* arg_instream;
    LUCY_MatchDoc_Deserialize_t method;
    lucy_MatchDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Deserialize);
    arg_self = (lucy_MatchDoc*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_get_doc_id) {
    dXSARGS;
    lucy_MatchDoc* arg_self;
    LUCY_MatchDoc_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_set_doc_id);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_set_doc_id) {
    dXSARGS;
    SV *sv;
    lucy_MatchDoc* arg_self;
    int32_t arg_doc_id;
    LUCY_MatchDoc_Set_Doc_ID_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Set_Doc_ID);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_get_score);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_get_score) {
    dXSARGS;
    lucy_MatchDoc* arg_self;
    LUCY_MatchDoc_Get_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Get_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_set_score);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_set_score) {
    dXSARGS;
    SV *sv;
    lucy_MatchDoc* arg_self;
    float arg_score;
    LUCY_MatchDoc_Set_Score_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, score");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "score");
    }
    arg_score = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Set_Score);
    method(arg_self, arg_score);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_get_values);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_get_values) {
    dXSARGS;
    lucy_MatchDoc* arg_self;
    LUCY_MatchDoc_Get_Values_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Get_Values);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_set_values);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_set_values) {
    dXSARGS;
    SV *sv;
    lucy_MatchDoc* arg_self;
    cfish_Vector* arg_values;
    LUCY_MatchDoc_Set_Values_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, values");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);
    sv = ST(1);
    arg_values = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "values", CFISH_VECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Set_Values);
    method(arg_self, arg_values);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_MatchDoc_DESTROY);
XS_INTERNAL(XS_Lucy_Search_MatchDoc_DESTROY) {
    dXSARGS;
    lucy_MatchDoc* arg_self;
    LUCY_MatchDoc_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchDoc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHDOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHDOC, LUCY_MatchDoc_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_DESTROY);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_DESTROY) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_set_value);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_set_value) {
    dXSARGS;
    SV *sv;
    lucy_ParserElem* arg_self;
    cfish_Obj* arg_value;
    LUCY_ParserElem_Set_Value_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);
    sv = ST(1);
    arg_value = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "value", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Set_Value);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_as);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_as) {
    dXSARGS;
    SV *sv;
    lucy_ParserElem* arg_self;
    cfish_Class* arg_klass;
    LUCY_ParserElem_As_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, klass");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);
    sv = ST(1);
    arg_klass = (cfish_Class*)XSBind_arg_to_cfish(aTHX_ sv, "klass", CFISH_CLASS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_As);
    retval = method(arg_self, arg_klass);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_get_type);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_get_type) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Get_Type_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Get_Type);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_negate);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_negate) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Negate_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Negate);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_require);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_require) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Require_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Require);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_unrequire);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_unrequire) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Unrequire_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Unrequire);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_required);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_required) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Required_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Required);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_optional);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_optional) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Optional_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Optional);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_negated);
XS_INTERNAL(XS_Lucy_Search_QueryParser_ParserElem_negated) {
    dXSARGS;
    lucy_ParserElem* arg_self;
    LUCY_ParserElem_Negated_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ParserElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PARSERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PARSERELEM, LUCY_ParserElem_Negated);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_new);
XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_new) {
    dXSARGS;
    lucy_QueryLexer* arg_self;
    lucy_QueryLexer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_QueryLexer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_QueryLexer_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_tokenize);
XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_tokenize) {
    dXSARGS;
    SV *sv;
    lucy_QueryLexer* arg_self;
    cfish_String* arg_query_string;
    LUCY_QueryLexer_Tokenize_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [query_string]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryLexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYLEXER, NULL);
    sv = ST(1);
    arg_query_string = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "query_string", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYLEXER, LUCY_QueryLexer_Tokenize);
    retval = method(arg_self, arg_query_string);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_heed_colons);
XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_heed_colons) {
    dXSARGS;
    lucy_QueryLexer* arg_self;
    LUCY_QueryLexer_Heed_Colons_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryLexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYLEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYLEXER, LUCY_QueryLexer_Heed_Colons);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_set_heed_colons);
XS_INTERNAL(XS_Lucy_Search_QueryParser_QueryLexer_set_heed_colons) {
    dXSARGS;
    SV *sv;
    lucy_QueryLexer* arg_self;
    bool arg_heed_colons;
    LUCY_QueryLexer_Set_Heed_Colons_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, heed_colons");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryLexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYLEXER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "heed_colons");
    }
    arg_heed_colons = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYLEXER, LUCY_QueryLexer_Set_Heed_Colons);
    method(arg_self, arg_heed_colons);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Span_new);
XS_INTERNAL(XS_Lucy_Search_Span_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("offset", 1),
        XSBIND_PARAM("length", 1),
        XSBIND_PARAM("weight", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Span* arg_self;
    int32_t arg_offset;
    int32_t arg_length;
    float arg_weight;
    lucy_Span* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length");
    }
    arg_length = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    arg_weight = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 0.0;
    arg_self = (lucy_Span*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Span_init(arg_self, arg_offset, arg_length, arg_weight);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Span_get_offset);
XS_INTERNAL(XS_Lucy_Search_Span_get_offset) {
    dXSARGS;
    lucy_Span* arg_self;
    LUCY_Span_Get_Offset_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Get_Offset);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Span_set_offset);
XS_INTERNAL(XS_Lucy_Search_Span_set_offset) {
    dXSARGS;
    SV *sv;
    lucy_Span* arg_self;
    int32_t arg_offset;
    LUCY_Span_Set_Offset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, offset");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Set_Offset);
    method(arg_self, arg_offset);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Span_get_length);
XS_INTERNAL(XS_Lucy_Search_Span_get_length) {
    dXSARGS;
    lucy_Span* arg_self;
    LUCY_Span_Get_Length_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Get_Length);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Span_set_length);
XS_INTERNAL(XS_Lucy_Search_Span_set_length) {
    dXSARGS;
    SV *sv;
    lucy_Span* arg_self;
    int32_t arg_length;
    LUCY_Span_Set_Length_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, length");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length");
    }
    arg_length = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Set_Length);
    method(arg_self, arg_length);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Span_get_weight);
XS_INTERNAL(XS_Lucy_Search_Span_get_weight) {
    dXSARGS;
    lucy_Span* arg_self;
    LUCY_Span_Get_Weight_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Get_Weight);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Span_set_weight);
XS_INTERNAL(XS_Lucy_Search_Span_set_weight) {
    dXSARGS;
    SV *sv;
    lucy_Span* arg_self;
    float arg_weight;
    LUCY_Span_Set_Weight_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, weight");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "weight");
    }
    arg_weight = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Set_Weight);
    method(arg_self, arg_weight);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Span_equals);
XS_INTERNAL(XS_Lucy_Search_Span_equals) {
    dXSARGS;
    SV *sv;
    lucy_Span* arg_self;
    cfish_Obj* arg_other;
    LUCY_Span_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Span_compare_to);
XS_INTERNAL(XS_Lucy_Search_Span_compare_to) {
    dXSARGS;
    SV *sv;
    lucy_Span* arg_self;
    cfish_Obj* arg_other;
    LUCY_Span_Compare_To_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Span*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SPAN, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SPAN, LUCY_Span_Compare_To);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_new);
XS_INTERNAL(XS_Lucy_Search_TopDocs_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("match_docs", 1),
        XSBIND_PARAM("total_hits", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_TopDocs* arg_self;
    cfish_Vector* arg_match_docs;
    uint32_t arg_total_hits;
    lucy_TopDocs* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_match_docs = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "match_docs", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "total_hits");
    }
    arg_total_hits = (uint32_t)SvUV(sv);
    arg_self = (lucy_TopDocs*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TopDocs_init(arg_self, arg_match_docs, arg_total_hits);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_TopDocs_get_match_docs);
XS_INTERNAL(XS_Lucy_Search_TopDocs_get_match_docs) {
    dXSARGS;
    lucy_TopDocs* arg_self;
    LUCY_TopDocs_Get_Match_Docs_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Get_Match_Docs);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_set_match_docs);
XS_INTERNAL(XS_Lucy_Search_TopDocs_set_match_docs) {
    dXSARGS;
    SV *sv;
    lucy_TopDocs* arg_self;
    cfish_Vector* arg_match_docs;
    LUCY_TopDocs_Set_Match_Docs_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, match_docs");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);
    sv = ST(1);
    arg_match_docs = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "match_docs", CFISH_VECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Set_Match_Docs);
    method(arg_self, arg_match_docs);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_get_total_hits);
XS_INTERNAL(XS_Lucy_Search_TopDocs_get_total_hits) {
    dXSARGS;
    lucy_TopDocs* arg_self;
    LUCY_TopDocs_Get_Total_Hits_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Get_Total_Hits);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_set_total_hits);
XS_INTERNAL(XS_Lucy_Search_TopDocs_set_total_hits) {
    dXSARGS;
    SV *sv;
    lucy_TopDocs* arg_self;
    uint32_t arg_total_hits;
    LUCY_TopDocs_Set_Total_Hits_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, total_hits");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "total_hits");
    }
    arg_total_hits = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Set_Total_Hits);
    method(arg_self, arg_total_hits);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_serialize);
XS_INTERNAL(XS_Lucy_Search_TopDocs_serialize) {
    dXSARGS;
    SV *sv;
    lucy_TopDocs* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_TopDocs_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_deserialize);
XS_INTERNAL(XS_Lucy_Search_TopDocs_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_TopDocs* arg_self;
    lucy_InStream* arg_instream;
    LUCY_TopDocs_Deserialize_t method;
    lucy_TopDocs* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Deserialize);
    arg_self = (lucy_TopDocs*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TopDocs_DESTROY);
XS_INTERNAL(XS_Lucy_Search_TopDocs_DESTROY) {
    dXSARGS;
    lucy_TopDocs* arg_self;
    LUCY_TopDocs_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TopDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOPDOCS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TOPDOCS, LUCY_TopDocs_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Hits_new);
XS_INTERNAL(XS_Lucy_Search_Hits_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("top_docs", 1),
        XSBIND_PARAM("offset", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Hits* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_TopDocs* arg_top_docs;
    uint32_t arg_offset;
    lucy_Hits* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_top_docs = (lucy_TopDocs*)XSBind_arg_to_cfish(aTHX_ sv, "top_docs", LUCY_TOPDOCS, NULL);
    sv = ST(locations[2]);
    arg_offset = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 0;
    arg_self = (lucy_Hits*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Hits_init(arg_self, arg_searcher, arg_top_docs, arg_offset);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Hits_next);
XS_INTERNAL(XS_Lucy_Search_Hits_next) {
    dXSARGS;
    lucy_Hits* arg_self;
    LUCY_Hits_Next_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Hits*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITS, LUCY_Hits_Next);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Hits_total_hits);
XS_INTERNAL(XS_Lucy_Search_Hits_total_hits) {
    dXSARGS;
    lucy_Hits* arg_self;
    LUCY_Hits_Total_Hits_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Hits*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITS, LUCY_Hits_Total_Hits);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Hits_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Hits_DESTROY) {
    dXSARGS;
    lucy_Hits* arg_self;
    LUCY_Hits_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Hits*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HITS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HITS, LUCY_Hits_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_new);
XS_INTERNAL(XS_Lucy_Search_Collector_new) {
    dXSARGS;
    lucy_Collector* arg_self;
    lucy_Collector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Collector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Coll_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Collector_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Collector_DESTROY) {
    dXSARGS;
    lucy_Collector* arg_self;
    LUCY_Coll_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Collector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COLLECTOR, LUCY_Coll_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_collect);
XS_INTERNAL(XS_Lucy_Search_Collector_collect) {
    dXSARGS;
    SV *sv;
    lucy_Collector* arg_self;
    int32_t arg_doc_id;
    LUCY_Coll_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Collector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COLLECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COLLECTOR, LUCY_Coll_Collect);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_set_reader);
XS_INTERNAL(XS_Lucy_Search_Collector_set_reader) {
    dXSARGS;
    SV *sv;
    lucy_Collector* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_Coll_Set_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Collector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COLLECTOR, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COLLECTOR, LUCY_Coll_Set_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_set_base);
XS_INTERNAL(XS_Lucy_Search_Collector_set_base) {
    dXSARGS;
    SV *sv;
    lucy_Collector* arg_self;
    int32_t arg_base;
    LUCY_Coll_Set_Base_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, base");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Collector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COLLECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "base");
    }
    arg_base = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COLLECTOR, LUCY_Coll_Set_Base);
    method(arg_self, arg_base);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_need_score);
XS_INTERNAL(XS_Lucy_Search_Collector_need_score) {
    dXSARGS;
    lucy_Collector* arg_self;
    LUCY_Coll_Need_Score_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Collector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COLLECTOR, LUCY_Coll_Need_Score);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Collector_set_matcher);
XS_INTERNAL(XS_Lucy_Search_Collector_set_matcher) {
    dXSARGS;
    SV *sv;
    lucy_Collector* arg_self;
    lucy_Matcher* arg_matcher;
    LUCY_Coll_Set_Matcher_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, matcher");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Collector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COLLECTOR, NULL);
    sv = ST(1);
    arg_matcher = (lucy_Matcher*)XSBind_arg_to_cfish(aTHX_ sv, "matcher", LUCY_MATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COLLECTOR, LUCY_Coll_Set_Matcher);
    method(arg_self, arg_matcher);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_new);
XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("bit_vector", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_BitCollector* arg_self;
    lucy_BitVector* arg_bit_vector;
    lucy_BitCollector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_bit_vector = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "bit_vector", LUCY_BITVECTOR, NULL);
    arg_self = (lucy_BitCollector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BitColl_init(arg_self, arg_bit_vector);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_DESTROY) {
    dXSARGS;
    lucy_BitCollector* arg_self;
    LUCY_BitColl_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITCOLLECTOR, LUCY_BitColl_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_collect);
XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_collect) {
    dXSARGS;
    SV *sv;
    lucy_BitCollector* arg_self;
    int32_t arg_doc_id;
    LUCY_BitColl_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITCOLLECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITCOLLECTOR, LUCY_BitColl_Collect);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_need_score);
XS_INTERNAL(XS_Lucy_Search_Collector_BitCollector_need_score) {
    dXSARGS;
    lucy_BitCollector* arg_self;
    LUCY_BitColl_Need_Score_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITCOLLECTOR, LUCY_BitColl_Need_Score);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_new);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("collector", 1),
        XSBIND_PARAM("offset", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_OffsetCollector* arg_self;
    lucy_Collector* arg_collector;
    int32_t arg_offset;
    lucy_OffsetCollector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_collector = (lucy_Collector*)XSBind_arg_to_cfish(aTHX_ sv, "collector", LUCY_COLLECTOR, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int32_t)SvIV(sv);
    arg_self = (lucy_OffsetCollector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_OffsetColl_init(arg_self, arg_collector, arg_offset);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_DESTROY) {
    dXSARGS;
    lucy_OffsetCollector* arg_self;
    LUCY_OffsetColl_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OffsetCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OFFSETCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OFFSETCOLLECTOR, LUCY_OffsetColl_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_collect);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_collect) {
    dXSARGS;
    SV *sv;
    lucy_OffsetCollector* arg_self;
    int32_t arg_doc_id;
    LUCY_OffsetColl_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OffsetCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OFFSETCOLLECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OFFSETCOLLECTOR, LUCY_OffsetColl_Collect);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_need_score);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_need_score) {
    dXSARGS;
    lucy_OffsetCollector* arg_self;
    LUCY_OffsetColl_Need_Score_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OffsetCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OFFSETCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OFFSETCOLLECTOR, LUCY_OffsetColl_Need_Score);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_set_reader);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_set_reader) {
    dXSARGS;
    SV *sv;
    lucy_OffsetCollector* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_OffsetColl_Set_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OffsetCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OFFSETCOLLECTOR, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OFFSETCOLLECTOR, LUCY_OffsetColl_Set_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_set_base);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_set_base) {
    dXSARGS;
    SV *sv;
    lucy_OffsetCollector* arg_self;
    int32_t arg_base;
    LUCY_OffsetColl_Set_Base_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, base");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OffsetCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OFFSETCOLLECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "base");
    }
    arg_base = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OFFSETCOLLECTOR, LUCY_OffsetColl_Set_Base);
    method(arg_self, arg_base);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_set_matcher);
XS_INTERNAL(XS_Lucy_Search_Collector_OffsetCollector_set_matcher) {
    dXSARGS;
    SV *sv;
    lucy_OffsetCollector* arg_self;
    lucy_Matcher* arg_matcher;
    LUCY_OffsetColl_Set_Matcher_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, matcher");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OffsetCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OFFSETCOLLECTOR, NULL);
    sv = ST(1);
    arg_matcher = (lucy_Matcher*)XSBind_arg_to_cfish(aTHX_ sv, "matcher", LUCY_MATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OFFSETCOLLECTOR, LUCY_OffsetColl_Set_Matcher);
    method(arg_self, arg_matcher);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_new);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("sort_spec", 0),
        XSBIND_PARAM("wanted", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_SortCollector* arg_self;
    lucy_Schema* arg_schema;
    lucy_SortSpec* arg_sort_spec;
    uint32_t arg_wanted;
    lucy_SortCollector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_sort_spec = locations[1] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "wanted");
    }
    arg_wanted = (uint32_t)SvUV(sv);
    arg_self = (lucy_SortCollector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortColl_init(arg_self, arg_schema, arg_sort_spec, arg_wanted);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_collect);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_collect) {
    dXSARGS;
    SV *sv;
    lucy_SortCollector* arg_self;
    int32_t arg_doc_id;
    LUCY_SortColl_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCOLLECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCOLLECTOR, LUCY_SortColl_Collect);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_pop_match_docs);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_pop_match_docs) {
    dXSARGS;
    lucy_SortCollector* arg_self;
    LUCY_SortColl_Pop_Match_Docs_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCOLLECTOR, LUCY_SortColl_Pop_Match_Docs);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_get_total_hits);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_get_total_hits) {
    dXSARGS;
    lucy_SortCollector* arg_self;
    LUCY_SortColl_Get_Total_Hits_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCOLLECTOR, LUCY_SortColl_Get_Total_Hits);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_set_reader);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_set_reader) {
    dXSARGS;
    SV *sv;
    lucy_SortCollector* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_SortColl_Set_Reader_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCOLLECTOR, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCOLLECTOR, LUCY_SortColl_Set_Reader);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_need_score);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_need_score) {
    dXSARGS;
    lucy_SortCollector* arg_self;
    LUCY_SortColl_Need_Score_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCOLLECTOR, LUCY_SortColl_Need_Score);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Collector_SortCollector_DESTROY) {
    dXSARGS;
    lucy_SortCollector* arg_self;
    LUCY_SortColl_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCollector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCOLLECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCOLLECTOR, LUCY_SortColl_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_new);
XS_INTERNAL(XS_Lucy_Search_QueryParser_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("analyzer", 0),
        XSBIND_PARAM("default_boolop", 0),
        XSBIND_PARAM("fields", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_QueryParser* arg_self;
    lucy_Schema* arg_schema;
    lucy_Analyzer* arg_analyzer;
    cfish_String* arg_default_boolop;
    cfish_Vector* arg_fields;
    lucy_QueryParser* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_analyzer = locations[1] < items ? (lucy_Analyzer*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "analyzer", LUCY_ANALYZER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_default_boolop = locations[2] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "default_boolop", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[3]);
    arg_fields = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "fields", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_QueryParser*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_QParser_init(arg_self, arg_schema, arg_analyzer, arg_default_boolop, arg_fields);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_QueryParser_parse);
XS_INTERNAL(XS_Lucy_Search_QueryParser_parse) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    cfish_String* arg_query_string;
    LUCY_QParser_Parse_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [query_string]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_query_string = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "query_string", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Parse);
    retval = method(arg_self, arg_query_string);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_tree);
XS_INTERNAL(XS_Lucy_Search_QueryParser_tree) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    cfish_String* arg_query_string;
    LUCY_QParser_Tree_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query_string");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_query_string = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "query_string", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Tree);
    retval = method(arg_self, arg_query_string);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_expand);
XS_INTERNAL(XS_Lucy_Search_QueryParser_expand) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    lucy_Query* arg_query;
    LUCY_QParser_Expand_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Expand);
    retval = method(arg_self, arg_query);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_expand_leaf);
XS_INTERNAL(XS_Lucy_Search_QueryParser_expand_leaf) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    lucy_Query* arg_query;
    LUCY_QParser_Expand_Leaf_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Expand_Leaf);
    retval = method(arg_self, arg_query);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_prune);
XS_INTERNAL(XS_Lucy_Search_QueryParser_prune) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    lucy_Query* arg_query;
    LUCY_QParser_Prune_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [query]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_query = 1 < items ? (lucy_Query*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "query", LUCY_QUERY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Prune);
    retval = method(arg_self, arg_query);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_make_term_query);
XS_INTERNAL(XS_Lucy_Search_QueryParser_make_term_query) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_QueryParser* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_QParser_Make_Term_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Make_Term_Query);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_make_phrase_query);
XS_INTERNAL(XS_Lucy_Search_QueryParser_make_phrase_query) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("terms", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_QueryParser* arg_self;
    cfish_String* arg_field;
    cfish_Vector* arg_terms;
    LUCY_QParser_Make_Phrase_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_terms = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "terms", CFISH_VECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Make_Phrase_Query);
    retval = method(arg_self, arg_field, arg_terms);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_make_or_query);
XS_INTERNAL(XS_Lucy_Search_QueryParser_make_or_query) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    cfish_Vector* arg_children;
    LUCY_QParser_Make_OR_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [children]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_children = 1 < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "children", CFISH_VECTOR, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Make_OR_Query);
    retval = method(arg_self, arg_children);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_make_and_query);
XS_INTERNAL(XS_Lucy_Search_QueryParser_make_and_query) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    cfish_Vector* arg_children;
    LUCY_QParser_Make_AND_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [children]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_children = 1 < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "children", CFISH_VECTOR, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Make_AND_Query);
    retval = method(arg_self, arg_children);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_make_not_query);
XS_INTERNAL(XS_Lucy_Search_QueryParser_make_not_query) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    lucy_Query* arg_negated_query;
    LUCY_QParser_Make_NOT_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, negated_query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    arg_negated_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "negated_query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Make_NOT_Query);
    retval = method(arg_self, arg_negated_query);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_make_req_opt_query);
XS_INTERNAL(XS_Lucy_Search_QueryParser_make_req_opt_query) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("required_query", 1),
        XSBIND_PARAM("optional_query", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_QueryParser* arg_self;
    lucy_Query* arg_required_query;
    lucy_Query* arg_optional_query;
    LUCY_QParser_Make_Req_Opt_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(locations[0]);
    arg_required_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "required_query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_optional_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "optional_query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Make_Req_Opt_Query);
    retval = method(arg_self, arg_required_query, arg_optional_query);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_get_analyzer);
XS_INTERNAL(XS_Lucy_Search_QueryParser_get_analyzer) {
    dXSARGS;
    lucy_QueryParser* arg_self;
    LUCY_QParser_Get_Analyzer_t method;
    lucy_Analyzer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Get_Analyzer);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_get_schema);
XS_INTERNAL(XS_Lucy_Search_QueryParser_get_schema) {
    dXSARGS;
    lucy_QueryParser* arg_self;
    LUCY_QParser_Get_Schema_t method;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Get_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_get_default_boolop);
XS_INTERNAL(XS_Lucy_Search_QueryParser_get_default_boolop) {
    dXSARGS;
    lucy_QueryParser* arg_self;
    LUCY_QParser_Get_Default_BoolOp_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Get_Default_BoolOp);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_get_fields);
XS_INTERNAL(XS_Lucy_Search_QueryParser_get_fields) {
    dXSARGS;
    lucy_QueryParser* arg_self;
    LUCY_QParser_Get_Fields_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Get_Fields);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_heed_colons);
XS_INTERNAL(XS_Lucy_Search_QueryParser_heed_colons) {
    dXSARGS;
    lucy_QueryParser* arg_self;
    LUCY_QParser_Heed_Colons_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Heed_Colons);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_set_heed_colons);
XS_INTERNAL(XS_Lucy_Search_QueryParser_set_heed_colons) {
    dXSARGS;
    SV *sv;
    lucy_QueryParser* arg_self;
    bool arg_heed_colons;
    LUCY_QParser_Set_Heed_Colons_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, heed_colons");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "heed_colons");
    }
    arg_heed_colons = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Set_Heed_Colons);
    method(arg_self, arg_heed_colons);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_QueryParser_DESTROY);
XS_INTERNAL(XS_Lucy_Search_QueryParser_DESTROY) {
    dXSARGS;
    lucy_QueryParser* arg_self;
    LUCY_QParser_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_QueryParser*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERYPARSER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERYPARSER, LUCY_QParser_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Matcher_new);
XS_INTERNAL(XS_Lucy_Search_Matcher_new) {
    dXSARGS;
    lucy_Matcher* arg_self;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Matcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Matcher_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Matcher_next);
XS_INTERNAL(XS_Lucy_Search_Matcher_next) {
    dXSARGS;
    lucy_Matcher* arg_self;
    LUCY_Matcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Matcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHER, LUCY_Matcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Matcher_advance);
XS_INTERNAL(XS_Lucy_Search_Matcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_Matcher* arg_self;
    int32_t arg_target;
    LUCY_Matcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Matcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHER, LUCY_Matcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Matcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_Matcher_get_doc_id) {
    dXSARGS;
    lucy_Matcher* arg_self;
    LUCY_Matcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Matcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHER, LUCY_Matcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Matcher_score);
XS_INTERNAL(XS_Lucy_Search_Matcher_score) {
    dXSARGS;
    lucy_Matcher* arg_self;
    LUCY_Matcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Matcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHER, LUCY_Matcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Matcher_collect);
XS_INTERNAL(XS_Lucy_Search_Matcher_collect) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("collector", 1),
        XSBIND_PARAM("deletions", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Matcher* arg_self;
    lucy_Collector* arg_collector;
    lucy_Matcher* arg_deletions;
    LUCY_Matcher_Collect_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Matcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHER, NULL);
    sv = ST(locations[0]);
    arg_collector = (lucy_Collector*)XSBind_arg_to_cfish(aTHX_ sv, "collector", LUCY_COLLECTOR, NULL);
    sv = ST(locations[1]);
    arg_deletions = locations[1] < items ? (lucy_Matcher*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "deletions", LUCY_MATCHER, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHER, LUCY_Matcher_Collect);
    method(arg_self, arg_collector, arg_deletions);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_MockMatcher__new);
XS_INTERNAL(XS_LucyX_Search_MockMatcher__new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("doc_ids", 1),
        XSBIND_PARAM("scores", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_MockMatcher* arg_self;
    lucy_I32Array* arg_doc_ids;
    cfish_Blob* arg_scores;
    lucy_MockMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_doc_ids = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "doc_ids", LUCY_I32ARRAY, NULL);
    sv = ST(locations[1]);
    arg_scores = locations[1] < items ? (cfish_Blob*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "scores", CFISH_BLOB, NULL) : NULL;
    arg_self = (lucy_MockMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MockMatcher_init(arg_self, arg_doc_ids, arg_scores);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_LucyX_Search_MockMatcher_DESTROY);
XS_INTERNAL(XS_LucyX_Search_MockMatcher_DESTROY) {
    dXSARGS;
    lucy_MockMatcher* arg_self;
    LUCY_MockMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MockMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MOCKMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MOCKMATCHER, LUCY_MockMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_MockMatcher_next);
XS_INTERNAL(XS_LucyX_Search_MockMatcher_next) {
    dXSARGS;
    lucy_MockMatcher* arg_self;
    LUCY_MockMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MockMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MOCKMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MOCKMATCHER, LUCY_MockMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_MockMatcher_score);
XS_INTERNAL(XS_LucyX_Search_MockMatcher_score) {
    dXSARGS;
    lucy_MockMatcher* arg_self;
    LUCY_MockMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MockMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MOCKMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MOCKMATCHER, LUCY_MockMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_MockMatcher_get_doc_id);
XS_INTERNAL(XS_LucyX_Search_MockMatcher_get_doc_id) {
    dXSARGS;
    lucy_MockMatcher* arg_self;
    LUCY_MockMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MockMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MOCKMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MOCKMATCHER, LUCY_MockMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_new);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("posting_lists", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("within", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_ProximityMatcher* arg_self;
    lucy_Similarity* arg_similarity;
    cfish_Vector* arg_posting_lists;
    lucy_Compiler* arg_compiler;
    uint32_t arg_within;
    lucy_ProximityMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_posting_lists = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "posting_lists", CFISH_VECTOR, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "within");
    }
    arg_within = (uint32_t)SvUV(sv);
    arg_self = (lucy_ProximityMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ProximityMatcher_init(arg_self, arg_similarity, arg_posting_lists, arg_compiler, arg_within);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_DESTROY);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_DESTROY) {
    dXSARGS;
    lucy_ProximityMatcher* arg_self;
    LUCY_ProximityMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYMATCHER, LUCY_ProximityMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_next);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_next) {
    dXSARGS;
    lucy_ProximityMatcher* arg_self;
    LUCY_ProximityMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYMATCHER, LUCY_ProximityMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_advance);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_ProximityMatcher* arg_self;
    int32_t arg_target;
    LUCY_ProximityMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYMATCHER, LUCY_ProximityMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_get_doc_id);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_get_doc_id) {
    dXSARGS;
    lucy_ProximityMatcher* arg_self;
    LUCY_ProximityMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYMATCHER, LUCY_ProximityMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_score);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_score) {
    dXSARGS;
    lucy_ProximityMatcher* arg_self;
    LUCY_ProximityMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYMATCHER, LUCY_ProximityMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_calc_proximity_freq);
XS_INTERNAL(XS_LucyX_Search_ProximityMatcher_calc_proximity_freq) {
    dXSARGS;
    lucy_ProximityMatcher* arg_self;
    LUCY_ProximityMatcher_Calc_Proximity_Freq_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYMATCHER, LUCY_ProximityMatcher_Calc_Proximity_Freq);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_FilterMatcher_new);
XS_INTERNAL(XS_LucyX_Search_FilterMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("bits", 1),
        XSBIND_PARAM("doc_max", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FilterMatcher* arg_self;
    lucy_BitVector* arg_bits;
    int32_t arg_doc_max;
    lucy_FilterMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_bits = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "bits", LUCY_BITVECTOR, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    arg_self = (lucy_FilterMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FilterMatcher_init(arg_self, arg_bits, arg_doc_max);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_LucyX_Search_FilterMatcher_DESTROY);
XS_INTERNAL(XS_LucyX_Search_FilterMatcher_DESTROY) {
    dXSARGS;
    lucy_FilterMatcher* arg_self;
    LUCY_FilterMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilterMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILTERMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILTERMATCHER, LUCY_FilterMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_FilterMatcher_next);
XS_INTERNAL(XS_LucyX_Search_FilterMatcher_next) {
    dXSARGS;
    lucy_FilterMatcher* arg_self;
    LUCY_FilterMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilterMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILTERMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILTERMATCHER, LUCY_FilterMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_FilterMatcher_skip_to);
XS_INTERNAL(XS_LucyX_Search_FilterMatcher_skip_to) {
    dXSARGS;
    SV *sv;
    lucy_FilterMatcher* arg_self;
    int32_t arg_target;
    LUCY_FilterMatcher_Skip_To_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilterMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILTERMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILTERMATCHER, LUCY_FilterMatcher_Skip_To);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_FilterMatcher_score);
XS_INTERNAL(XS_LucyX_Search_FilterMatcher_score) {
    dXSARGS;
    lucy_FilterMatcher* arg_self;
    LUCY_FilterMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilterMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILTERMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILTERMATCHER, LUCY_FilterMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_FilterMatcher_get_doc_id);
XS_INTERNAL(XS_LucyX_Search_FilterMatcher_get_doc_id) {
    dXSARGS;
    lucy_FilterMatcher* arg_self;
    LUCY_FilterMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilterMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILTERMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILTERMATCHER, LUCY_FilterMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_new);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("posting_lists", 1),
        XSBIND_PARAM("compiler", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PhraseMatcher* arg_self;
    lucy_Similarity* arg_similarity;
    cfish_Vector* arg_posting_lists;
    lucy_Compiler* arg_compiler;
    lucy_PhraseMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_posting_lists = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "posting_lists", CFISH_VECTOR, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    arg_self = (lucy_PhraseMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PhraseMatcher_init(arg_self, arg_similarity, arg_posting_lists, arg_compiler);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_DESTROY) {
    dXSARGS;
    lucy_PhraseMatcher* arg_self;
    LUCY_PhraseMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEMATCHER, LUCY_PhraseMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_next);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_next) {
    dXSARGS;
    lucy_PhraseMatcher* arg_self;
    LUCY_PhraseMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEMATCHER, LUCY_PhraseMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_PhraseMatcher* arg_self;
    int32_t arg_target;
    LUCY_PhraseMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEMATCHER, LUCY_PhraseMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_get_doc_id) {
    dXSARGS;
    lucy_PhraseMatcher* arg_self;
    LUCY_PhraseMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEMATCHER, LUCY_PhraseMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_score);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_score) {
    dXSARGS;
    lucy_PhraseMatcher* arg_self;
    LUCY_PhraseMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEMATCHER, LUCY_PhraseMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_calc_phrase_freq);
XS_INTERNAL(XS_Lucy_Search_PhraseMatcher_calc_phrase_freq) {
    dXSARGS;
    lucy_PhraseMatcher* arg_self;
    LUCY_PhraseMatcher_Calc_Phrase_Freq_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEMATCHER, LUCY_PhraseMatcher_Calc_Phrase_Freq);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_new);
XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("score", 1),
        XSBIND_PARAM("doc_max", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_MatchAllMatcher* arg_self;
    float arg_score;
    int32_t arg_doc_max;
    lucy_MatchAllMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "score");
    }
    arg_score = (float)SvNV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    arg_self = (lucy_MatchAllMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchAllMatcher_init(arg_self, arg_score, arg_doc_max);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_next);
XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_next) {
    dXSARGS;
    lucy_MatchAllMatcher* arg_self;
    LUCY_MatchAllMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchAllMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLMATCHER, LUCY_MatchAllMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_MatchAllMatcher* arg_self;
    int32_t arg_target;
    LUCY_MatchAllMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchAllMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLMATCHER, LUCY_MatchAllMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_score);
XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_score) {
    dXSARGS;
    lucy_MatchAllMatcher* arg_self;
    LUCY_MatchAllMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchAllMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLMATCHER, LUCY_MatchAllMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_MatchAllMatcher_get_doc_id) {
    dXSARGS;
    lucy_MatchAllMatcher* arg_self;
    LUCY_MatchAllMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchAllMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLMATCHER, LUCY_MatchAllMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_new);
XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("matchers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SeriesMatcher* arg_self;
    cfish_Vector* arg_matchers;
    lucy_I32Array* arg_offsets;
    lucy_SeriesMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_matchers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "matchers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);
    arg_self = (lucy_SeriesMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SeriesMatcher_init(arg_self, arg_matchers, arg_offsets);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_next);
XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_next) {
    dXSARGS;
    lucy_SeriesMatcher* arg_self;
    LUCY_SeriesMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SeriesMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SERIESMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SERIESMATCHER, LUCY_SeriesMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_SeriesMatcher* arg_self;
    int32_t arg_target;
    LUCY_SeriesMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SeriesMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SERIESMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SERIESMATCHER, LUCY_SeriesMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_get_doc_id) {
    dXSARGS;
    lucy_SeriesMatcher* arg_self;
    LUCY_SeriesMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SeriesMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SERIESMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SERIESMATCHER, LUCY_SeriesMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_SeriesMatcher_DESTROY) {
    dXSARGS;
    lucy_SeriesMatcher* arg_self;
    LUCY_SeriesMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SeriesMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SERIESMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SERIESMATCHER, LUCY_SeriesMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TermMatcher_new);
XS_INTERNAL(XS_Lucy_Search_TermMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("posting_list", 1),
        XSBIND_PARAM("compiler", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_TermMatcher* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_PostingList* arg_posting_list;
    lucy_Compiler* arg_compiler;
    lucy_TermMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_posting_list = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "posting_list", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    arg_self = (lucy_TermMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TermMatcher_init(arg_self, arg_similarity, arg_posting_list, arg_compiler);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_TermMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_TermMatcher_DESTROY) {
    dXSARGS;
    lucy_TermMatcher* arg_self;
    LUCY_TermMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMMATCHER, LUCY_TermMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TermMatcher_next);
XS_INTERNAL(XS_Lucy_Search_TermMatcher_next) {
    dXSARGS;
    lucy_TermMatcher* arg_self;
    LUCY_TermMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMMATCHER, LUCY_TermMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_TermMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_TermMatcher* arg_self;
    int32_t arg_target;
    LUCY_TermMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMMATCHER, LUCY_TermMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_TermMatcher_get_doc_id) {
    dXSARGS;
    lucy_TermMatcher* arg_self;
    LUCY_TermMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMMATCHER, LUCY_TermMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingMatcher_new);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("posting_list", 1),
        XSBIND_PARAM("compiler", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_MatchPostingMatcher* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_PostingList* arg_posting_list;
    lucy_Compiler* arg_compiler;
    lucy_MatchPostingMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_posting_list = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "posting_list", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    arg_self = (lucy_MatchPostingMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchPostMatcher_init(arg_self, arg_similarity, arg_posting_list, arg_compiler);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingMatcher_score);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingMatcher_score) {
    dXSARGS;
    lucy_MatchPostingMatcher* arg_self;
    LUCY_MatchPostMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPostingMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTINGMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTINGMATCHER, LUCY_MatchPostMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePostingMatcher_new);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePostingMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("sim", 1),
        XSBIND_PARAM("plist", 1),
        XSBIND_PARAM("compiler", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ScorePostingMatcher* arg_self;
    lucy_Similarity* arg_sim;
    lucy_PostingList* arg_plist;
    lucy_Compiler* arg_compiler;
    lucy_ScorePostingMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_sim = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "sim", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_plist = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "plist", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    arg_self = (lucy_ScorePostingMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ScorePostMatcher_init(arg_self, arg_sim, arg_plist, arg_compiler);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_ScorePostingMatcher_score);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePostingMatcher_score) {
    dXSARGS;
    lucy_ScorePostingMatcher* arg_self;
    LUCY_ScorePostMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ScorePostingMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTINGMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTINGMATCHER, LUCY_ScorePostMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Posting_ScorePostingMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Posting_ScorePostingMatcher_DESTROY) {
    dXSARGS;
    lucy_ScorePostingMatcher* arg_self;
    LUCY_ScorePostMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ScorePostingMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTINGMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SCOREPOSTINGMATCHER, LUCY_ScorePostMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RichPostingMatcher_new);
XS_INTERNAL(XS_Lucy_Index_Posting_RichPostingMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("posting_list", 1),
        XSBIND_PARAM("compiler", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RichPostingMatcher* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_PostingList* arg_posting_list;
    lucy_Compiler* arg_compiler;
    lucy_RichPostingMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_posting_list = (lucy_PostingList*)XSBind_arg_to_cfish(aTHX_ sv, "posting_list", LUCY_POSTINGLIST, NULL);
    sv = ST(locations[2]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    arg_self = (lucy_RichPostingMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RichPostMatcher_init(arg_self, arg_similarity, arg_posting_list, arg_compiler);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_new);
XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("bit_vector", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_BitVecMatcher* arg_self;
    lucy_BitVector* arg_bit_vector;
    lucy_BitVecMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_bit_vector = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "bit_vector", LUCY_BITVECTOR, NULL);
    arg_self = (lucy_BitVecMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BitVecMatcher_init(arg_self, arg_bit_vector);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_next);
XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_next) {
    dXSARGS;
    lucy_BitVecMatcher* arg_self;
    LUCY_BitVecMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVecMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECMATCHER, LUCY_BitVecMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_BitVecMatcher* arg_self;
    int32_t arg_target;
    LUCY_BitVecMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVecMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECMATCHER, LUCY_BitVecMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_get_doc_id) {
    dXSARGS;
    lucy_BitVecMatcher* arg_self;
    LUCY_BitVecMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVecMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECMATCHER, LUCY_BitVecMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_BitVecMatcher_DESTROY) {
    dXSARGS;
    lucy_BitVecMatcher* arg_self;
    LUCY_BitVecMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVecMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECMATCHER, LUCY_BitVecMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchMatcher_new);
XS_INTERNAL(XS_Lucy_Search_NoMatchMatcher_new) {
    dXSARGS;
    lucy_NoMatchMatcher* arg_self;
    lucy_NoMatchMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_NoMatchMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NoMatchMatcher_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_NoMatchMatcher_next);
XS_INTERNAL(XS_Lucy_Search_NoMatchMatcher_next) {
    dXSARGS;
    lucy_NoMatchMatcher* arg_self;
    LUCY_NoMatchMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHMATCHER, LUCY_NoMatchMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_NoMatchMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_NoMatchMatcher* arg_self;
    int32_t arg_target;
    LUCY_NoMatchMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHMATCHER, LUCY_NoMatchMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyMatcher_new);
XS_INTERNAL(XS_Lucy_Search_PolyMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("children", 1),
        XSBIND_PARAM("similarity", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyMatcher* arg_self;
    cfish_Vector* arg_children;
    lucy_Similarity* arg_similarity;
    lucy_PolyMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_children = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "children", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_similarity = locations[1] < items ? (lucy_Similarity*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL) : NULL;
    arg_self = (lucy_PolyMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyMatcher_init(arg_self, arg_children, arg_similarity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PolyMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_PolyMatcher_DESTROY) {
    dXSARGS;
    lucy_PolyMatcher* arg_self;
    LUCY_PolyMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYMATCHER, LUCY_PolyMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_ANDMatcher_new);
XS_INTERNAL(XS_Lucy_Search_ANDMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("children", 1),
        XSBIND_PARAM("similarity", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_ANDMatcher* arg_self;
    cfish_Vector* arg_children;
    lucy_Similarity* arg_similarity;
    lucy_ANDMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_children = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "children", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_similarity = locations[1] < items ? (lucy_Similarity*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL) : NULL;
    arg_self = (lucy_ANDMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ANDMatcher_init(arg_self, arg_children, arg_similarity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ANDMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_ANDMatcher_DESTROY) {
    dXSARGS;
    lucy_ANDMatcher* arg_self;
    LUCY_ANDMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDMATCHER, LUCY_ANDMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_ANDMatcher_next);
XS_INTERNAL(XS_Lucy_Search_ANDMatcher_next) {
    dXSARGS;
    lucy_ANDMatcher* arg_self;
    LUCY_ANDMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDMATCHER, LUCY_ANDMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_ANDMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_ANDMatcher* arg_self;
    int32_t arg_target;
    LUCY_ANDMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDMATCHER, LUCY_ANDMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDMatcher_score);
XS_INTERNAL(XS_Lucy_Search_ANDMatcher_score) {
    dXSARGS;
    lucy_ANDMatcher* arg_self;
    LUCY_ANDMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDMATCHER, LUCY_ANDMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_ANDMatcher_get_doc_id) {
    dXSARGS;
    lucy_ANDMatcher* arg_self;
    LUCY_ANDMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDMATCHER, LUCY_ANDMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORMatcher_new);
XS_INTERNAL(XS_Lucy_Search_ORMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("children", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_ORMatcher* arg_self;
    cfish_Vector* arg_children;
    lucy_ORMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_children = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "children", CFISH_VECTOR, NULL);
    arg_self = (lucy_ORMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ORMatcher_init(arg_self, arg_children);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ORMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_ORMatcher_DESTROY) {
    dXSARGS;
    lucy_ORMatcher* arg_self;
    LUCY_ORMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORMATCHER, LUCY_ORMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_ORMatcher_next);
XS_INTERNAL(XS_Lucy_Search_ORMatcher_next) {
    dXSARGS;
    lucy_ORMatcher* arg_self;
    LUCY_ORMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORMATCHER, LUCY_ORMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_ORMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_ORMatcher* arg_self;
    int32_t arg_target;
    LUCY_ORMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORMATCHER, LUCY_ORMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_ORMatcher_get_doc_id) {
    dXSARGS;
    lucy_ORMatcher* arg_self;
    LUCY_ORMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORMATCHER, LUCY_ORMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORScorer_new);
XS_INTERNAL(XS_Lucy_Search_ORScorer_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("children", 1),
        XSBIND_PARAM("similarity", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_ORScorer* arg_self;
    cfish_Vector* arg_children;
    lucy_Similarity* arg_similarity;
    lucy_ORScorer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_children = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "children", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_similarity = locations[1] < items ? (lucy_Similarity*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL) : NULL;
    arg_self = (lucy_ORScorer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ORScorer_init(arg_self, arg_children, arg_similarity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ORScorer_DESTROY);
XS_INTERNAL(XS_Lucy_Search_ORScorer_DESTROY) {
    dXSARGS;
    lucy_ORScorer* arg_self;
    LUCY_ORScorer_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORScorer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORSCORER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORSCORER, LUCY_ORScorer_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_ORScorer_next);
XS_INTERNAL(XS_Lucy_Search_ORScorer_next) {
    dXSARGS;
    lucy_ORScorer* arg_self;
    LUCY_ORScorer_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORScorer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORSCORER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORSCORER, LUCY_ORScorer_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORScorer_advance);
XS_INTERNAL(XS_Lucy_Search_ORScorer_advance) {
    dXSARGS;
    SV *sv;
    lucy_ORScorer* arg_self;
    int32_t arg_target;
    LUCY_ORScorer_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORScorer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORSCORER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORSCORER, LUCY_ORScorer_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORScorer_score);
XS_INTERNAL(XS_Lucy_Search_ORScorer_score) {
    dXSARGS;
    lucy_ORScorer* arg_self;
    LUCY_ORScorer_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORScorer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORSCORER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORSCORER, LUCY_ORScorer_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORScorer_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_ORScorer_get_doc_id) {
    dXSARGS;
    lucy_ORScorer* arg_self;
    LUCY_ORScorer_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORScorer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORSCORER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORSCORER, LUCY_ORScorer_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_new);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 0),
        XSBIND_PARAM("required_matcher", 1),
        XSBIND_PARAM("optional_matcher", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RequiredOptionalMatcher* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_Matcher* arg_required_matcher;
    lucy_Matcher* arg_optional_matcher;
    lucy_RequiredOptionalMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_similarity = locations[0] < items ? (lucy_Similarity*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL) : NULL;
    sv = ST(locations[1]);
    arg_required_matcher = (lucy_Matcher*)XSBind_arg_to_cfish(aTHX_ sv, "required_matcher", LUCY_MATCHER, NULL);
    sv = ST(locations[2]);
    arg_optional_matcher = locations[2] < items ? (lucy_Matcher*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "optional_matcher", LUCY_MATCHER, NULL) : NULL;
    arg_self = (lucy_RequiredOptionalMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ReqOptMatcher_init(arg_self, arg_similarity, arg_required_matcher, arg_optional_matcher);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_DESTROY) {
    dXSARGS;
    lucy_RequiredOptionalMatcher* arg_self;
    LUCY_ReqOptMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALMATCHER, LUCY_ReqOptMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_next);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_next) {
    dXSARGS;
    lucy_RequiredOptionalMatcher* arg_self;
    LUCY_ReqOptMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALMATCHER, LUCY_ReqOptMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_RequiredOptionalMatcher* arg_self;
    int32_t arg_target;
    LUCY_ReqOptMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALMATCHER, LUCY_ReqOptMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_score);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_score) {
    dXSARGS;
    lucy_RequiredOptionalMatcher* arg_self;
    LUCY_ReqOptMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALMATCHER, LUCY_ReqOptMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalMatcher_get_doc_id) {
    dXSARGS;
    lucy_RequiredOptionalMatcher* arg_self;
    LUCY_ReqOptMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALMATCHER, LUCY_ReqOptMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTMatcher_new);
XS_INTERNAL(XS_Lucy_Search_NOTMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("negated_matcher", 1),
        XSBIND_PARAM("doc_max", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_NOTMatcher* arg_self;
    lucy_Matcher* arg_negated_matcher;
    int32_t arg_doc_max;
    lucy_NOTMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_negated_matcher = (lucy_Matcher*)XSBind_arg_to_cfish(aTHX_ sv, "negated_matcher", LUCY_MATCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    arg_self = (lucy_NOTMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NOTMatcher_init(arg_self, arg_negated_matcher, arg_doc_max);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_NOTMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_NOTMatcher_DESTROY) {
    dXSARGS;
    lucy_NOTMatcher* arg_self;
    LUCY_NOTMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTMATCHER, LUCY_NOTMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_NOTMatcher_next);
XS_INTERNAL(XS_Lucy_Search_NOTMatcher_next) {
    dXSARGS;
    lucy_NOTMatcher* arg_self;
    LUCY_NOTMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTMATCHER, LUCY_NOTMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_NOTMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_NOTMatcher* arg_self;
    int32_t arg_target;
    LUCY_NOTMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTMATCHER, LUCY_NOTMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTMatcher_score);
XS_INTERNAL(XS_Lucy_Search_NOTMatcher_score) {
    dXSARGS;
    lucy_NOTMatcher* arg_self;
    LUCY_NOTMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTMATCHER, LUCY_NOTMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_NOTMatcher_get_doc_id) {
    dXSARGS;
    lucy_NOTMatcher* arg_self;
    LUCY_NOTMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTMATCHER, LUCY_NOTMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeMatcher_new);
XS_INTERNAL(XS_Lucy_Search_RangeMatcher_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("lower_bound", 1),
        XSBIND_PARAM("upper_bound", 1),
        XSBIND_PARAM("sort_cache", 1),
        XSBIND_PARAM("doc_max", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_RangeMatcher* arg_self;
    int32_t arg_lower_bound;
    int32_t arg_upper_bound;
    lucy_SortCache* arg_sort_cache;
    int32_t arg_doc_max;
    lucy_RangeMatcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "lower_bound");
    }
    arg_lower_bound = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "upper_bound");
    }
    arg_upper_bound = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    arg_sort_cache = (lucy_SortCache*)XSBind_arg_to_cfish(aTHX_ sv, "sort_cache", LUCY_SORTCACHE, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    arg_self = (lucy_RangeMatcher*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RangeMatcher_init(arg_self, arg_lower_bound, arg_upper_bound, arg_sort_cache, arg_doc_max);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_RangeMatcher_next);
XS_INTERNAL(XS_Lucy_Search_RangeMatcher_next) {
    dXSARGS;
    lucy_RangeMatcher* arg_self;
    LUCY_RangeMatcher_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEMATCHER, LUCY_RangeMatcher_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeMatcher_advance);
XS_INTERNAL(XS_Lucy_Search_RangeMatcher_advance) {
    dXSARGS;
    SV *sv;
    lucy_RangeMatcher* arg_self;
    int32_t arg_target;
    LUCY_RangeMatcher_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEMATCHER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEMATCHER, LUCY_RangeMatcher_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeMatcher_score);
XS_INTERNAL(XS_Lucy_Search_RangeMatcher_score) {
    dXSARGS;
    lucy_RangeMatcher* arg_self;
    LUCY_RangeMatcher_Score_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEMATCHER, LUCY_RangeMatcher_Score);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeMatcher_get_doc_id);
XS_INTERNAL(XS_Lucy_Search_RangeMatcher_get_doc_id) {
    dXSARGS;
    lucy_RangeMatcher* arg_self;
    LUCY_RangeMatcher_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEMATCHER, LUCY_RangeMatcher_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeMatcher_DESTROY);
XS_INTERNAL(XS_Lucy_Search_RangeMatcher_DESTROY) {
    dXSARGS;
    lucy_RangeMatcher* arg_self;
    LUCY_RangeMatcher_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeMatcher*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEMATCHER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEMATCHER, LUCY_RangeMatcher_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingList_new);
XS_INTERNAL(XS_Lucy_Index_PostingList_new) {
    dXSARGS;
    lucy_PostingList* arg_self;
    lucy_PostingList* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_PostingList*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PList_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PostingList_get_posting);
XS_INTERNAL(XS_Lucy_Index_PostingList_get_posting) {
    dXSARGS;
    lucy_PostingList* arg_self;
    LUCY_PList_Get_Posting_t method;
    lucy_Posting* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLIST, LUCY_PList_Get_Posting);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingList_get_doc_freq);
XS_INTERNAL(XS_Lucy_Index_PostingList_get_doc_freq) {
    dXSARGS;
    lucy_PostingList* arg_self;
    LUCY_PList_Get_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLIST, LUCY_PList_Get_Doc_Freq);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingList_seek);
XS_INTERNAL(XS_Lucy_Index_PostingList_seek) {
    dXSARGS;
    SV *sv;
    lucy_PostingList* arg_self;
    cfish_Obj* arg_target;
    LUCY_PList_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [target]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLIST, NULL);
    sv = ST(1);
    arg_target = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "target", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLIST, LUCY_PList_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingList_seek_lex);
XS_INTERNAL(XS_Lucy_Index_PostingList_seek_lex) {
    dXSARGS;
    SV *sv;
    lucy_PostingList* arg_self;
    lucy_Lexicon* arg_lexicon;
    LUCY_PList_Seek_Lex_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, lexicon");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLIST, NULL);
    sv = ST(1);
    arg_lexicon = (lucy_Lexicon*)XSBind_arg_to_cfish(aTHX_ sv, "lexicon", LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLIST, LUCY_PList_Seek_Lex);
    method(arg_self, arg_lexicon);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingList_make_matcher);
XS_INTERNAL(XS_Lucy_Index_PostingList_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PostingList* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_Compiler* arg_compiler;
    bool arg_need_score;
    LUCY_PList_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLIST, NULL);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLIST, LUCY_PList_Make_Matcher);
    retval = method(arg_self, arg_similarity, arg_compiler, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingList_read_raw);
XS_INTERNAL(XS_Lucy_Index_PostingList_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PostingList* arg_self;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_PList_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLIST, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLIST, LUCY_PList_Read_Raw);
    retval = method(arg_self, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawPostingList_new);
XS_INTERNAL(XS_Lucy_Index_RawPostingList_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("instream", 1),
        XSBIND_PARAM("lex_start", 1),
        XSBIND_PARAM("lex_end", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_RawPostingList* arg_self;
    lucy_Schema* arg_schema;
    cfish_String* arg_field;
    lucy_InStream* arg_instream;
    int64_t arg_lex_start;
    int64_t arg_lex_end;
    lucy_RawPostingList* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "lex_start");
    }
    arg_lex_start = (int64_t)SvNV(sv);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "lex_end");
    }
    arg_lex_end = (int64_t)SvNV(sv);
    arg_self = (lucy_RawPostingList*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RawPList_init(arg_self, arg_schema, arg_field, arg_instream, arg_lex_start, arg_lex_end);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_RawPostingList_DESTROY);
XS_INTERNAL(XS_Lucy_Index_RawPostingList_DESTROY) {
    dXSARGS;
    lucy_RawPostingList* arg_self;
    LUCY_RawPList_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGLIST, LUCY_RawPList_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_RawPostingList_read_raw);
XS_INTERNAL(XS_Lucy_Index_RawPostingList_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RawPostingList* arg_self;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_RawPList_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_RawPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGLIST, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGLIST, LUCY_RawPList_Read_Raw);
    retval = method(arg_self, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawPostingList_get_posting);
XS_INTERNAL(XS_Lucy_Index_RawPostingList_get_posting) {
    dXSARGS;
    lucy_RawPostingList* arg_self;
    LUCY_RawPList_Get_Posting_t method;
    lucy_Posting* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGLIST, LUCY_RawPList_Get_Posting);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_new);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("plist_reader", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegPostingList* arg_self;
    lucy_PostingListReader* arg_plist_reader;
    cfish_String* arg_field;
    lucy_SegPostingList* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_plist_reader = (lucy_PostingListReader*)XSBind_arg_to_cfish(aTHX_ sv, "plist_reader", LUCY_POSTINGLISTREADER, NULL);
    sv = ST(locations[1]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_SegPostingList*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SegPList_init(arg_self, arg_plist_reader, arg_field);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_post_stream);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_post_stream) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Get_Post_Stream_t method;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Get_Post_Stream);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_count);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_count) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Get_Count_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Get_Count);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_DESTROY) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_doc_freq);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_doc_freq) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Get_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Get_Doc_Freq);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_doc_id);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_doc_id) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Get_Doc_ID_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Get_Doc_ID);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_posting);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_get_posting) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Get_Posting_t method;
    lucy_Posting* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Get_Posting);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_next);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_next) {
    dXSARGS;
    lucy_SegPostingList* arg_self;
    LUCY_SegPList_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_advance);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_advance) {
    dXSARGS;
    SV *sv;
    lucy_SegPostingList* arg_self;
    int32_t arg_target;
    LUCY_SegPList_Advance_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Advance);
    retval = method(arg_self, arg_target);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_seek);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_seek) {
    dXSARGS;
    SV *sv;
    lucy_SegPostingList* arg_self;
    cfish_Obj* arg_target;
    LUCY_SegPList_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [target]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);
    sv = ST(1);
    arg_target = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "target", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_seek_lex);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_seek_lex) {
    dXSARGS;
    SV *sv;
    lucy_SegPostingList* arg_self;
    lucy_Lexicon* arg_lexicon;
    LUCY_SegPList_Seek_Lex_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, lexicon");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);
    sv = ST(1);
    arg_lexicon = (lucy_Lexicon*)XSBind_arg_to_cfish(aTHX_ sv, "lexicon", LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Seek_Lex);
    method(arg_self, arg_lexicon);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_make_matcher);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("similarity", 1),
        XSBIND_PARAM("compiler", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_SegPostingList* arg_self;
    lucy_Similarity* arg_similarity;
    lucy_Compiler* arg_compiler;
    bool arg_need_score;
    LUCY_SegPList_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);
    sv = ST(locations[0]);
    arg_similarity = (lucy_Similarity*)XSBind_arg_to_cfish(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL);
    sv = ST(locations[1]);
    arg_compiler = (lucy_Compiler*)XSBind_arg_to_cfish(aTHX_ sv, "compiler", LUCY_COMPILER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Make_Matcher);
    retval = method(arg_self, arg_similarity, arg_compiler, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegPostingList_read_raw);
XS_INTERNAL(XS_Lucy_Index_SegPostingList_read_raw) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("last_doc_id", 1),
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("mem_pool", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_SegPostingList* arg_self;
    int32_t arg_last_doc_id;
    cfish_String* arg_term_text;
    lucy_MemoryPool* arg_mem_pool;
    LUCY_SegPList_Read_Raw_t method;
    lucy_RawPosting* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_SegPostingList*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGPOSTINGLIST, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "last_doc_id");
    }
    arg_last_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    arg_term_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_mem_pool = (lucy_MemoryPool*)XSBind_arg_to_cfish(aTHX_ sv, "mem_pool", LUCY_MEMORYPOOL, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGPOSTINGLIST, LUCY_SegPList_Read_Raw);
    retval = method(arg_self, arg_last_doc_id, arg_term_text, arg_mem_pool);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortSpec_new);
XS_INTERNAL(XS_Lucy_Search_SortSpec_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("rules", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_SortSpec* arg_self;
    cfish_Vector* arg_rules;
    lucy_SortSpec* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_rules = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "rules", CFISH_VECTOR, NULL);
    arg_self = (lucy_SortSpec*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortSpec_init(arg_self, arg_rules);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_SortSpec_serialize);
XS_INTERNAL(XS_Lucy_Search_SortSpec_serialize) {
    dXSARGS;
    SV *sv;
    lucy_SortSpec* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_SortSpec_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortSpec*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTSPEC, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTSPEC, LUCY_SortSpec_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_SortSpec_deserialize);
XS_INTERNAL(XS_Lucy_Search_SortSpec_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_SortSpec* arg_self;
    lucy_InStream* arg_instream;
    LUCY_SortSpec_Deserialize_t method;
    lucy_SortSpec* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortSpec*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTSPEC, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTSPEC, LUCY_SortSpec_Deserialize);
    arg_self = (lucy_SortSpec*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortSpec_get_rules);
XS_INTERNAL(XS_Lucy_Search_SortSpec_get_rules) {
    dXSARGS;
    lucy_SortSpec* arg_self;
    LUCY_SortSpec_Get_Rules_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortSpec*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTSPEC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTSPEC, LUCY_SortSpec_Get_Rules);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortSpec_DESTROY);
XS_INTERNAL(XS_Lucy_Search_SortSpec_DESTROY) {
    dXSARGS;
    lucy_SortSpec* arg_self;
    LUCY_SortSpec_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortSpec*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTSPEC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTSPEC, LUCY_SortSpec_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Query_new);
XS_INTERNAL(XS_Lucy_Search_Query_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("boost", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_Query* arg_self;
    float arg_boost;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_boost = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;
    arg_self = (lucy_Query*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Query_init(arg_self, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Query_make_compiler);
XS_INTERNAL(XS_Lucy_Search_Query_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Query* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_Query_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Query_set_boost);
XS_INTERNAL(XS_Lucy_Search_Query_set_boost) {
    dXSARGS;
    SV *sv;
    lucy_Query* arg_self;
    float arg_boost;
    LUCY_Query_Set_Boost_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, boost");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Set_Boost);
    method(arg_self, arg_boost);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Query_get_boost);
XS_INTERNAL(XS_Lucy_Search_Query_get_boost) {
    dXSARGS;
    lucy_Query* arg_self;
    LUCY_Query_Get_Boost_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Get_Boost);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Query_serialize);
XS_INTERNAL(XS_Lucy_Search_Query_serialize) {
    dXSARGS;
    SV *sv;
    lucy_Query* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_Query_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Query_deserialize);
XS_INTERNAL(XS_Lucy_Search_Query_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_Query* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Query_Deserialize_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Deserialize);
    arg_self = (lucy_Query*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Query_dump);
XS_INTERNAL(XS_Lucy_Search_Query_dump) {
    dXSARGS;
    lucy_Query* arg_self;
    LUCY_Query_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Query_load);
XS_INTERNAL(XS_Lucy_Search_Query_load) {
    dXSARGS;
    SV *sv;
    lucy_Query* arg_self;
    cfish_Obj* arg_dump;
    LUCY_Query_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Query*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_QUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_QUERY, LUCY_Query_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_new);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("terms", 1),
        XSBIND_PARAM("within", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ProximityQuery* arg_self;
    cfish_String* arg_field;
    cfish_Vector* arg_terms;
    uint32_t arg_within;
    lucy_ProximityQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_terms = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "terms", CFISH_VECTOR, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "within");
    }
    arg_within = (uint32_t)SvUV(sv);
    arg_self = (lucy_ProximityQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ProximityQuery_init(arg_self, arg_field, arg_terms, arg_within);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_LucyX_Search_ProximityQuery_get_field);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_get_field) {
    dXSARGS;
    lucy_ProximityQuery* arg_self;
    LUCY_ProximityQuery_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_get_terms);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_get_terms) {
    dXSARGS;
    lucy_ProximityQuery* arg_self;
    LUCY_ProximityQuery_Get_Terms_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Get_Terms);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_get_within);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_get_within) {
    dXSARGS;
    lucy_ProximityQuery* arg_self;
    LUCY_ProximityQuery_Get_Within_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Get_Within);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_make_compiler);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ProximityQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_ProximityQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_equals);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_ProximityQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_ProximityQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_to_string);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_to_string) {
    dXSARGS;
    lucy_ProximityQuery* arg_self;
    LUCY_ProximityQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_serialize);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_ProximityQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_ProximityQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_deserialize);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_ProximityQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_ProximityQuery_Deserialize_t method;
    lucy_ProximityQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Deserialize);
    arg_self = (lucy_ProximityQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_dump);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_dump) {
    dXSARGS;
    lucy_ProximityQuery* arg_self;
    LUCY_ProximityQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_load);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_ProximityQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_ProximityQuery_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityQuery_DESTROY);
XS_INTERNAL(XS_LucyX_Search_ProximityQuery_DESTROY) {
    dXSARGS;
    lucy_ProximityQuery* arg_self;
    LUCY_ProximityQuery_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYQUERY, LUCY_ProximityQuery_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_new);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("terms", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PhraseQuery* arg_self;
    cfish_String* arg_field;
    cfish_Vector* arg_terms;
    lucy_PhraseQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_terms = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "terms", CFISH_VECTOR, NULL);
    arg_self = (lucy_PhraseQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PhraseQuery_init(arg_self, arg_field, arg_terms);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PhraseQuery_get_field);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_get_field) {
    dXSARGS;
    lucy_PhraseQuery* arg_self;
    LUCY_PhraseQuery_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_get_terms);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_get_terms) {
    dXSARGS;
    lucy_PhraseQuery* arg_self;
    LUCY_PhraseQuery_Get_Terms_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Get_Terms);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PhraseQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_PhraseQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_equals);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_PhraseQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_PhraseQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_to_string) {
    dXSARGS;
    lucy_PhraseQuery* arg_self;
    LUCY_PhraseQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_serialize);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_PhraseQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_PhraseQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_deserialize);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_PhraseQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_PhraseQuery_Deserialize_t method;
    lucy_PhraseQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Deserialize);
    arg_self = (lucy_PhraseQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_dump);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_dump) {
    dXSARGS;
    lucy_PhraseQuery* arg_self;
    LUCY_PhraseQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_load);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_PhraseQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_PhraseQuery_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseQuery_DESTROY);
XS_INTERNAL(XS_Lucy_Search_PhraseQuery_DESTROY) {
    dXSARGS;
    lucy_PhraseQuery* arg_self;
    LUCY_PhraseQuery_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASEQUERY, LUCY_PhraseQuery_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_new);
XS_INTERNAL(XS_Lucy_Search_TermQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_TermQuery* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    lucy_TermQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_TermQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TermQuery_init(arg_self, arg_field, arg_term);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_TermQuery_get_field);
XS_INTERNAL(XS_Lucy_Search_TermQuery_get_field) {
    dXSARGS;
    lucy_TermQuery* arg_self;
    LUCY_TermQuery_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_get_term);
XS_INTERNAL(XS_Lucy_Search_TermQuery_get_term) {
    dXSARGS;
    lucy_TermQuery* arg_self;
    LUCY_TermQuery_Get_Term_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Get_Term);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_TermQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_TermQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_TermQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_TermQuery_to_string) {
    dXSARGS;
    lucy_TermQuery* arg_self;
    LUCY_TermQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_serialize);
XS_INTERNAL(XS_Lucy_Search_TermQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_TermQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_TermQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_deserialize);
XS_INTERNAL(XS_Lucy_Search_TermQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_TermQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_TermQuery_Deserialize_t method;
    lucy_TermQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Deserialize);
    arg_self = (lucy_TermQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_dump);
XS_INTERNAL(XS_Lucy_Search_TermQuery_dump) {
    dXSARGS;
    lucy_TermQuery* arg_self;
    LUCY_TermQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_load);
XS_INTERNAL(XS_Lucy_Search_TermQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_TermQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_TermQuery_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_equals);
XS_INTERNAL(XS_Lucy_Search_TermQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_TermQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_TermQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermQuery_DESTROY);
XS_INTERNAL(XS_Lucy_Search_TermQuery_DESTROY) {
    dXSARGS;
    lucy_TermQuery* arg_self;
    LUCY_TermQuery_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMQUERY, LUCY_TermQuery_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_new);
XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_new) {
    dXSARGS;
    lucy_MatchAllQuery* arg_self;
    lucy_MatchAllQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_MatchAllQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchAllQuery_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_equals);
XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_MatchAllQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_MatchAllQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchAllQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLQUERY, LUCY_MatchAllQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_to_string) {
    dXSARGS;
    lucy_MatchAllQuery* arg_self;
    LUCY_MatchAllQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchAllQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLQUERY, LUCY_MatchAllQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_MatchAllQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_MatchAllQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_MatchAllQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_MatchAllQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLQUERY, LUCY_MatchAllQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_new);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("lower_term", 0),
        XSBIND_PARAM("upper_term", 0),
        XSBIND_PARAM("include_lower", 0),
        XSBIND_PARAM("include_upper", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_RangeQuery* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_lower_term;
    cfish_Obj* arg_upper_term;
    bool arg_include_lower;
    bool arg_include_upper;
    lucy_RangeQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_lower_term = locations[1] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "lower_term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[2]);
    arg_upper_term = locations[2] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "upper_term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[3]);
    arg_include_lower = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    sv = ST(locations[4]);
    arg_include_upper = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : true;
    arg_self = (lucy_RangeQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RangeQuery_init(arg_self, arg_field, arg_lower_term, arg_upper_term, arg_include_lower, arg_include_upper);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_RangeQuery_equals);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_RangeQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_RangeQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_to_string) {
    dXSARGS;
    lucy_RangeQuery* arg_self;
    LUCY_RangeQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RangeQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_RangeQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_serialize);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_RangeQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_RangeQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_deserialize);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_RangeQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_RangeQuery_Deserialize_t method;
    lucy_RangeQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Deserialize);
    arg_self = (lucy_RangeQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_dump);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_dump) {
    dXSARGS;
    lucy_RangeQuery* arg_self;
    LUCY_RangeQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_load);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_RangeQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_RangeQuery_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeQuery_DESTROY);
XS_INTERNAL(XS_Lucy_Search_RangeQuery_DESTROY) {
    dXSARGS;
    lucy_RangeQuery* arg_self;
    LUCY_RangeQuery_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RangeQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGEQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGEQUERY, LUCY_RangeQuery_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_new);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_new) {
    dXSARGS;
    lucy_NoMatchQuery* arg_self;
    lucy_NoMatchQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_NoMatchQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NoMatchQuery_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_set_fails_to_match);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_set_fails_to_match) {
    dXSARGS;
    SV *sv;
    lucy_NoMatchQuery* arg_self;
    bool arg_fails_to_match;
    LUCY_NoMatchQuery_Set_Fails_To_Match_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, fails_to_match");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "fails_to_match");
    }
    arg_fails_to_match = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Set_Fails_To_Match);
    method(arg_self, arg_fails_to_match);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_get_fails_to_match);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_get_fails_to_match) {
    dXSARGS;
    lucy_NoMatchQuery* arg_self;
    LUCY_NoMatchQuery_Get_Fails_To_Match_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Get_Fails_To_Match);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_dump);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_dump) {
    dXSARGS;
    lucy_NoMatchQuery* arg_self;
    LUCY_NoMatchQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_load);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_NoMatchQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_NoMatchQuery_Load_t method;
    lucy_NoMatchQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_serialize);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_NoMatchQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_NoMatchQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_deserialize);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_NoMatchQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_NoMatchQuery_Deserialize_t method;
    lucy_NoMatchQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Deserialize);
    arg_self = (lucy_NoMatchQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_equals);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_NoMatchQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_NoMatchQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_to_string) {
    dXSARGS;
    lucy_NoMatchQuery* arg_self;
    LUCY_NoMatchQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_NoMatchQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_NoMatchQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_NoMatchQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_NoMatchQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHQUERY, LUCY_NoMatchQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_new);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("children", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_PolyQuery* arg_self;
    cfish_Vector* arg_children;
    lucy_PolyQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_children = locations[0] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "children", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_PolyQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyQuery_init(arg_self, arg_children);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PolyQuery_add_child);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_add_child) {
    dXSARGS;
    SV *sv;
    lucy_PolyQuery* arg_self;
    lucy_Query* arg_query;
    LUCY_PolyQuery_Add_Child_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);
    sv = ST(1);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Add_Child);
    method(arg_self, arg_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_set_children);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_set_children) {
    dXSARGS;
    SV *sv;
    lucy_PolyQuery* arg_self;
    cfish_Vector* arg_children;
    LUCY_PolyQuery_Set_Children_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, children");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);
    sv = ST(1);
    arg_children = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "children", CFISH_VECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Set_Children);
    method(arg_self, arg_children);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_get_children);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_get_children) {
    dXSARGS;
    lucy_PolyQuery* arg_self;
    LUCY_PolyQuery_Get_Children_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Get_Children);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_serialize);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_PolyQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_PolyQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_deserialize);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_PolyQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_PolyQuery_Deserialize_t method;
    lucy_PolyQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Deserialize);
    arg_self = (lucy_PolyQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_dump);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_dump) {
    dXSARGS;
    lucy_PolyQuery* arg_self;
    LUCY_PolyQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_load);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_PolyQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_PolyQuery_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_equals);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_PolyQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_PolyQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyQuery_DESTROY);
XS_INTERNAL(XS_Lucy_Search_PolyQuery_DESTROY) {
    dXSARGS;
    lucy_PolyQuery* arg_self;
    LUCY_PolyQuery_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYQUERY, LUCY_PolyQuery_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_ORQuery_new);
XS_INTERNAL(XS_Lucy_Search_ORQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("children", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_ORQuery* arg_self;
    cfish_Vector* arg_children;
    lucy_ORQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_children = locations[0] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "children", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_ORQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ORQuery_init(arg_self, arg_children);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ORQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_ORQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ORQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_ORQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_ORQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORQUERY, LUCY_ORQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_ORQuery_to_string) {
    dXSARGS;
    lucy_ORQuery* arg_self;
    LUCY_ORQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORQUERY, LUCY_ORQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORQuery_equals);
XS_INTERNAL(XS_Lucy_Search_ORQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_ORQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_ORQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ORQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORQUERY, LUCY_ORQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTQuery_new);
XS_INTERNAL(XS_Lucy_Search_NOTQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("negated_query", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_NOTQuery* arg_self;
    lucy_Query* arg_negated_query;
    lucy_NOTQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_negated_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "negated_query", LUCY_QUERY, NULL);
    arg_self = (lucy_NOTQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NOTQuery_init(arg_self, arg_negated_query);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_NOTQuery_get_negated_query);
XS_INTERNAL(XS_Lucy_Search_NOTQuery_get_negated_query) {
    dXSARGS;
    lucy_NOTQuery* arg_self;
    LUCY_NOTQuery_Get_Negated_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTQUERY, LUCY_NOTQuery_Get_Negated_Query);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTQuery_set_negated_query);
XS_INTERNAL(XS_Lucy_Search_NOTQuery_set_negated_query) {
    dXSARGS;
    SV *sv;
    lucy_NOTQuery* arg_self;
    lucy_Query* arg_negated_query;
    LUCY_NOTQuery_Set_Negated_Query_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, negated_query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTQUERY, NULL);
    sv = ST(1);
    arg_negated_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "negated_query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTQUERY, LUCY_NOTQuery_Set_Negated_Query);
    method(arg_self, arg_negated_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_NOTQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_NOTQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_NOTQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_NOTQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_NOTQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTQUERY, LUCY_NOTQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_NOTQuery_to_string) {
    dXSARGS;
    lucy_NOTQuery* arg_self;
    LUCY_NOTQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTQUERY, LUCY_NOTQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTQuery_equals);
XS_INTERNAL(XS_Lucy_Search_NOTQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_NOTQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_NOTQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTQUERY, LUCY_NOTQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_new);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("required_query", 1),
        XSBIND_PARAM("optional_query", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RequiredOptionalQuery* arg_self;
    lucy_Query* arg_required_query;
    lucy_Query* arg_optional_query;
    lucy_RequiredOptionalQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_required_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "required_query", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_optional_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "optional_query", LUCY_QUERY, NULL);
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ReqOptQuery_init(arg_self, arg_required_query, arg_optional_query);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_get_required_query);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_get_required_query) {
    dXSARGS;
    lucy_RequiredOptionalQuery* arg_self;
    LUCY_ReqOptQuery_Get_Required_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_Get_Required_Query);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_set_required_query);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_set_required_query) {
    dXSARGS;
    SV *sv;
    lucy_RequiredOptionalQuery* arg_self;
    lucy_Query* arg_required_query;
    LUCY_ReqOptQuery_Set_Required_Query_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, required_query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);
    sv = ST(1);
    arg_required_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "required_query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_Set_Required_Query);
    method(arg_self, arg_required_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_get_optional_query);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_get_optional_query) {
    dXSARGS;
    lucy_RequiredOptionalQuery* arg_self;
    LUCY_ReqOptQuery_Get_Optional_Query_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_Get_Optional_Query);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_set_optional_query);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_set_optional_query) {
    dXSARGS;
    SV *sv;
    lucy_RequiredOptionalQuery* arg_self;
    lucy_Query* arg_optional_query;
    LUCY_ReqOptQuery_Set_Optional_Query_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, optional_query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);
    sv = ST(1);
    arg_optional_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "optional_query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_Set_Optional_Query);
    method(arg_self, arg_optional_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RequiredOptionalQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_ReqOptQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_to_string) {
    dXSARGS;
    lucy_RequiredOptionalQuery* arg_self;
    LUCY_ReqOptQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_equals);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_RequiredOptionalQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_ReqOptQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RequiredOptionalQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALQUERY, LUCY_ReqOptQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDQuery_new);
XS_INTERNAL(XS_Lucy_Search_ANDQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("children", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_ANDQuery* arg_self;
    cfish_Vector* arg_children;
    lucy_ANDQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_children = locations[0] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "children", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_ANDQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ANDQuery_init(arg_self, arg_children);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ANDQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_ANDQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ANDQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_ANDQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_ANDQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDQUERY, LUCY_ANDQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_ANDQuery_to_string) {
    dXSARGS;
    lucy_ANDQuery* arg_self;
    LUCY_ANDQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDQUERY, LUCY_ANDQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDQuery_equals);
XS_INTERNAL(XS_Lucy_Search_ANDQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_ANDQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_ANDQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ANDQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDQUERY, LUCY_ANDQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_new);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 0),
        XSBIND_PARAM("text", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LeafQuery* arg_self;
    cfish_String* arg_field;
    cfish_String* arg_text;
    lucy_LeafQuery* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_field = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_LeafQuery*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LeafQuery_init(arg_self, arg_field, arg_text);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_LeafQuery_get_field);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_get_field) {
    dXSARGS;
    lucy_LeafQuery* arg_self;
    LUCY_LeafQuery_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_get_text);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_get_text) {
    dXSARGS;
    lucy_LeafQuery* arg_self;
    LUCY_LeafQuery_Get_Text_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Get_Text);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_equals);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_equals) {
    dXSARGS;
    SV *sv;
    lucy_LeafQuery* arg_self;
    cfish_Obj* arg_other;
    LUCY_LeafQuery_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_to_string);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_to_string) {
    dXSARGS;
    lucy_LeafQuery* arg_self;
    LUCY_LeafQuery_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_serialize);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_serialize) {
    dXSARGS;
    SV *sv;
    lucy_LeafQuery* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_LeafQuery_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_deserialize);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_LeafQuery* arg_self;
    lucy_InStream* arg_instream;
    LUCY_LeafQuery_Deserialize_t method;
    lucy_LeafQuery* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Deserialize);
    arg_self = (lucy_LeafQuery*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_dump);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_dump) {
    dXSARGS;
    lucy_LeafQuery* arg_self;
    LUCY_LeafQuery_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_load);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_load) {
    dXSARGS;
    SV *sv;
    lucy_LeafQuery* arg_self;
    cfish_Obj* arg_dump;
    LUCY_LeafQuery_Load_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_make_compiler);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_make_compiler) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("subordinate", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_LeafQuery* arg_self;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    bool arg_subordinate;
    LUCY_LeafQuery_Make_Compiler_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[2]);
    arg_subordinate = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Make_Compiler);
    retval = method(arg_self, arg_searcher, arg_boost, arg_subordinate);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_LeafQuery_DESTROY);
XS_INTERNAL(XS_Lucy_Search_LeafQuery_DESTROY) {
    dXSARGS;
    lucy_LeafQuery* arg_self;
    LUCY_LeafQuery_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LeafQuery*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEAFQUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEAFQUERY, LUCY_LeafQuery_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_do_new);
XS_INTERNAL(XS_Lucy_Search_Compiler_do_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("similarity", 0),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Compiler* arg_self;
    lucy_Query* arg_parent;
    lucy_Searcher* arg_searcher;
    lucy_Similarity* arg_similarity;
    float arg_boost;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_parent = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    arg_similarity = locations[2] < items ? (lucy_Similarity*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "similarity", LUCY_SIMILARITY, NULL) : NULL;
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_Compiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Compiler_init(arg_self, arg_parent, arg_searcher, arg_similarity, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_Compiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_Compiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Compiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_Compiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_get_weight);
XS_INTERNAL(XS_Lucy_Search_Compiler_get_weight) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_Get_Weight_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Get_Weight);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_get_similarity);
XS_INTERNAL(XS_Lucy_Search_Compiler_get_similarity) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_Get_Similarity_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Get_Similarity);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_get_parent);
XS_INTERNAL(XS_Lucy_Search_Compiler_get_parent) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_Get_Parent_t method;
    lucy_Query* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Get_Parent);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_sum_of_squared_weights);
XS_INTERNAL(XS_Lucy_Search_Compiler_sum_of_squared_weights) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_Sum_Of_Squared_Weights_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Sum_Of_Squared_Weights);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_apply_norm_factor);
XS_INTERNAL(XS_Lucy_Search_Compiler_apply_norm_factor) {
    dXSARGS;
    SV *sv;
    lucy_Compiler* arg_self;
    float arg_factor;
    LUCY_Compiler_Apply_Norm_Factor_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, factor");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "factor");
    }
    arg_factor = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Apply_Norm_Factor);
    method(arg_self, arg_factor);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_normalize);
XS_INTERNAL(XS_Lucy_Search_Compiler_normalize) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_Normalize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Normalize);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_highlight_spans);
XS_INTERNAL(XS_Lucy_Search_Compiler_highlight_spans) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("doc_vec", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_Compiler* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_DocVector* arg_doc_vec;
    cfish_String* arg_field;
    LUCY_Compiler_Highlight_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_doc_vec = (lucy_DocVector*)XSBind_arg_to_cfish(aTHX_ sv, "doc_vec", LUCY_DOCVECTOR, NULL);
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Highlight_Spans);
    retval = method(arg_self, arg_searcher, arg_doc_vec, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_serialize);
XS_INTERNAL(XS_Lucy_Search_Compiler_serialize) {
    dXSARGS;
    SV *sv;
    lucy_Compiler* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_Compiler_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_deserialize);
XS_INTERNAL(XS_Lucy_Search_Compiler_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_Compiler* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Compiler_Deserialize_t method;
    lucy_Compiler* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Deserialize);
    arg_self = (lucy_Compiler*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_equals);
XS_INTERNAL(XS_Lucy_Search_Compiler_equals) {
    dXSARGS;
    SV *sv;
    lucy_Compiler* arg_self;
    cfish_Obj* arg_other;
    LUCY_Compiler_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_to_string);
XS_INTERNAL(XS_Lucy_Search_Compiler_to_string) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_Compiler_DESTROY);
XS_INTERNAL(XS_Lucy_Search_Compiler_DESTROY) {
    dXSARGS;
    lucy_Compiler* arg_self;
    LUCY_Compiler_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Compiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPILER, LUCY_Compiler_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_do_new);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_do_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1),
        XSBIND_PARAM("within", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    lucy_ProximityQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    uint32_t arg_within;
    lucy_ProximityCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_parent = (lucy_ProximityQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_PROXIMITYQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "within");
    }
    arg_within = (uint32_t)SvUV(sv);
    arg_self = (lucy_ProximityCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ProximityCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost, arg_within);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_make_matcher);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_ProximityCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_get_weight);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_get_weight) {
    dXSARGS;
    lucy_ProximityCompiler* arg_self;
    LUCY_ProximityCompiler_Get_Weight_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Get_Weight);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_sum_of_squared_weights);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_sum_of_squared_weights) {
    dXSARGS;
    lucy_ProximityCompiler* arg_self;
    LUCY_ProximityCompiler_Sum_Of_Squared_Weights_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Sum_Of_Squared_Weights);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_apply_norm_factor);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_apply_norm_factor) {
    dXSARGS;
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    float arg_factor;
    LUCY_ProximityCompiler_Apply_Norm_Factor_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, factor");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "factor");
    }
    arg_factor = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Apply_Norm_Factor);
    method(arg_self, arg_factor);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_highlight_spans);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_highlight_spans) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("doc_vec", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_DocVector* arg_doc_vec;
    cfish_String* arg_field;
    LUCY_ProximityCompiler_Highlight_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_doc_vec = (lucy_DocVector*)XSBind_arg_to_cfish(aTHX_ sv, "doc_vec", LUCY_DOCVECTOR, NULL);
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Highlight_Spans);
    retval = method(arg_self, arg_searcher, arg_doc_vec, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_equals);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_equals) {
    dXSARGS;
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    cfish_Obj* arg_other;
    LUCY_ProximityCompiler_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_serialize);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_serialize) {
    dXSARGS;
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_ProximityCompiler_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_deserialize);
XS_INTERNAL(XS_LucyX_Search_ProximityCompiler_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_ProximityCompiler* arg_self;
    lucy_InStream* arg_instream;
    LUCY_ProximityCompiler_Deserialize_t method;
    lucy_ProximityCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_ProximityCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PROXIMITYCOMPILER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PROXIMITYCOMPILER, LUCY_ProximityCompiler_Deserialize);
    arg_self = (lucy_ProximityCompiler*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_do_new);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_do_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    lucy_PhraseQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_PhraseCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_PhraseQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_PHRASEQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_PhraseCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PhraseCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_PhraseCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_get_weight);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_get_weight) {
    dXSARGS;
    lucy_PhraseCompiler* arg_self;
    LUCY_PhraseCompiler_Get_Weight_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Get_Weight);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_sum_of_squared_weights);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_sum_of_squared_weights) {
    dXSARGS;
    lucy_PhraseCompiler* arg_self;
    LUCY_PhraseCompiler_Sum_Of_Squared_Weights_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Sum_Of_Squared_Weights);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_apply_norm_factor);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_apply_norm_factor) {
    dXSARGS;
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    float arg_factor;
    LUCY_PhraseCompiler_Apply_Norm_Factor_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, factor");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "factor");
    }
    arg_factor = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Apply_Norm_Factor);
    method(arg_self, arg_factor);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_highlight_spans);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_highlight_spans) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("doc_vec", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_DocVector* arg_doc_vec;
    cfish_String* arg_field;
    LUCY_PhraseCompiler_Highlight_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_doc_vec = (lucy_DocVector*)XSBind_arg_to_cfish(aTHX_ sv, "doc_vec", LUCY_DOCVECTOR, NULL);
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Highlight_Spans);
    retval = method(arg_self, arg_searcher, arg_doc_vec, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_equals);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_equals) {
    dXSARGS;
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    cfish_Obj* arg_other;
    LUCY_PhraseCompiler_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_serialize);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_serialize) {
    dXSARGS;
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_PhraseCompiler_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_deserialize);
XS_INTERNAL(XS_Lucy_Search_PhraseCompiler_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_PhraseCompiler* arg_self;
    lucy_InStream* arg_instream;
    LUCY_PhraseCompiler_Deserialize_t method;
    lucy_PhraseCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PhraseCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_PHRASECOMPILER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_PHRASECOMPILER, LUCY_PhraseCompiler_Deserialize);
    arg_self = (lucy_PhraseCompiler*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_do_new);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_do_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_TermCompiler* arg_self;
    lucy_Query* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_TermCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_QUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_TermCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TermCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_TermCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_TermCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_TermCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_get_weight);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_get_weight) {
    dXSARGS;
    lucy_TermCompiler* arg_self;
    LUCY_TermCompiler_Get_Weight_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Get_Weight);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_sum_of_squared_weights);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_sum_of_squared_weights) {
    dXSARGS;
    lucy_TermCompiler* arg_self;
    LUCY_TermCompiler_Sum_Of_Squared_Weights_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Sum_Of_Squared_Weights);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_apply_norm_factor);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_apply_norm_factor) {
    dXSARGS;
    SV *sv;
    lucy_TermCompiler* arg_self;
    float arg_factor;
    LUCY_TermCompiler_Apply_Norm_Factor_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, factor");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "factor");
    }
    arg_factor = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Apply_Norm_Factor);
    method(arg_self, arg_factor);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_highlight_spans);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_highlight_spans) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("doc_vec", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_TermCompiler* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_DocVector* arg_doc_vec;
    cfish_String* arg_field;
    LUCY_TermCompiler_Highlight_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_doc_vec = (lucy_DocVector*)XSBind_arg_to_cfish(aTHX_ sv, "doc_vec", LUCY_DOCVECTOR, NULL);
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Highlight_Spans);
    retval = method(arg_self, arg_searcher, arg_doc_vec, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_equals);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_equals) {
    dXSARGS;
    SV *sv;
    lucy_TermCompiler* arg_self;
    cfish_Obj* arg_other;
    LUCY_TermCompiler_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_serialize);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_serialize) {
    dXSARGS;
    SV *sv;
    lucy_TermCompiler* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_TermCompiler_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_TermCompiler_deserialize);
XS_INTERNAL(XS_Lucy_Search_TermCompiler_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_TermCompiler* arg_self;
    lucy_InStream* arg_instream;
    LUCY_TermCompiler_Deserialize_t method;
    lucy_TermCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMCOMPILER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMCOMPILER, LUCY_TermCompiler_Deserialize);
    arg_self = (lucy_TermCompiler*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_MatchAllCompiler_new);
XS_INTERNAL(XS_Lucy_Search_MatchAllCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_MatchAllCompiler* arg_self;
    lucy_MatchAllQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_MatchAllCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_MatchAllQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_MATCHALLQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_MatchAllCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchAllCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_MatchAllCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_MatchAllCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_MatchAllCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_MatchAllCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_MatchAllCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHALLCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHALLCOMPILER, LUCY_MatchAllCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RangeCompiler_new);
XS_INTERNAL(XS_Lucy_Search_RangeCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RangeCompiler* arg_self;
    lucy_RangeQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_RangeCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_RangeQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_RANGEQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_RangeCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RangeCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_RangeCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_RangeCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RangeCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_RangeCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_RangeCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RANGECOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RANGECOMPILER, LUCY_RangeCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NoMatchCompiler_new);
XS_INTERNAL(XS_Lucy_Search_NoMatchCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_NoMatchCompiler* arg_self;
    lucy_NoMatchQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_NoMatchCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_NoMatchQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_NOMATCHQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_NoMatchCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NoMatchCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_NoMatchCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_NoMatchCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_NoMatchCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_NoMatchCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_NoMatchCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOMATCHCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOMATCHCOMPILER, LUCY_NoMatchCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyCompiler_new);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PolyCompiler* arg_self;
    lucy_PolyQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_PolyCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_PolyQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_POLYQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_PolyCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_PolyCompiler_sum_of_squared_weights);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_sum_of_squared_weights) {
    dXSARGS;
    lucy_PolyCompiler* arg_self;
    LUCY_PolyCompiler_Sum_Of_Squared_Weights_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYCOMPILER, LUCY_PolyCompiler_Sum_Of_Squared_Weights);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyCompiler_apply_norm_factor);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_apply_norm_factor) {
    dXSARGS;
    SV *sv;
    lucy_PolyCompiler* arg_self;
    float arg_factor;
    LUCY_PolyCompiler_Apply_Norm_Factor_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, factor");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYCOMPILER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "factor");
    }
    arg_factor = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYCOMPILER, LUCY_PolyCompiler_Apply_Norm_Factor);
    method(arg_self, arg_factor);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolyCompiler_highlight_spans);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_highlight_spans) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("doc_vec", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PolyCompiler* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_DocVector* arg_doc_vec;
    cfish_String* arg_field;
    LUCY_PolyCompiler_Highlight_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_PolyCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_doc_vec = (lucy_DocVector*)XSBind_arg_to_cfish(aTHX_ sv, "doc_vec", LUCY_DOCVECTOR, NULL);
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYCOMPILER, LUCY_PolyCompiler_Highlight_Spans);
    retval = method(arg_self, arg_searcher, arg_doc_vec, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_PolyCompiler_DESTROY);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_DESTROY) {
    dXSARGS;
    lucy_PolyCompiler* arg_self;
    LUCY_PolyCompiler_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYCOMPILER, LUCY_PolyCompiler_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolyCompiler_serialize);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_serialize) {
    dXSARGS;
    SV *sv;
    lucy_PolyCompiler* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_PolyCompiler_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYCOMPILER, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYCOMPILER, LUCY_PolyCompiler_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_PolyCompiler_deserialize);
XS_INTERNAL(XS_Lucy_Search_PolyCompiler_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_PolyCompiler* arg_self;
    lucy_InStream* arg_instream;
    LUCY_PolyCompiler_Deserialize_t method;
    lucy_PolyCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYCOMPILER, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYCOMPILER, LUCY_PolyCompiler_Deserialize);
    arg_self = (lucy_PolyCompiler*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ORCompiler_new);
XS_INTERNAL(XS_Lucy_Search_ORCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ORCompiler* arg_self;
    lucy_ORQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_ORCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_ORQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_ORQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_ORCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ORCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ORCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_ORCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_ORCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_ORCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_ORCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ORCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ORCOMPILER, LUCY_ORCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTCompiler_new);
XS_INTERNAL(XS_Lucy_Search_NOTCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_NOTCompiler* arg_self;
    lucy_NOTQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_NOTCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_NOTQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_NOTQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_NOTCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NOTCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_NOTCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_NOTCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_NOTCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_NOTCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_NOTCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTCOMPILER, LUCY_NOTCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTCompiler_sum_of_squared_weights);
XS_INTERNAL(XS_Lucy_Search_NOTCompiler_sum_of_squared_weights) {
    dXSARGS;
    lucy_NOTCompiler* arg_self;
    LUCY_NOTCompiler_Sum_Of_Squared_Weights_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NOTCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTCOMPILER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTCOMPILER, LUCY_NOTCompiler_Sum_Of_Squared_Weights);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_NOTCompiler_highlight_spans);
XS_INTERNAL(XS_Lucy_Search_NOTCompiler_highlight_spans) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("doc_vec", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_NOTCompiler* arg_self;
    lucy_Searcher* arg_searcher;
    lucy_DocVector* arg_doc_vec;
    cfish_String* arg_field;
    LUCY_NOTCompiler_Highlight_Spans_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_NOTCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NOTCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[1]);
    arg_doc_vec = (lucy_DocVector*)XSBind_arg_to_cfish(aTHX_ sv, "doc_vec", LUCY_DOCVECTOR, NULL);
    sv = ST(locations[2]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NOTCOMPILER, LUCY_NOTCompiler_Highlight_Spans);
    retval = method(arg_self, arg_searcher, arg_doc_vec, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_RequiredOptionalCompiler_new);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RequiredOptionalCompiler* arg_self;
    lucy_RequiredOptionalQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_RequiredOptionalCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_RequiredOptionalQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_REQUIREDOPTIONALQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_RequiredOptionalCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ReqOptCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_RequiredOptionalCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_RequiredOptionalCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RequiredOptionalCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_ReqOptCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_RequiredOptionalCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_REQUIREDOPTIONALCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_REQUIREDOPTIONALCOMPILER, LUCY_ReqOptCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_ANDCompiler_new);
XS_INTERNAL(XS_Lucy_Search_ANDCompiler_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("parent", 1),
        XSBIND_PARAM("searcher", 1),
        XSBIND_PARAM("boost", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_ANDCompiler* arg_self;
    lucy_ANDQuery* arg_parent;
    lucy_Searcher* arg_searcher;
    float arg_boost;
    lucy_ANDCompiler* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_parent = (lucy_ANDQuery*)XSBind_arg_to_cfish(aTHX_ sv, "parent", LUCY_ANDQUERY, NULL);
    sv = ST(locations[1]);
    arg_searcher = (lucy_Searcher*)XSBind_arg_to_cfish(aTHX_ sv, "searcher", LUCY_SEARCHER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);
    arg_self = (lucy_ANDCompiler*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ANDCompiler_init(arg_self, arg_parent, arg_searcher, arg_boost);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_ANDCompiler_make_matcher);
XS_INTERNAL(XS_Lucy_Search_ANDCompiler_make_matcher) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("need_score", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_ANDCompiler* arg_self;
    lucy_SegReader* arg_reader;
    bool arg_need_score;
    LUCY_ANDCompiler_Make_Matcher_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_ANDCompiler*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_ANDCOMPILER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "need_score");
    }
    arg_need_score = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_ANDCOMPILER, LUCY_ANDCompiler_Make_Matcher);
    retval = method(arg_self, arg_reader, arg_need_score);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortRule__new);
XS_INTERNAL(XS_Lucy_Search_SortRule__new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("type", 0),
        XSBIND_PARAM("field", 0),
        XSBIND_PARAM("reverse", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_SortRule* arg_self;
    int32_t arg_type;
    cfish_String* arg_field;
    bool arg_reverse;
    lucy_SortRule* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_type = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    sv = ST(locations[1]);
    arg_field = locations[1] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[2]);
    arg_reverse = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_SortRule*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortRule_init(arg_self, arg_type, arg_field, arg_reverse);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Search_SortRule_get_field);
XS_INTERNAL(XS_Lucy_Search_SortRule_get_field) {
    dXSARGS;
    lucy_SortRule* arg_self;
    LUCY_SortRule_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortRule*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTRULE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTRULE, LUCY_SortRule_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortRule_get_type);
XS_INTERNAL(XS_Lucy_Search_SortRule_get_type) {
    dXSARGS;
    lucy_SortRule* arg_self;
    LUCY_SortRule_Get_Type_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortRule*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTRULE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTRULE, LUCY_SortRule_Get_Type);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortRule_get_reverse);
XS_INTERNAL(XS_Lucy_Search_SortRule_get_reverse) {
    dXSARGS;
    lucy_SortRule* arg_self;
    LUCY_SortRule_Get_Reverse_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortRule*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTRULE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTRULE, LUCY_SortRule_Get_Reverse);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortRule_serialize);
XS_INTERNAL(XS_Lucy_Search_SortRule_serialize) {
    dXSARGS;
    SV *sv;
    lucy_SortRule* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_SortRule_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortRule*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTRULE, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTRULE, LUCY_SortRule_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Search_SortRule_deserialize);
XS_INTERNAL(XS_Lucy_Search_SortRule_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_SortRule* arg_self;
    lucy_InStream* arg_instream;
    LUCY_SortRule_Deserialize_t method;
    lucy_SortRule* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortRule*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTRULE, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTRULE, LUCY_SortRule_Deserialize);
    arg_self = (lucy_SortRule*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Search_SortRule_DESTROY);
XS_INTERNAL(XS_Lucy_Search_SortRule_DESTROY) {
    dXSARGS;
    lucy_SortRule* arg_self;
    LUCY_SortRule_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortRule*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTRULE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTRULE, LUCY_SortRule_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Simple_new);
XS_INTERNAL(XS_Lucy_Simple_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("path", 1),
        XSBIND_PARAM("language", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Simple* arg_self;
    cfish_Obj* arg_path;
    cfish_String* arg_language;
    lucy_Simple* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_path = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_language = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "language", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_Simple*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Simple_init(arg_self, arg_path, arg_language);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Simple_search);
XS_INTERNAL(XS_Lucy_Simple_search) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("query", 1),
        XSBIND_PARAM("offset", 0),
        XSBIND_PARAM("num_wanted", 0),
        XSBIND_PARAM("sort_spec", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Simple* arg_self;
    cfish_String* arg_query;
    uint32_t arg_offset;
    uint32_t arg_num_wanted;
    lucy_SortSpec* arg_sort_spec;
    LUCY_Simple_Search_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL);
    sv = ST(locations[0]);
    arg_query = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "query", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_offset = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 0;
    sv = ST(locations[2]);
    arg_num_wanted = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? (uint32_t)SvUV(sv) : 10;
    sv = ST(locations[3]);
    arg_sort_spec = locations[3] < items ? (lucy_SortSpec*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sort_spec", LUCY_SORTSPEC, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMPLE, LUCY_Simple_Search);
    retval = method(arg_self, arg_query, arg_offset, arg_num_wanted, arg_sort_spec);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Simple_next);
XS_INTERNAL(XS_Lucy_Simple_next) {
    dXSARGS;
    lucy_Simple* arg_self;
    LUCY_Simple_Next_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMPLE, LUCY_Simple_Next);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Simple_get_indexer);
XS_INTERNAL(XS_Lucy_Simple_get_indexer) {
    dXSARGS;
    lucy_Simple* arg_self;
    LUCY_Simple_Get_Indexer_t method;
    lucy_Indexer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMPLE, LUCY_Simple_Get_Indexer);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Simple_get_hits);
XS_INTERNAL(XS_Lucy_Simple_get_hits) {
    dXSARGS;
    lucy_Simple* arg_self;
    LUCY_Simple_Get_Hits_t method;
    lucy_Hits* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMPLE, LUCY_Simple_Get_Hits);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Simple_finish_indexing);
XS_INTERNAL(XS_Lucy_Simple_finish_indexing) {
    dXSARGS;
    lucy_Simple* arg_self;
    LUCY_Simple_Finish_Indexing_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMPLE, LUCY_Simple_Finish_Indexing);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Simple_DESTROY);
XS_INTERNAL(XS_Lucy_Simple_DESTROY) {
    dXSARGS;
    lucy_Simple* arg_self;
    LUCY_Simple_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMPLE, LUCY_Simple_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_new);
XS_INTERNAL(XS_Lucy_Object_BitVector_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("capacity", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_capacity;
    lucy_BitVector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_capacity = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (size_t)SvIV(sv) : 0;
    arg_self = (lucy_BitVector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BitVec_init(arg_self, arg_capacity);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Object_BitVector_get);
XS_INTERNAL(XS_Lucy_Object_BitVector_get) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_tick;
    LUCY_BitVec_Get_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tick");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Get);
    retval = method(arg_self, arg_tick);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_set);
XS_INTERNAL(XS_Lucy_Object_BitVector_set) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_tick;
    LUCY_BitVec_Set_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tick");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Set);
    method(arg_self, arg_tick);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_get_capacity);
XS_INTERNAL(XS_Lucy_Object_BitVector_get_capacity) {
    dXSARGS;
    lucy_BitVector* arg_self;
    LUCY_BitVec_Get_Capacity_t method;
    size_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Get_Capacity);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_next_hit);
XS_INTERNAL(XS_Lucy_Object_BitVector_next_hit) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_tick;
    LUCY_BitVec_Next_Hit_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tick");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Next_Hit);
    retval = method(arg_self, arg_tick);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_clear);
XS_INTERNAL(XS_Lucy_Object_BitVector_clear) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_tick;
    LUCY_BitVec_Clear_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tick");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Clear);
    method(arg_self, arg_tick);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_clear_all);
XS_INTERNAL(XS_Lucy_Object_BitVector_clear_all) {
    dXSARGS;
    lucy_BitVector* arg_self;
    LUCY_BitVec_Clear_All_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Clear_All);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_grow);
XS_INTERNAL(XS_Lucy_Object_BitVector_grow) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_capacity;
    LUCY_BitVec_Grow_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, capacity");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "capacity");
    }
    arg_capacity = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Grow);
    method(arg_self, arg_capacity);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_mimic);
XS_INTERNAL(XS_Lucy_Object_BitVector_mimic) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    cfish_Obj* arg_other;
    LUCY_BitVec_Mimic_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Mimic);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_and);
XS_INTERNAL(XS_Lucy_Object_BitVector_and) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    const lucy_BitVector* arg_other;
    LUCY_BitVec_And_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    arg_other = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "other", LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_And);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_or);
XS_INTERNAL(XS_Lucy_Object_BitVector_or) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    const lucy_BitVector* arg_other;
    LUCY_BitVec_Or_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    arg_other = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "other", LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Or);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_xor);
XS_INTERNAL(XS_Lucy_Object_BitVector_xor) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    const lucy_BitVector* arg_other;
    LUCY_BitVec_Xor_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    arg_other = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "other", LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Xor);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_and_not);
XS_INTERNAL(XS_Lucy_Object_BitVector_and_not) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    const lucy_BitVector* arg_other;
    LUCY_BitVec_And_Not_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    arg_other = (lucy_BitVector*)XSBind_arg_to_cfish(aTHX_ sv, "other", LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_And_Not);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_flip);
XS_INTERNAL(XS_Lucy_Object_BitVector_flip) {
    dXSARGS;
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_tick;
    LUCY_BitVec_Flip_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tick");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Flip);
    method(arg_self, arg_tick);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_flip_block);
XS_INTERNAL(XS_Lucy_Object_BitVector_flip_block) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("offset", 1),
        XSBIND_PARAM("length", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_BitVector* arg_self;
    size_t arg_offset;
    size_t arg_length;
    LUCY_BitVec_Flip_Block_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (size_t)SvIV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length");
    }
    arg_length = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Flip_Block);
    method(arg_self, arg_offset, arg_length);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_count);
XS_INTERNAL(XS_Lucy_Object_BitVector_count) {
    dXSARGS;
    lucy_BitVector* arg_self;
    LUCY_BitVec_Count_t method;
    size_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_to_array);
XS_INTERNAL(XS_Lucy_Object_BitVector_to_array) {
    dXSARGS;
    lucy_BitVector* arg_self;
    LUCY_BitVec_To_Array_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_To_Array);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_DESTROY);
XS_INTERNAL(XS_Lucy_Object_BitVector_DESTROY) {
    dXSARGS;
    lucy_BitVector* arg_self;
    LUCY_BitVec_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_BitVector_clone);
XS_INTERNAL(XS_Lucy_Object_BitVector_clone) {
    dXSARGS;
    lucy_BitVector* arg_self;
    LUCY_BitVec_Clone_t method;
    lucy_BitVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECTOR, LUCY_BitVec_Clone);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_BitVecDelDocs_new);
XS_INTERNAL(XS_Lucy_Index_BitVecDelDocs_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("filename", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_BitVecDelDocs* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_filename;
    lucy_BitVecDelDocs* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_filename = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "filename", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_BitVecDelDocs*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BitVecDelDocs_init(arg_self, arg_folder, arg_filename);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_BitVecDelDocs_DESTROY);
XS_INTERNAL(XS_Lucy_Index_BitVecDelDocs_DESTROY) {
    dXSARGS;
    lucy_BitVecDelDocs* arg_self;
    LUCY_BitVecDelDocs_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BitVecDelDocs*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BITVECDELDOCS, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BITVECDELDOCS, LUCY_BitVecDelDocs_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_I32Array_set);
XS_INTERNAL(XS_Lucy_Object_I32Array_set) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("tick", 1),
        XSBIND_PARAM("value", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_I32Array* arg_self;
    size_t arg_tick;
    int32_t arg_value;
    LUCY_I32Arr_Set_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_I32Array*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_I32ARRAY, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_I32ARRAY, LUCY_I32Arr_Set);
    method(arg_self, arg_tick, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Object_I32Array_get);
XS_INTERNAL(XS_Lucy_Object_I32Array_get) {
    dXSARGS;
    SV *sv;
    lucy_I32Array* arg_self;
    size_t arg_tick;
    LUCY_I32Arr_Get_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tick");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_I32Array*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_I32ARRAY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "tick");
    }
    arg_tick = (size_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_I32ARRAY, LUCY_I32Arr_Get);
    retval = method(arg_self, arg_tick);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_I32Array_get_size);
XS_INTERNAL(XS_Lucy_Object_I32Array_get_size) {
    dXSARGS;
    lucy_I32Array* arg_self;
    LUCY_I32Arr_Get_Size_t method;
    size_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_I32Array*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_I32ARRAY, LUCY_I32Arr_Get_Size);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Object_I32Array_DESTROY);
XS_INTERNAL(XS_Lucy_Object_I32Array_DESTROY) {
    dXSARGS;
    lucy_I32Array* arg_self;
    LUCY_I32Arr_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_I32Array*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_I32ARRAY, LUCY_I32Arr_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Segment_new);
XS_INTERNAL(XS_Lucy_Index_Segment_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("number", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_Segment* arg_self;
    int64_t arg_number;
    lucy_Segment* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "number");
    }
    arg_number = (int64_t)SvNV(sv);
    arg_self = (lucy_Segment*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Seg_init(arg_self, arg_number);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Segment_add_field);
XS_INTERNAL(XS_Lucy_Index_Segment_add_field) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    cfish_String* arg_field;
    LUCY_Seg_Add_Field_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Add_Field);
    retval = method(arg_self, arg_field);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_store_metadata);
XS_INTERNAL(XS_Lucy_Index_Segment_store_metadata) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("key", 1),
        XSBIND_PARAM("metadata", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Segment* arg_self;
    cfish_String* arg_key;
    cfish_Obj* arg_metadata;
    LUCY_Seg_Store_Metadata_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(locations[0]);
    arg_key = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "key", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_metadata = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "metadata", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Store_Metadata);
    arg_metadata = (cfish_Obj*)CFISH_INCREF(arg_metadata);
    method(arg_self, arg_key, arg_metadata);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Segment_fetch_metadata);
XS_INTERNAL(XS_Lucy_Index_Segment_fetch_metadata) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    cfish_String* arg_key;
    LUCY_Seg_Fetch_Metadata_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, key");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    arg_key = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "key", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Fetch_Metadata);
    retval = method(arg_self, arg_key);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_field_num);
XS_INTERNAL(XS_Lucy_Index_Segment_field_num) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    cfish_String* arg_field;
    LUCY_Seg_Field_Num_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Field_Num);
    retval = method(arg_self, arg_field);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_field_name);
XS_INTERNAL(XS_Lucy_Index_Segment_field_name) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    int32_t arg_field_num;
    LUCY_Seg_Field_Name_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field_num");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Field_Name);
    retval = method(arg_self, arg_field_num);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_get_name);
XS_INTERNAL(XS_Lucy_Index_Segment_get_name) {
    dXSARGS;
    lucy_Segment* arg_self;
    LUCY_Seg_Get_Name_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Get_Name);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_get_number);
XS_INTERNAL(XS_Lucy_Index_Segment_get_number) {
    dXSARGS;
    lucy_Segment* arg_self;
    LUCY_Seg_Get_Number_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Get_Number);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_set_count);
XS_INTERNAL(XS_Lucy_Index_Segment_set_count) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    int64_t arg_count;
    LUCY_Seg_Set_Count_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, count");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "count");
    }
    arg_count = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Set_Count);
    method(arg_self, arg_count);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Segment_get_count);
XS_INTERNAL(XS_Lucy_Index_Segment_get_count) {
    dXSARGS;
    lucy_Segment* arg_self;
    LUCY_Seg_Get_Count_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Get_Count);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_increment_count);
XS_INTERNAL(XS_Lucy_Index_Segment_increment_count) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    int64_t arg_increment;
    LUCY_Seg_Increment_Count_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, increment");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "increment");
    }
    arg_increment = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Increment_Count);
    retval = method(arg_self, arg_increment);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_get_metadata);
XS_INTERNAL(XS_Lucy_Index_Segment_get_metadata) {
    dXSARGS;
    lucy_Segment* arg_self;
    LUCY_Seg_Get_Metadata_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Get_Metadata);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_write_file);
XS_INTERNAL(XS_Lucy_Index_Segment_write_file) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    lucy_Folder* arg_folder;
    LUCY_Seg_Write_File_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, folder");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Write_File);
    method(arg_self, arg_folder);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Segment_read_file);
XS_INTERNAL(XS_Lucy_Index_Segment_read_file) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    lucy_Folder* arg_folder;
    LUCY_Seg_Read_File_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, folder");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Read_File);
    retval = method(arg_self, arg_folder);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_compare_to);
XS_INTERNAL(XS_Lucy_Index_Segment_compare_to) {
    dXSARGS;
    SV *sv;
    lucy_Segment* arg_self;
    cfish_Obj* arg_other;
    LUCY_Seg_Compare_To_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Compare_To);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Segment_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Segment_DESTROY) {
    dXSARGS;
    lucy_Segment* arg_self;
    LUCY_Seg_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Segment*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGMENT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGMENT, LUCY_Seg_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_new);
XS_INTERNAL(XS_Lucy_Index_Similarity_new) {
    dXSARGS;
    lucy_Similarity* arg_self;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Similarity*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Sim_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Similarity_make_posting);
XS_INTERNAL(XS_Lucy_Index_Similarity_make_posting) {
    dXSARGS;
    lucy_Similarity* arg_self;
    LUCY_Sim_Make_Posting_t method;
    lucy_Posting* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Make_Posting);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_make_posting_writer);
XS_INTERNAL(XS_Lucy_Index_Similarity_make_posting_writer) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("field_num", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_Similarity* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    int32_t arg_field_num;
    LUCY_Sim_Make_Posting_Writer_t method;
    lucy_PostingWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Make_Posting_Writer);
    retval = method(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_field_num);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_tf);
XS_INTERNAL(XS_Lucy_Index_Similarity_tf) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    float arg_freq;
    LUCY_Sim_TF_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, freq");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "freq");
    }
    arg_freq = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_TF);
    retval = method(arg_self, arg_freq);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_idf);
XS_INTERNAL(XS_Lucy_Index_Similarity_idf) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("doc_freq", 1),
        XSBIND_PARAM("total_docs", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Similarity* arg_self;
    int64_t arg_doc_freq;
    int64_t arg_total_docs;
    LUCY_Sim_IDF_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_freq");
    }
    arg_doc_freq = (int64_t)SvNV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "total_docs");
    }
    arg_total_docs = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_IDF);
    retval = method(arg_self, arg_doc_freq, arg_total_docs);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_coord);
XS_INTERNAL(XS_Lucy_Index_Similarity_coord) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("overlap", 1),
        XSBIND_PARAM("max_overlap", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Similarity* arg_self;
    uint32_t arg_overlap;
    uint32_t arg_max_overlap;
    LUCY_Sim_Coord_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "overlap");
    }
    arg_overlap = (uint32_t)SvUV(sv);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "max_overlap");
    }
    arg_max_overlap = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Coord);
    retval = method(arg_self, arg_overlap, arg_max_overlap);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_length_norm);
XS_INTERNAL(XS_Lucy_Index_Similarity_length_norm) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    uint32_t arg_num_tokens;
    LUCY_Sim_Length_Norm_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, num_tokens");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "num_tokens");
    }
    arg_num_tokens = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Length_Norm);
    retval = method(arg_self, arg_num_tokens);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_query_norm);
XS_INTERNAL(XS_Lucy_Index_Similarity_query_norm) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    float arg_sum_of_squared_weights;
    LUCY_Sim_Query_Norm_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, sum_of_squared_weights");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "sum_of_squared_weights");
    }
    arg_sum_of_squared_weights = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Query_Norm);
    retval = method(arg_self, arg_sum_of_squared_weights);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_encode_norm);
XS_INTERNAL(XS_Lucy_Index_Similarity_encode_norm) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    float arg_f;
    LUCY_Sim_Encode_Norm_t method;
    uint8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, f");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "f");
    }
    arg_f = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Encode_Norm);
    retval = method(arg_self, arg_f);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_decode_norm);
XS_INTERNAL(XS_Lucy_Index_Similarity_decode_norm) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    uint32_t arg_input;
    LUCY_Sim_Decode_Norm_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, input");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "input");
    }
    arg_input = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Decode_Norm);
    retval = method(arg_self, arg_input);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Similarity_DESTROY) {
    dXSARGS;
    lucy_Similarity* arg_self;
    LUCY_Sim_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_dump);
XS_INTERNAL(XS_Lucy_Index_Similarity_dump) {
    dXSARGS;
    lucy_Similarity* arg_self;
    LUCY_Sim_Dump_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Dump);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_load);
XS_INTERNAL(XS_Lucy_Index_Similarity_load) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    cfish_Obj* arg_dump;
    LUCY_Sim_Load_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, dump");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    arg_dump = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "dump", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Load);
    retval = method(arg_self, arg_dump);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_equals);
XS_INTERNAL(XS_Lucy_Index_Similarity_equals) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    cfish_Obj* arg_other;
    LUCY_Sim_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_serialize);
XS_INTERNAL(XS_Lucy_Index_Similarity_serialize) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_Sim_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Similarity_deserialize);
XS_INTERNAL(XS_Lucy_Index_Similarity_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_Similarity* arg_self;
    lucy_InStream* arg_instream;
    LUCY_Sim_Deserialize_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SIMILARITY, LUCY_Sim_Deserialize);
    arg_self = (lucy_Similarity*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_new);
XS_INTERNAL(XS_Lucy_Index_TermInfo_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("doc_freq", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_TermInfo* arg_self;
    int32_t arg_doc_freq;
    lucy_TermInfo* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_doc_freq = locations[0] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    arg_self = (lucy_TermInfo*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TInfo_init(arg_self, arg_doc_freq);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_TermInfo_get_doc_freq);
XS_INTERNAL(XS_Lucy_Index_TermInfo_get_doc_freq) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_Get_Doc_Freq_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Get_Doc_Freq);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_get_lex_filepos);
XS_INTERNAL(XS_Lucy_Index_TermInfo_get_lex_filepos) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_Get_Lex_FilePos_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Get_Lex_FilePos);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_get_post_filepos);
XS_INTERNAL(XS_Lucy_Index_TermInfo_get_post_filepos) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_Get_Post_FilePos_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Get_Post_FilePos);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_get_skip_filepos);
XS_INTERNAL(XS_Lucy_Index_TermInfo_get_skip_filepos) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_Get_Skip_FilePos_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Get_Skip_FilePos);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_set_doc_freq);
XS_INTERNAL(XS_Lucy_Index_TermInfo_set_doc_freq) {
    dXSARGS;
    SV *sv;
    lucy_TermInfo* arg_self;
    int32_t arg_doc_freq;
    LUCY_TInfo_Set_Doc_Freq_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_freq");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_freq");
    }
    arg_doc_freq = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Set_Doc_Freq);
    method(arg_self, arg_doc_freq);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_set_lex_filepos);
XS_INTERNAL(XS_Lucy_Index_TermInfo_set_lex_filepos) {
    dXSARGS;
    SV *sv;
    lucy_TermInfo* arg_self;
    int64_t arg_filepos;
    LUCY_TInfo_Set_Lex_FilePos_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, filepos");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "filepos");
    }
    arg_filepos = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Set_Lex_FilePos);
    method(arg_self, arg_filepos);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_set_post_filepos);
XS_INTERNAL(XS_Lucy_Index_TermInfo_set_post_filepos) {
    dXSARGS;
    SV *sv;
    lucy_TermInfo* arg_self;
    int64_t arg_filepos;
    LUCY_TInfo_Set_Post_FilePos_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, filepos");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "filepos");
    }
    arg_filepos = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Set_Post_FilePos);
    method(arg_self, arg_filepos);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_set_skip_filepos);
XS_INTERNAL(XS_Lucy_Index_TermInfo_set_skip_filepos) {
    dXSARGS;
    SV *sv;
    lucy_TermInfo* arg_self;
    int64_t arg_filepos;
    LUCY_TInfo_Set_Skip_FilePos_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, filepos");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "filepos");
    }
    arg_filepos = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Set_Skip_FilePos);
    method(arg_self, arg_filepos);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_reset);
XS_INTERNAL(XS_Lucy_Index_TermInfo_reset) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_mimic);
XS_INTERNAL(XS_Lucy_Index_TermInfo_mimic) {
    dXSARGS;
    SV *sv;
    lucy_TermInfo* arg_self;
    cfish_Obj* arg_other;
    LUCY_TInfo_Mimic_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Mimic);
    method(arg_self, arg_other);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_clone);
XS_INTERNAL(XS_Lucy_Index_TermInfo_clone) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_Clone_t method;
    lucy_TermInfo* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_Clone);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermInfo_to_string);
XS_INTERNAL(XS_Lucy_Index_TermInfo_to_string) {
    dXSARGS;
    lucy_TermInfo* arg_self;
    LUCY_TInfo_To_String_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermInfo*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMINFO, LUCY_TInfo_To_String);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_new);
XS_INTERNAL(XS_Lucy_Index_DataWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_DataWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_DataWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_DataWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DataWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DataWriter_add_inverted_doc);
XS_INTERNAL(XS_Lucy_Index_DataWriter_add_inverted_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("inverter", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DataWriter* arg_self;
    lucy_Inverter* arg_inverter;
    int32_t arg_doc_id;
    LUCY_DataWriter_Add_Inverted_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);
    sv = ST(locations[0]);
    arg_inverter = (lucy_Inverter*)XSBind_arg_to_cfish(aTHX_ sv, "inverter", LUCY_INVERTER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Add_Inverted_Doc);
    method(arg_self, arg_inverter, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_DataWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DataWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_DataWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_delete_segment);
XS_INTERNAL(XS_Lucy_Index_DataWriter_delete_segment) {
    dXSARGS;
    SV *sv;
    lucy_DataWriter* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_DataWriter_Delete_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Delete_Segment);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_merge_segment);
XS_INTERNAL(XS_Lucy_Index_DataWriter_merge_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DataWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_DataWriter_Merge_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Merge_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_finish);
XS_INTERNAL(XS_Lucy_Index_DataWriter_finish) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_metadata);
XS_INTERNAL(XS_Lucy_Index_DataWriter_metadata) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Metadata_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Metadata);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_format);
XS_INTERNAL(XS_Lucy_Index_DataWriter_format) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_get_snapshot);
XS_INTERNAL(XS_Lucy_Index_DataWriter_get_snapshot) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Get_Snapshot_t method;
    lucy_Snapshot* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Get_Snapshot);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_get_segment);
XS_INTERNAL(XS_Lucy_Index_DataWriter_get_segment) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Get_Segment_t method;
    lucy_Segment* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Get_Segment);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_get_polyreader);
XS_INTERNAL(XS_Lucy_Index_DataWriter_get_polyreader) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Get_PolyReader_t method;
    lucy_PolyReader* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Get_PolyReader);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_get_schema);
XS_INTERNAL(XS_Lucy_Index_DataWriter_get_schema) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Get_Schema_t method;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Get_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_get_folder);
XS_INTERNAL(XS_Lucy_Index_DataWriter_get_folder) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Get_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Get_Folder);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DataWriter_DESTROY) {
    dXSARGS;
    lucy_DataWriter* arg_self;
    LUCY_DataWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAWRITER, LUCY_DataWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_new);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_LexiconWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_LexiconWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_LexiconWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LexWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_LexiconWriter_start_field);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_start_field) {
    dXSARGS;
    SV *sv;
    lucy_LexiconWriter* arg_self;
    int32_t arg_field_num;
    LUCY_LexWriter_Start_Field_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field_num");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Start_Field);
    method(arg_self, arg_field_num);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_finish_field);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_finish_field) {
    dXSARGS;
    SV *sv;
    lucy_LexiconWriter* arg_self;
    int32_t arg_field_num;
    LUCY_LexWriter_Finish_Field_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field_num");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Finish_Field);
    method(arg_self, arg_field_num);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_enter_temp_mode);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_enter_temp_mode) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("temp_outstream", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconWriter* arg_self;
    cfish_String* arg_field;
    lucy_OutStream* arg_temp_outstream;
    LUCY_LexWriter_Enter_Temp_Mode_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_temp_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "temp_outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Enter_Temp_Mode);
    method(arg_self, arg_field, arg_temp_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_leave_temp_mode);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_leave_temp_mode) {
    dXSARGS;
    lucy_LexiconWriter* arg_self;
    LUCY_LexWriter_Leave_Temp_Mode_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Leave_Temp_Mode);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_add_term);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_add_term) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("term_text", 1),
        XSBIND_PARAM("tinfo", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconWriter* arg_self;
    cfish_Obj* arg_term_text;
    lucy_TermInfo* arg_tinfo;
    LUCY_LexWriter_Add_Term_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);
    sv = ST(locations[0]);
    arg_term_text = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term_text", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Add_Term);
    method(arg_self, arg_term_text, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_LexWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_metadata);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_metadata) {
    dXSARGS;
    lucy_LexiconWriter* arg_self;
    LUCY_LexWriter_Metadata_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Metadata);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_format);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_format) {
    dXSARGS;
    lucy_LexiconWriter* arg_self;
    LUCY_LexWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_finish);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_finish) {
    dXSARGS;
    lucy_LexiconWriter* arg_self;
    LUCY_LexWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_LexiconWriter_DESTROY) {
    dXSARGS;
    lucy_LexiconWriter* arg_self;
    LUCY_LexWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexiconWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONWRITER, LUCY_LexWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_HighlightWriter_new);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_HighlightWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_HighlightWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_HighlightWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_HLWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_HighlightWriter_tv_buf);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_tv_buf) {
    dXSARGS;
    SV *sv;
    lucy_HighlightWriter* arg_self;
    lucy_Inversion* arg_inversion;
    LUCY_HLWriter_TV_Buf_t method;
    cfish_Blob* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, inversion");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HighlightWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTWRITER, NULL);
    sv = ST(1);
    arg_inversion = (lucy_Inversion*)XSBind_arg_to_cfish(aTHX_ sv, "inversion", LUCY_INVERSION, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTWRITER, LUCY_HLWriter_TV_Buf);
    retval = method(arg_self, arg_inversion);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_HighlightWriter_add_inverted_doc);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_add_inverted_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("inverter", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_HighlightWriter* arg_self;
    lucy_Inverter* arg_inverter;
    int32_t arg_doc_id;
    LUCY_HLWriter_Add_Inverted_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_HighlightWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTWRITER, NULL);
    sv = ST(locations[0]);
    arg_inverter = (lucy_Inverter*)XSBind_arg_to_cfish(aTHX_ sv, "inverter", LUCY_INVERTER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTWRITER, LUCY_HLWriter_Add_Inverted_Doc);
    method(arg_self, arg_inverter, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_HighlightWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_HighlightWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_HLWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_HighlightWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTWRITER, LUCY_HLWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_HighlightWriter_finish);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_finish) {
    dXSARGS;
    lucy_HighlightWriter* arg_self;
    LUCY_HLWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HighlightWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTWRITER, LUCY_HLWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_HighlightWriter_format);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_format) {
    dXSARGS;
    lucy_HighlightWriter* arg_self;
    LUCY_HLWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HighlightWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTWRITER, LUCY_HLWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_HighlightWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_HighlightWriter_DESTROY) {
    dXSARGS;
    lucy_HighlightWriter* arg_self;
    LUCY_HLWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HighlightWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTWRITER, LUCY_HLWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortWriter_new);
XS_INTERNAL(XS_Lucy_Index_SortWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_SortWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_SortWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_SortWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortWriter_add_inverted_doc);
XS_INTERNAL(XS_Lucy_Index_SortWriter_add_inverted_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("inverter", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SortWriter* arg_self;
    lucy_Inverter* arg_inverter;
    int32_t arg_doc_id;
    LUCY_SortWriter_Add_Inverted_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SortWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTWRITER, NULL);
    sv = ST(locations[0]);
    arg_inverter = (lucy_Inverter*)XSBind_arg_to_cfish(aTHX_ sv, "inverter", LUCY_INVERTER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTWRITER, LUCY_SortWriter_Add_Inverted_Doc);
    method(arg_self, arg_inverter, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_SortWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SortWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_SortWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SortWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTWRITER, LUCY_SortWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortWriter_metadata);
XS_INTERNAL(XS_Lucy_Index_SortWriter_metadata) {
    dXSARGS;
    lucy_SortWriter* arg_self;
    LUCY_SortWriter_Metadata_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTWRITER, LUCY_SortWriter_Metadata);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortWriter_format);
XS_INTERNAL(XS_Lucy_Index_SortWriter_format) {
    dXSARGS;
    lucy_SortWriter* arg_self;
    LUCY_SortWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTWRITER, LUCY_SortWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortWriter_finish);
XS_INTERNAL(XS_Lucy_Index_SortWriter_finish) {
    dXSARGS;
    lucy_SortWriter* arg_self;
    LUCY_SortWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTWRITER, LUCY_SortWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SortWriter_DESTROY) {
    dXSARGS;
    lucy_SortWriter* arg_self;
    LUCY_SortWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTWRITER, LUCY_SortWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_new);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_DeletionsWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_DeletionsWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DelWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_delete_by_term);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_delete_by_term) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_DelWriter_Delete_By_Term_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Delete_By_Term);
    method(arg_self, arg_field, arg_term);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_delete_by_query);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_delete_by_query) {
    dXSARGS;
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    lucy_Query* arg_query;
    LUCY_DelWriter_Delete_By_Query_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);
    sv = ST(1);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Delete_By_Query);
    method(arg_self, arg_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_delete_by_doc_id);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_delete_by_doc_id) {
    dXSARGS;
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    int32_t arg_doc_id;
    LUCY_DelWriter_Delete_By_Doc_ID_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Delete_By_Doc_ID);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_updated);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_updated) {
    dXSARGS;
    lucy_DeletionsWriter* arg_self;
    LUCY_DelWriter_Updated_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Updated);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_generate_doc_map);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_generate_doc_map) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("deletions", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("offset", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    lucy_Matcher* arg_deletions;
    int32_t arg_doc_max;
    int32_t arg_offset;
    LUCY_DelWriter_Generate_Doc_Map_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);
    sv = ST(locations[0]);
    arg_deletions = (lucy_Matcher*)XSBind_arg_to_cfish(aTHX_ sv, "deletions", LUCY_MATCHER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Generate_Doc_Map);
    retval = method(arg_self, arg_deletions, arg_doc_max, arg_offset);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_seg_deletions);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_seg_deletions) {
    dXSARGS;
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    lucy_SegReader* arg_seg_reader;
    LUCY_DelWriter_Seg_Deletions_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, seg_reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);
    sv = ST(1);
    arg_seg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "seg_reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Seg_Deletions);
    retval = method(arg_self, arg_seg_reader);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_seg_del_count);
XS_INTERNAL(XS_Lucy_Index_DeletionsWriter_seg_del_count) {
    dXSARGS;
    SV *sv;
    lucy_DeletionsWriter* arg_self;
    cfish_String* arg_seg_name;
    LUCY_DelWriter_Seg_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, seg_name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSWRITER, NULL);
    sv = ST(1);
    arg_seg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "seg_name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSWRITER, LUCY_DelWriter_Seg_Del_Count);
    retval = method(arg_self, arg_seg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_new);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_DefaultDeletionsWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefDelWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_delete_by_term);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_delete_by_term) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_DefDelWriter_Delete_By_Term_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Delete_By_Term);
    method(arg_self, arg_field, arg_term);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_delete_by_query);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_delete_by_query) {
    dXSARGS;
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    lucy_Query* arg_query;
    LUCY_DefDelWriter_Delete_By_Query_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(1);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Delete_By_Query);
    method(arg_self, arg_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_delete_by_doc_id);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_delete_by_doc_id) {
    dXSARGS;
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    int32_t arg_doc_id;
    LUCY_DefDelWriter_Delete_By_Doc_ID_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Delete_By_Doc_ID);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_updated);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_updated) {
    dXSARGS;
    lucy_DefaultDeletionsWriter* arg_self;
    LUCY_DefDelWriter_Updated_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Updated);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_seg_deletions);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_seg_deletions) {
    dXSARGS;
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    lucy_SegReader* arg_seg_reader;
    LUCY_DefDelWriter_Seg_Deletions_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, seg_reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(1);
    arg_seg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "seg_reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Seg_Deletions);
    retval = method(arg_self, arg_seg_reader);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_seg_del_count);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_seg_del_count) {
    dXSARGS;
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    cfish_String* arg_seg_name;
    LUCY_DefDelWriter_Seg_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, seg_name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(1);
    arg_seg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "seg_name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Seg_Del_Count);
    retval = method(arg_self, arg_seg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_DefDelWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_merge_segment);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_merge_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultDeletionsWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_DefDelWriter_Merge_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Merge_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_finish);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_finish) {
    dXSARGS;
    lucy_DefaultDeletionsWriter* arg_self;
    LUCY_DefDelWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_format);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_format) {
    dXSARGS;
    lucy_DefaultDeletionsWriter* arg_self;
    LUCY_DefDelWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_metadata);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_metadata) {
    dXSARGS;
    lucy_DefaultDeletionsWriter* arg_self;
    LUCY_DefDelWriter_Metadata_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Metadata);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsWriter_DESTROY) {
    dXSARGS;
    lucy_DefaultDeletionsWriter* arg_self;
    LUCY_DefDelWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSWRITER, LUCY_DefDelWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocWriter_new);
XS_INTERNAL(XS_Lucy_Index_DocWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_DocWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_DocWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_DocWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DocWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DocWriter_add_inverted_doc);
XS_INTERNAL(XS_Lucy_Index_DocWriter_add_inverted_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("inverter", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DocWriter* arg_self;
    lucy_Inverter* arg_inverter;
    int32_t arg_doc_id;
    LUCY_DocWriter_Add_Inverted_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DocWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCWRITER, NULL);
    sv = ST(locations[0]);
    arg_inverter = (lucy_Inverter*)XSBind_arg_to_cfish(aTHX_ sv, "inverter", LUCY_INVERTER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCWRITER, LUCY_DocWriter_Add_Inverted_Doc);
    method(arg_self, arg_inverter, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_DocWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DocWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_DocWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DocWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCWRITER, LUCY_DocWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocWriter_finish);
XS_INTERNAL(XS_Lucy_Index_DocWriter_finish) {
    dXSARGS;
    lucy_DocWriter* arg_self;
    LUCY_DocWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCWRITER, LUCY_DocWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocWriter_format);
XS_INTERNAL(XS_Lucy_Index_DocWriter_format) {
    dXSARGS;
    lucy_DocWriter* arg_self;
    LUCY_DocWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCWRITER, LUCY_DocWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DocWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DocWriter_DESTROY) {
    dXSARGS;
    lucy_DocWriter* arg_self;
    LUCY_DocWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCWRITER, LUCY_DocWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_new);
XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("field_num", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_PostingWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    int32_t arg_field_num;
    lucy_PostingWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);
    arg_self = (lucy_PostingWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PostWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_field_num);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_write_posting);
XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_write_posting) {
    dXSARGS;
    SV *sv;
    lucy_PostingWriter* arg_self;
    lucy_RawPosting* arg_posting;
    LUCY_PostWriter_Write_Posting_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, posting");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGWRITER, NULL);
    sv = ST(1);
    arg_posting = (lucy_RawPosting*)XSBind_arg_to_cfish(aTHX_ sv, "posting", LUCY_RAWPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGWRITER, LUCY_PostWriter_Write_Posting);
    method(arg_self, arg_posting);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_start_term);
XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_start_term) {
    dXSARGS;
    SV *sv;
    lucy_PostingWriter* arg_self;
    lucy_TermInfo* arg_tinfo;
    LUCY_PostWriter_Start_Term_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tinfo");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGWRITER, NULL);
    sv = ST(1);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGWRITER, LUCY_PostWriter_Start_Term);
    method(arg_self, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_update_skip_info);
XS_INTERNAL(XS_Lucy_Index_Posting_PostingWriter_update_skip_info) {
    dXSARGS;
    SV *sv;
    lucy_PostingWriter* arg_self;
    lucy_TermInfo* arg_tinfo;
    LUCY_PostWriter_Update_Skip_Info_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tinfo");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGWRITER, NULL);
    sv = ST(1);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGWRITER, LUCY_PostWriter_Update_Skip_Info);
    method(arg_self, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_new);
XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("outstream", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_RawPostingWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_OutStream* arg_outstream;
    lucy_RawPostingWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);
    arg_self = (lucy_RawPostingWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RawPostWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_outstream);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_DESTROY) {
    dXSARGS;
    lucy_RawPostingWriter* arg_self;
    LUCY_RawPostWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGWRITER, LUCY_RawPostWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_start_term);
XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_start_term) {
    dXSARGS;
    SV *sv;
    lucy_RawPostingWriter* arg_self;
    lucy_TermInfo* arg_tinfo;
    LUCY_RawPostWriter_Start_Term_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tinfo");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGWRITER, NULL);
    sv = ST(1);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGWRITER, LUCY_RawPostWriter_Start_Term);
    method(arg_self, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_update_skip_info);
XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_update_skip_info) {
    dXSARGS;
    SV *sv;
    lucy_RawPostingWriter* arg_self;
    lucy_TermInfo* arg_tinfo;
    LUCY_RawPostWriter_Update_Skip_Info_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tinfo");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGWRITER, NULL);
    sv = ST(1);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGWRITER, LUCY_RawPostWriter_Update_Skip_Info);
    method(arg_self, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_write_posting);
XS_INTERNAL(XS_Lucy_Index_Posting_RawPostingWriter_write_posting) {
    dXSARGS;
    SV *sv;
    lucy_RawPostingWriter* arg_self;
    lucy_RawPosting* arg_posting;
    LUCY_RawPostWriter_Write_Posting_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, posting");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWPOSTINGWRITER, NULL);
    sv = ST(1);
    arg_posting = (lucy_RawPosting*)XSBind_arg_to_cfish(aTHX_ sv, "posting", LUCY_RAWPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWPOSTINGWRITER, LUCY_RawPostWriter_Write_Posting);
    method(arg_self, arg_posting);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_new);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("field_num", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_MatchPostingWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    int32_t arg_field_num;
    lucy_MatchPostingWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);
    arg_self = (lucy_MatchPostingWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_MatchPostWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_field_num);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_DESTROY) {
    dXSARGS;
    lucy_MatchPostingWriter* arg_self;
    LUCY_MatchPostWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTINGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTINGWRITER, LUCY_MatchPostWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_write_posting);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_write_posting) {
    dXSARGS;
    SV *sv;
    lucy_MatchPostingWriter* arg_self;
    lucy_RawPosting* arg_posting;
    LUCY_MatchPostWriter_Write_Posting_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, posting");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTINGWRITER, NULL);
    sv = ST(1);
    arg_posting = (lucy_RawPosting*)XSBind_arg_to_cfish(aTHX_ sv, "posting", LUCY_RAWPOSTING, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTINGWRITER, LUCY_MatchPostWriter_Write_Posting);
    method(arg_self, arg_posting);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_start_term);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_start_term) {
    dXSARGS;
    SV *sv;
    lucy_MatchPostingWriter* arg_self;
    lucy_TermInfo* arg_tinfo;
    LUCY_MatchPostWriter_Start_Term_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tinfo");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTINGWRITER, NULL);
    sv = ST(1);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTINGWRITER, LUCY_MatchPostWriter_Start_Term);
    method(arg_self, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_update_skip_info);
XS_INTERNAL(XS_Lucy_Index_Posting_MatchPostingWriter_update_skip_info) {
    dXSARGS;
    SV *sv;
    lucy_MatchPostingWriter* arg_self;
    lucy_TermInfo* arg_tinfo;
    LUCY_MatchPostWriter_Update_Skip_Info_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, tinfo");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_MatchPostingWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_MATCHPOSTINGWRITER, NULL);
    sv = ST(1);
    arg_tinfo = (lucy_TermInfo*)XSBind_arg_to_cfish(aTHX_ sv, "tinfo", LUCY_TERMINFO, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_MATCHPOSTINGWRITER, LUCY_MatchPostWriter_Update_Skip_Info);
    method(arg_self, arg_tinfo);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_new);
XS_INTERNAL(XS_Lucy_Index_SegWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_SegWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    arg_self = (lucy_SegWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SegWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SegWriter_register);
XS_INTERNAL(XS_Lucy_Index_SegWriter_register) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("api", 1),
        XSBIND_PARAM("component", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegWriter* arg_self;
    cfish_String* arg_api;
    lucy_DataWriter* arg_component;
    LUCY_SegWriter_Register_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(locations[0]);
    arg_api = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "api", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_component = (lucy_DataWriter*)XSBind_arg_to_cfish(aTHX_ sv, "component", LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Register);
    arg_component = (lucy_DataWriter*)CFISH_INCREF(arg_component);
    method(arg_self, arg_api, arg_component);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_fetch);
XS_INTERNAL(XS_Lucy_Index_SegWriter_fetch) {
    dXSARGS;
    SV *sv;
    lucy_SegWriter* arg_self;
    cfish_String* arg_api;
    LUCY_SegWriter_Fetch_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, api");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(1);
    arg_api = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "api", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Fetch);
    retval = method(arg_self, arg_api);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_add_writer);
XS_INTERNAL(XS_Lucy_Index_SegWriter_add_writer) {
    dXSARGS;
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_DataWriter* arg_writer;
    LUCY_SegWriter_Add_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, writer");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(1);
    arg_writer = (lucy_DataWriter*)XSBind_arg_to_cfish(aTHX_ sv, "writer", LUCY_DATAWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Add_Writer);
    arg_writer = (lucy_DataWriter*)CFISH_INCREF(arg_writer);
    method(arg_self, arg_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_prep_seg_dir);
XS_INTERNAL(XS_Lucy_Index_SegWriter_prep_seg_dir) {
    dXSARGS;
    lucy_SegWriter* arg_self;
    LUCY_SegWriter_Prep_Seg_Dir_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Prep_Seg_Dir);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_add_doc);
XS_INTERNAL(XS_Lucy_Index_SegWriter_add_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("doc", 1),
        XSBIND_PARAM("boost", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_Doc* arg_doc;
    float arg_boost;
    LUCY_SegWriter_Add_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(locations[0]);
    arg_doc = (lucy_Doc*)XSBind_arg_to_cfish(aTHX_ sv, "doc", LUCY_DOC, NULL);
    sv = ST(locations[1]);
    arg_boost = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (float)SvNV(sv) : 1.0;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Add_Doc);
    method(arg_self, arg_doc, arg_boost);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_set_del_writer);
XS_INTERNAL(XS_Lucy_Index_SegWriter_set_del_writer) {
    dXSARGS;
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_DeletionsWriter* arg_del_writer;
    LUCY_SegWriter_Set_Del_Writer_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [del_writer]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(1);
    arg_del_writer = 1 < items ? (lucy_DeletionsWriter*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "del_writer", LUCY_DELETIONSWRITER, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Set_Del_Writer);
    method(arg_self, arg_del_writer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_get_del_writer);
XS_INTERNAL(XS_Lucy_Index_SegWriter_get_del_writer) {
    dXSARGS;
    lucy_SegWriter* arg_self;
    LUCY_SegWriter_Get_Del_Writer_t method;
    lucy_DeletionsWriter* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Get_Del_Writer);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_add_inverted_doc);
XS_INTERNAL(XS_Lucy_Index_SegWriter_add_inverted_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("inverter", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_Inverter* arg_inverter;
    int32_t arg_doc_id;
    LUCY_SegWriter_Add_Inverted_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(locations[0]);
    arg_inverter = (lucy_Inverter*)XSBind_arg_to_cfish(aTHX_ sv, "inverter", LUCY_INVERTER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Add_Inverted_Doc);
    method(arg_self, arg_inverter, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_SegWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_SegWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_merge_segment);
XS_INTERNAL(XS_Lucy_Index_SegWriter_merge_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_SegWriter_Merge_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Merge_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_delete_segment);
XS_INTERNAL(XS_Lucy_Index_SegWriter_delete_segment) {
    dXSARGS;
    SV *sv;
    lucy_SegWriter* arg_self;
    lucy_SegReader* arg_reader;
    LUCY_SegWriter_Delete_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, reader");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);
    sv = ST(1);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Delete_Segment);
    method(arg_self, arg_reader);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_finish);
XS_INTERNAL(XS_Lucy_Index_SegWriter_finish) {
    dXSARGS;
    lucy_SegWriter* arg_self;
    LUCY_SegWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SegWriter_DESTROY) {
    dXSARGS;
    lucy_SegWriter* arg_self;
    LUCY_SegWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGWRITER, LUCY_SegWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingListWriter_new);
XS_INTERNAL(XS_Lucy_Index_PostingListWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("polyreader", 1),
        XSBIND_PARAM("lex_writer", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_PostingListWriter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Snapshot* arg_snapshot;
    lucy_Segment* arg_segment;
    lucy_PolyReader* arg_polyreader;
    lucy_LexiconWriter* arg_lex_writer;
    lucy_PostingListWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_polyreader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "polyreader", LUCY_POLYREADER, NULL);
    sv = ST(locations[4]);
    arg_lex_writer = (lucy_LexiconWriter*)XSBind_arg_to_cfish(aTHX_ sv, "lex_writer", LUCY_LEXICONWRITER, NULL);
    arg_self = (lucy_PostingListWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PListWriter_init(arg_self, arg_schema, arg_snapshot, arg_segment, arg_polyreader, arg_lex_writer);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PostingListWriter_add_inverted_doc);
XS_INTERNAL(XS_Lucy_Index_PostingListWriter_add_inverted_doc) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("inverter", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PostingListWriter* arg_self;
    lucy_Inverter* arg_inverter;
    int32_t arg_doc_id;
    LUCY_PListWriter_Add_Inverted_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PostingListWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTWRITER, NULL);
    sv = ST(locations[0]);
    arg_inverter = (lucy_Inverter*)XSBind_arg_to_cfish(aTHX_ sv, "inverter", LUCY_INVERTER, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTWRITER, LUCY_PListWriter_Add_Inverted_Doc);
    method(arg_self, arg_inverter, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingListWriter_add_segment);
XS_INTERNAL(XS_Lucy_Index_PostingListWriter_add_segment) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("doc_map", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PostingListWriter* arg_self;
    lucy_SegReader* arg_reader;
    lucy_I32Array* arg_doc_map;
    LUCY_PListWriter_Add_Segment_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PostingListWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTWRITER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_SegReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_SEGREADER, NULL);
    sv = ST(locations[1]);
    arg_doc_map = locations[1] < items ? (lucy_I32Array*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "doc_map", LUCY_I32ARRAY, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTWRITER, LUCY_PListWriter_Add_Segment);
    method(arg_self, arg_reader, arg_doc_map);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingListWriter_finish);
XS_INTERNAL(XS_Lucy_Index_PostingListWriter_finish) {
    dXSARGS;
    lucy_PostingListWriter* arg_self;
    LUCY_PListWriter_Finish_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingListWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTWRITER, LUCY_PListWriter_Finish);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingListWriter_format);
XS_INTERNAL(XS_Lucy_Index_PostingListWriter_format) {
    dXSARGS;
    lucy_PostingListWriter* arg_self;
    LUCY_PListWriter_Format_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingListWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTWRITER, LUCY_PListWriter_Format);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingListWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PostingListWriter_DESTROY) {
    dXSARGS;
    lucy_PostingListWriter* arg_self;
    LUCY_PListWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingListWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTWRITER, LUCY_PListWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_new);
XS_INTERNAL(XS_Lucy_Index_Snapshot_new) {
    dXSARGS;
    lucy_Snapshot* arg_self;
    lucy_Snapshot* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Snapshot*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Snapshot_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Snapshot_list);
XS_INTERNAL(XS_Lucy_Index_Snapshot_list) {
    dXSARGS;
    lucy_Snapshot* arg_self;
    LUCY_Snapshot_List_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_List);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_num_entries);
XS_INTERNAL(XS_Lucy_Index_Snapshot_num_entries) {
    dXSARGS;
    lucy_Snapshot* arg_self;
    LUCY_Snapshot_Num_Entries_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Num_Entries);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_add_entry);
XS_INTERNAL(XS_Lucy_Index_Snapshot_add_entry) {
    dXSARGS;
    SV *sv;
    lucy_Snapshot* arg_self;
    cfish_String* arg_entry;
    LUCY_Snapshot_Add_Entry_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, entry");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);
    sv = ST(1);
    arg_entry = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "entry", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Add_Entry);
    method(arg_self, arg_entry);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_delete_entry);
XS_INTERNAL(XS_Lucy_Index_Snapshot_delete_entry) {
    dXSARGS;
    SV *sv;
    lucy_Snapshot* arg_self;
    cfish_String* arg_entry;
    LUCY_Snapshot_Delete_Entry_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, entry");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);
    sv = ST(1);
    arg_entry = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "entry", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Delete_Entry);
    retval = method(arg_self, arg_entry);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_read_file);
XS_INTERNAL(XS_Lucy_Index_Snapshot_read_file) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("path", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Snapshot* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_path;
    LUCY_Snapshot_Read_File_t method;
    lucy_Snapshot* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_path = locations[1] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Read_File);
    retval = method(arg_self, arg_folder, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_write_file);
XS_INTERNAL(XS_Lucy_Index_Snapshot_write_file) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("path", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Snapshot* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_path;
    LUCY_Snapshot_Write_File_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_path = locations[1] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Write_File);
    method(arg_self, arg_folder, arg_path);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_set_path);
XS_INTERNAL(XS_Lucy_Index_Snapshot_set_path) {
    dXSARGS;
    SV *sv;
    lucy_Snapshot* arg_self;
    cfish_String* arg_path;
    LUCY_Snapshot_Set_Path_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Set_Path);
    method(arg_self, arg_path);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_get_path);
XS_INTERNAL(XS_Lucy_Index_Snapshot_get_path) {
    dXSARGS;
    lucy_Snapshot* arg_self;
    LUCY_Snapshot_Get_Path_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Get_Path);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Snapshot_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Snapshot_DESTROY) {
    dXSARGS;
    lucy_Snapshot* arg_self;
    LUCY_Snapshot_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Snapshot*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SNAPSHOT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SNAPSHOT, LUCY_Snapshot_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_get_cardinality);
XS_INTERNAL(XS_Lucy_Index_SortCache_get_cardinality) {
    dXSARGS;
    lucy_SortCache* arg_self;
    LUCY_SortCache_Get_Cardinality_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Get_Cardinality);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_get_ord_width);
XS_INTERNAL(XS_Lucy_Index_SortCache_get_ord_width) {
    dXSARGS;
    lucy_SortCache* arg_self;
    LUCY_SortCache_Get_Ord_Width_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Get_Ord_Width);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_get_null_ord);
XS_INTERNAL(XS_Lucy_Index_SortCache_get_null_ord) {
    dXSARGS;
    lucy_SortCache* arg_self;
    LUCY_SortCache_Get_Null_Ord_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Get_Null_Ord);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_ordinal);
XS_INTERNAL(XS_Lucy_Index_SortCache_ordinal) {
    dXSARGS;
    SV *sv;
    lucy_SortCache* arg_self;
    int32_t arg_doc_id;
    LUCY_SortCache_Ordinal_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Ordinal);
    retval = method(arg_self, arg_doc_id);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_find);
XS_INTERNAL(XS_Lucy_Index_SortCache_find) {
    dXSARGS;
    SV *sv;
    lucy_SortCache* arg_self;
    cfish_Obj* arg_term;
    LUCY_SortCache_Find_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [term]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);
    sv = ST(1);
    arg_term = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Find);
    retval = method(arg_self, arg_term);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_set_native_ords);
XS_INTERNAL(XS_Lucy_Index_SortCache_set_native_ords) {
    dXSARGS;
    SV *sv;
    lucy_SortCache* arg_self;
    bool arg_native_ords;
    LUCY_SortCache_Set_Native_Ords_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, native_ords");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "native_ords");
    }
    arg_native_ords = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Set_Native_Ords);
    method(arg_self, arg_native_ords);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_get_native_ords);
XS_INTERNAL(XS_Lucy_Index_SortCache_get_native_ords) {
    dXSARGS;
    lucy_SortCache* arg_self;
    LUCY_SortCache_Get_Native_Ords_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Get_Native_Ords);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SortCache_DESTROY) {
    dXSARGS;
    lucy_SortCache* arg_self;
    LUCY_SortCache_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTCACHE, LUCY_SortCache_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_TextSortCache_new);
XS_INTERNAL(XS_Lucy_Index_SortCache_TextSortCache_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[9] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("cardinality", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("null_ord", 0),
        XSBIND_PARAM("ord_width", 1),
        XSBIND_PARAM("ord_in", 1),
        XSBIND_PARAM("ix_in", 1),
        XSBIND_PARAM("dat_in", 1)
    };
    int32_t locations[9];
    SV *sv;
    lucy_TextSortCache* arg_self;
    cfish_String* arg_field;
    lucy_FieldType* arg_type;
    int32_t arg_cardinality;
    int32_t arg_doc_max;
    int32_t arg_null_ord;
    int32_t arg_ord_width;
    lucy_InStream* arg_ord_in;
    lucy_InStream* arg_ix_in;
    lucy_InStream* arg_dat_in;
    lucy_TextSortCache* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 9);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cardinality");
    }
    arg_cardinality = (int32_t)SvIV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    arg_null_ord = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "ord_width");
    }
    arg_ord_width = (int32_t)SvIV(sv);
    sv = ST(locations[6]);
    arg_ord_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ord_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[7]);
    arg_ix_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ix_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[8]);
    arg_dat_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "dat_in", LUCY_INSTREAM, NULL);
    arg_self = (lucy_TextSortCache*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TextSortCache_init(arg_self, arg_field, arg_type, arg_cardinality, arg_doc_max, arg_null_ord, arg_ord_width, arg_ord_in, arg_ix_in, arg_dat_in);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortCache_TextSortCache_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SortCache_TextSortCache_DESTROY) {
    dXSARGS;
    lucy_TextSortCache* arg_self;
    LUCY_TextSortCache_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TextSortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TEXTSORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TEXTSORTCACHE, LUCY_TextSortCache_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_NumericSortCache_new);
XS_INTERNAL(XS_Lucy_Index_SortCache_NumericSortCache_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[8] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("cardinality", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("null_ord", 0),
        XSBIND_PARAM("ord_width", 1),
        XSBIND_PARAM("ord_in", 1),
        XSBIND_PARAM("dat_in", 1)
    };
    int32_t locations[8];
    SV *sv;
    lucy_NumericSortCache* arg_self;
    cfish_String* arg_field;
    lucy_FieldType* arg_type;
    int32_t arg_cardinality;
    int32_t arg_doc_max;
    int32_t arg_null_ord;
    int32_t arg_ord_width;
    lucy_InStream* arg_ord_in;
    lucy_InStream* arg_dat_in;
    lucy_NumericSortCache* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 8);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cardinality");
    }
    arg_cardinality = (int32_t)SvIV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    arg_null_ord = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "ord_width");
    }
    arg_ord_width = (int32_t)SvIV(sv);
    sv = ST(locations[6]);
    arg_ord_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ord_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[7]);
    arg_dat_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "dat_in", LUCY_INSTREAM, NULL);
    arg_self = (lucy_NumericSortCache*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_NumSortCache_init(arg_self, arg_field, arg_type, arg_cardinality, arg_doc_max, arg_null_ord, arg_ord_width, arg_ord_in, arg_dat_in);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortCache_NumericSortCache_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SortCache_NumericSortCache_DESTROY) {
    dXSARGS;
    lucy_NumericSortCache* arg_self;
    LUCY_NumSortCache_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_NumericSortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_NUMERICSORTCACHE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_NUMERICSORTCACHE, LUCY_NumSortCache_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortCache_Float64SortCache_new);
XS_INTERNAL(XS_Lucy_Index_SortCache_Float64SortCache_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[8] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("cardinality", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("null_ord", 0),
        XSBIND_PARAM("ord_width", 1),
        XSBIND_PARAM("ord_in", 1),
        XSBIND_PARAM("dat_in", 1)
    };
    int32_t locations[8];
    SV *sv;
    lucy_Float64SortCache* arg_self;
    cfish_String* arg_field;
    lucy_FieldType* arg_type;
    int32_t arg_cardinality;
    int32_t arg_doc_max;
    int32_t arg_null_ord;
    int32_t arg_ord_width;
    lucy_InStream* arg_ord_in;
    lucy_InStream* arg_dat_in;
    lucy_Float64SortCache* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 8);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cardinality");
    }
    arg_cardinality = (int32_t)SvIV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    arg_null_ord = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "ord_width");
    }
    arg_ord_width = (int32_t)SvIV(sv);
    sv = ST(locations[6]);
    arg_ord_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ord_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[7]);
    arg_dat_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "dat_in", LUCY_INSTREAM, NULL);
    arg_self = (lucy_Float64SortCache*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_F64SortCache_init(arg_self, arg_field, arg_type, arg_cardinality, arg_doc_max, arg_null_ord, arg_ord_width, arg_ord_in, arg_dat_in);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortCache_Float32SortCache_new);
XS_INTERNAL(XS_Lucy_Index_SortCache_Float32SortCache_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[8] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("cardinality", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("null_ord", 0),
        XSBIND_PARAM("ord_width", 1),
        XSBIND_PARAM("ord_in", 1),
        XSBIND_PARAM("dat_in", 1)
    };
    int32_t locations[8];
    SV *sv;
    lucy_Float32SortCache* arg_self;
    cfish_String* arg_field;
    lucy_FieldType* arg_type;
    int32_t arg_cardinality;
    int32_t arg_doc_max;
    int32_t arg_null_ord;
    int32_t arg_ord_width;
    lucy_InStream* arg_ord_in;
    lucy_InStream* arg_dat_in;
    lucy_Float32SortCache* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 8);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cardinality");
    }
    arg_cardinality = (int32_t)SvIV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    arg_null_ord = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "ord_width");
    }
    arg_ord_width = (int32_t)SvIV(sv);
    sv = ST(locations[6]);
    arg_ord_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ord_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[7]);
    arg_dat_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "dat_in", LUCY_INSTREAM, NULL);
    arg_self = (lucy_Float32SortCache*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_F32SortCache_init(arg_self, arg_field, arg_type, arg_cardinality, arg_doc_max, arg_null_ord, arg_ord_width, arg_ord_in, arg_dat_in);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortCache_Int32SortCache_new);
XS_INTERNAL(XS_Lucy_Index_SortCache_Int32SortCache_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[8] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("cardinality", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("null_ord", 0),
        XSBIND_PARAM("ord_width", 1),
        XSBIND_PARAM("ord_in", 1),
        XSBIND_PARAM("dat_in", 1)
    };
    int32_t locations[8];
    SV *sv;
    lucy_Int32SortCache* arg_self;
    cfish_String* arg_field;
    lucy_FieldType* arg_type;
    int32_t arg_cardinality;
    int32_t arg_doc_max;
    int32_t arg_null_ord;
    int32_t arg_ord_width;
    lucy_InStream* arg_ord_in;
    lucy_InStream* arg_dat_in;
    lucy_Int32SortCache* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 8);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cardinality");
    }
    arg_cardinality = (int32_t)SvIV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    arg_null_ord = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "ord_width");
    }
    arg_ord_width = (int32_t)SvIV(sv);
    sv = ST(locations[6]);
    arg_ord_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ord_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[7]);
    arg_dat_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "dat_in", LUCY_INSTREAM, NULL);
    arg_self = (lucy_Int32SortCache*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_I32SortCache_init(arg_self, arg_field, arg_type, arg_cardinality, arg_doc_max, arg_null_ord, arg_ord_width, arg_ord_in, arg_dat_in);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortCache_Int64SortCache_new);
XS_INTERNAL(XS_Lucy_Index_SortCache_Int64SortCache_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[8] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("type", 1),
        XSBIND_PARAM("cardinality", 1),
        XSBIND_PARAM("doc_max", 1),
        XSBIND_PARAM("null_ord", 0),
        XSBIND_PARAM("ord_width", 1),
        XSBIND_PARAM("ord_in", 1),
        XSBIND_PARAM("dat_in", 1)
    };
    int32_t locations[8];
    SV *sv;
    lucy_Int64SortCache* arg_self;
    cfish_String* arg_field;
    lucy_FieldType* arg_type;
    int32_t arg_cardinality;
    int32_t arg_doc_max;
    int32_t arg_null_ord;
    int32_t arg_ord_width;
    lucy_InStream* arg_ord_in;
    lucy_InStream* arg_dat_in;
    lucy_Int64SortCache* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 8);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_type = (lucy_FieldType*)XSBind_arg_to_cfish(aTHX_ sv, "type", LUCY_FIELDTYPE, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cardinality");
    }
    arg_cardinality = (int32_t)SvIV(sv);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_max");
    }
    arg_doc_max = (int32_t)SvIV(sv);
    sv = ST(locations[4]);
    arg_null_ord = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    sv = ST(locations[5]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "ord_width");
    }
    arg_ord_width = (int32_t)SvIV(sv);
    sv = ST(locations[6]);
    arg_ord_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "ord_in", LUCY_INSTREAM, NULL);
    sv = ST(locations[7]);
    arg_dat_in = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "dat_in", LUCY_INSTREAM, NULL);
    arg_self = (lucy_Int64SortCache*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_I64SortCache_init(arg_self, arg_field, arg_type, arg_cardinality, arg_doc_max, arg_null_ord, arg_ord_width, arg_ord_in, arg_dat_in);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DataReader_new);
XS_INTERNAL(XS_Lucy_Index_DataReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DataReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DataReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_DataReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DataReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DataReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_DataReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DataReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_DataReader_Aggregator_t method;
    lucy_DataReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_get_schema);
XS_INTERNAL(XS_Lucy_Index_DataReader_get_schema) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Get_Schema_t method;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Get_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_get_folder);
XS_INTERNAL(XS_Lucy_Index_DataReader_get_folder) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Get_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Get_Folder);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_get_snapshot);
XS_INTERNAL(XS_Lucy_Index_DataReader_get_snapshot) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Get_Snapshot_t method;
    lucy_Snapshot* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Get_Snapshot);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_get_segments);
XS_INTERNAL(XS_Lucy_Index_DataReader_get_segments) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Get_Segments_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Get_Segments);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_get_segment);
XS_INTERNAL(XS_Lucy_Index_DataReader_get_segment) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Get_Segment_t method;
    lucy_Segment* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Get_Segment);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_get_seg_tick);
XS_INTERNAL(XS_Lucy_Index_DataReader_get_seg_tick) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Get_Seg_Tick_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Get_Seg_Tick);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_close);
XS_INTERNAL(XS_Lucy_Index_DataReader_close) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DataReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DataReader_DESTROY) {
    dXSARGS;
    lucy_DataReader* arg_self;
    LUCY_DataReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DataReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DATAREADER, LUCY_DataReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexiconReader_new);
XS_INTERNAL(XS_Lucy_Index_LexiconReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_LexiconReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_LexiconReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_LexiconReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LexReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_LexiconReader_lexicon);
XS_INTERNAL(XS_Lucy_Index_LexiconReader_lexicon) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_LexReader_Lexicon_t method;
    lucy_Lexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = locations[1] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONREADER, LUCY_LexReader_Lexicon);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexiconReader_doc_freq);
XS_INTERNAL(XS_Lucy_Index_LexiconReader_doc_freq) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_LexReader_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONREADER, LUCY_LexReader_Doc_Freq);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexiconReader_fetch_term_info);
XS_INTERNAL(XS_Lucy_Index_LexiconReader_fetch_term_info) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_LexReader_Fetch_Term_Info_t method;
    lucy_TermInfo* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONREADER, LUCY_LexReader_Fetch_Term_Info);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexiconReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_LexiconReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LexiconReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_LexReader_Aggregator_t method;
    lucy_LexiconReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_LexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICONREADER, LUCY_LexReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_new);
XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyLexiconReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    lucy_PolyLexiconReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);
    arg_self = (lucy_PolyLexiconReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyLexReader_init(arg_self, arg_readers, arg_offsets);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_lexicon);
XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_lexicon) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyLexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_PolyLexReader_Lexicon_t method;
    lucy_Lexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PolyLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = locations[1] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICONREADER, LUCY_PolyLexReader_Lexicon);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_doc_freq);
XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_doc_freq) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyLexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_PolyLexReader_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PolyLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICONREADER, LUCY_PolyLexReader_Doc_Freq);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_close);
XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_close) {
    dXSARGS;
    lucy_PolyLexiconReader* arg_self;
    LUCY_PolyLexReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICONREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICONREADER, LUCY_PolyLexReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PolyLexiconReader_DESTROY) {
    dXSARGS;
    lucy_PolyLexiconReader* arg_self;
    LUCY_PolyLexReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICONREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICONREADER, LUCY_PolyLexReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_new);
XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DefaultLexiconReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DefaultLexiconReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    arg_self = (lucy_DefaultLexiconReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefLexReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_lexicon);
XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_lexicon) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultLexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_DefLexReader_Lexicon_t method;
    lucy_Lexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTLEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = locations[1] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTLEXICONREADER, LUCY_DefLexReader_Lexicon);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_doc_freq);
XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_doc_freq) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultLexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_DefLexReader_Doc_Freq_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTLEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTLEXICONREADER, LUCY_DefLexReader_Doc_Freq);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_fetch_term_info);
XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_fetch_term_info) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultLexiconReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_DefLexReader_Fetch_Term_Info_t method;
    lucy_TermInfo* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTLEXICONREADER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTLEXICONREADER, LUCY_DefLexReader_Fetch_Term_Info);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_close);
XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_close) {
    dXSARGS;
    lucy_DefaultLexiconReader* arg_self;
    LUCY_DefLexReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTLEXICONREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTLEXICONREADER, LUCY_DefLexReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultLexiconReader_DESTROY) {
    dXSARGS;
    lucy_DefaultLexiconReader* arg_self;
    LUCY_DefLexReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultLexiconReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTLEXICONREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTLEXICONREADER, LUCY_DefLexReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_HighlightReader_new);
XS_INTERNAL(XS_Lucy_Index_HighlightReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_HighlightReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_HighlightReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_HighlightReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_HLReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_HighlightReader_fetch_doc_vec);
XS_INTERNAL(XS_Lucy_Index_HighlightReader_fetch_doc_vec) {
    dXSARGS;
    SV *sv;
    lucy_HighlightReader* arg_self;
    int32_t arg_doc_id;
    LUCY_HLReader_Fetch_Doc_Vec_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_HighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTREADER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTREADER, LUCY_HLReader_Fetch_Doc_Vec);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_HighlightReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_HighlightReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_HighlightReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_HLReader_Aggregator_t method;
    lucy_HighlightReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_HighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_HIGHLIGHTREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_HIGHLIGHTREADER, LUCY_HLReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_new);
XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyHighlightReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    lucy_PolyHighlightReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);
    arg_self = (lucy_PolyHighlightReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyHLReader_init(arg_self, arg_readers, arg_offsets);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_fetch_doc_vec);
XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_fetch_doc_vec) {
    dXSARGS;
    SV *sv;
    lucy_PolyHighlightReader* arg_self;
    int32_t arg_doc_id;
    LUCY_PolyHLReader_Fetch_Doc_Vec_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYHIGHLIGHTREADER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYHIGHLIGHTREADER, LUCY_PolyHLReader_Fetch_Doc_Vec);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_close);
XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_close) {
    dXSARGS;
    lucy_PolyHighlightReader* arg_self;
    LUCY_PolyHLReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYHIGHLIGHTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYHIGHLIGHTREADER, LUCY_PolyHLReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PolyHighlightReader_DESTROY) {
    dXSARGS;
    lucy_PolyHighlightReader* arg_self;
    LUCY_PolyHLReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYHIGHLIGHTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYHIGHLIGHTREADER, LUCY_PolyHLReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_new);
XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DefaultHighlightReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DefaultHighlightReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    arg_self = (lucy_DefaultHighlightReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefHLReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_fetch_doc_vec);
XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_fetch_doc_vec) {
    dXSARGS;
    SV *sv;
    lucy_DefaultHighlightReader* arg_self;
    int32_t arg_doc_id;
    LUCY_DefHLReader_Fetch_Doc_Vec_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTHIGHLIGHTREADER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTHIGHLIGHTREADER, LUCY_DefHLReader_Fetch_Doc_Vec);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_read_record);
XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_read_record) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("doc_id", 1),
        XSBIND_PARAM("buffer", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultHighlightReader* arg_self;
    int32_t arg_doc_id;
    cfish_ByteBuf* arg_buffer;
    LUCY_DefHLReader_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTHIGHLIGHTREADER, NULL);
    sv = ST(locations[0]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);
    sv = ST(locations[1]);
    arg_buffer = (cfish_ByteBuf*)XSBind_arg_to_cfish(aTHX_ sv, "buffer", CFISH_BYTEBUF, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTHIGHLIGHTREADER, LUCY_DefHLReader_Read_Record);
    method(arg_self, arg_doc_id, arg_buffer);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_close);
XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_close) {
    dXSARGS;
    lucy_DefaultHighlightReader* arg_self;
    LUCY_DefHLReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTHIGHLIGHTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTHIGHLIGHTREADER, LUCY_DefHLReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultHighlightReader_DESTROY) {
    dXSARGS;
    lucy_DefaultHighlightReader* arg_self;
    LUCY_DefHLReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultHighlightReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTHIGHLIGHTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTHIGHLIGHTREADER, LUCY_DefHLReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PostingListReader_new);
XS_INTERNAL(XS_Lucy_Index_PostingListReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_PostingListReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_PostingListReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_PostingListReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PListReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PostingListReader_posting_list);
XS_INTERNAL(XS_Lucy_Index_PostingListReader_posting_list) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 0),
        XSBIND_PARAM("term", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PostingListReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_PListReader_Posting_List_t method;
    lucy_PostingList* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTREADER, NULL);
    sv = ST(locations[0]);
    arg_field = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_term = locations[1] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTREADER, LUCY_PListReader_Posting_List);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingListReader_get_lex_reader);
XS_INTERNAL(XS_Lucy_Index_PostingListReader_get_lex_reader) {
    dXSARGS;
    lucy_PostingListReader* arg_self;
    LUCY_PListReader_Get_Lex_Reader_t method;
    lucy_LexiconReader* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTREADER, LUCY_PListReader_Get_Lex_Reader);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PostingListReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_PostingListReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PostingListReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_PListReader_Aggregator_t method;
    lucy_PostingListReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_PostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POSTINGLISTREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POSTINGLISTREADER, LUCY_PListReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_new);
XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[6] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1),
        XSBIND_PARAM("lex_reader", 1)
    };
    int32_t locations[6];
    SV *sv;
    lucy_DefaultPostingListReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_LexiconReader* arg_lex_reader;
    lucy_DefaultPostingListReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 6);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    sv = ST(locations[5]);
    arg_lex_reader = (lucy_LexiconReader*)XSBind_arg_to_cfish(aTHX_ sv, "lex_reader", LUCY_LEXICONREADER, NULL);
    arg_self = (lucy_DefaultPostingListReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefPListReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick, arg_lex_reader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_posting_list);
XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_posting_list) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 0),
        XSBIND_PARAM("term", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultPostingListReader* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_DefPListReader_Posting_List_t method;
    lucy_SegPostingList* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultPostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTPOSTINGLISTREADER, NULL);
    sv = ST(locations[0]);
    arg_field = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_term = locations[1] < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTPOSTINGLISTREADER, LUCY_DefPListReader_Posting_List);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_get_lex_reader);
XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_get_lex_reader) {
    dXSARGS;
    lucy_DefaultPostingListReader* arg_self;
    LUCY_DefPListReader_Get_Lex_Reader_t method;
    lucy_LexiconReader* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultPostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTPOSTINGLISTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTPOSTINGLISTREADER, LUCY_DefPListReader_Get_Lex_Reader);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_close);
XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_close) {
    dXSARGS;
    lucy_DefaultPostingListReader* arg_self;
    LUCY_DefPListReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultPostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTPOSTINGLISTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTPOSTINGLISTREADER, LUCY_DefPListReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultPostingListReader_DESTROY) {
    dXSARGS;
    lucy_DefaultPostingListReader* arg_self;
    LUCY_DefPListReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultPostingListReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTPOSTINGLISTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTPOSTINGLISTREADER, LUCY_DefPListReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortReader_new);
XS_INTERNAL(XS_Lucy_Index_SortReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_SortReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_SortReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_SortReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SortReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SortReader_fetch_sort_cache);
XS_INTERNAL(XS_Lucy_Index_SortReader_fetch_sort_cache) {
    dXSARGS;
    SV *sv;
    lucy_SortReader* arg_self;
    cfish_String* arg_field;
    LUCY_SortReader_Fetch_Sort_Cache_t method;
    lucy_SortCache* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SortReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTREADER, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTREADER, LUCY_SortReader_Fetch_Sort_Cache);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SortReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_SortReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SortReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_SortReader_Aggregator_t method;
    lucy_DataReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SortReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SORTREADER, LUCY_SortReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_new);
XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DefaultSortReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DefaultSortReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    arg_self = (lucy_DefaultSortReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefSortReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_fetch_sort_cache);
XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_fetch_sort_cache) {
    dXSARGS;
    SV *sv;
    lucy_DefaultSortReader* arg_self;
    cfish_String* arg_field;
    LUCY_DefSortReader_Fetch_Sort_Cache_t method;
    lucy_SortCache* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultSortReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTSORTREADER, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTSORTREADER, LUCY_DefSortReader_Fetch_Sort_Cache);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_close);
XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_close) {
    dXSARGS;
    lucy_DefaultSortReader* arg_self;
    LUCY_DefSortReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultSortReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTSORTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTSORTREADER, LUCY_DefSortReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultSortReader_DESTROY) {
    dXSARGS;
    lucy_DefaultSortReader* arg_self;
    LUCY_DefSortReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultSortReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTSORTREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTSORTREADER, LUCY_DefSortReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_open);
XS_INTERNAL(XS_Lucy_Index_IndexReader_open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("index", 1),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("manager", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_IndexReader* arg_self;
    cfish_Obj* arg_index;
    lucy_Snapshot* arg_snapshot;
    lucy_IndexManager* arg_manager;
    lucy_IndexReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_index = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "index", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_snapshot = locations[1] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[2]);
    arg_manager = locations[2] < items ? (lucy_IndexManager*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "manager", LUCY_INDEXMANAGER, NULL) : NULL;
    arg_self = (lucy_IndexReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_IxReader_do_open(arg_self, arg_index, arg_snapshot, arg_manager);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_IndexReader_doc_max);
XS_INTERNAL(XS_Lucy_Index_IndexReader_doc_max) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Doc_Max_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Doc_Max);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_doc_count);
XS_INTERNAL(XS_Lucy_Index_IndexReader_doc_count) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Doc_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Doc_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_del_count);
XS_INTERNAL(XS_Lucy_Index_IndexReader_del_count) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Del_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader__offsets);
XS_INTERNAL(XS_Lucy_Index_IndexReader__offsets) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Offsets_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Offsets);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_seg_readers);
XS_INTERNAL(XS_Lucy_Index_IndexReader_seg_readers) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Seg_Readers_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Seg_Readers);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_obtain);
XS_INTERNAL(XS_Lucy_Index_IndexReader_obtain) {
    dXSARGS;
    SV *sv;
    lucy_IndexReader* arg_self;
    cfish_String* arg_api;
    LUCY_IxReader_Obtain_t method;
    lucy_DataReader* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, api");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);
    sv = ST(1);
    arg_api = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "api", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Obtain);
    retval = method(arg_self, arg_api);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_fetch);
XS_INTERNAL(XS_Lucy_Index_IndexReader_fetch) {
    dXSARGS;
    SV *sv;
    lucy_IndexReader* arg_self;
    cfish_String* arg_api;
    LUCY_IxReader_Fetch_t method;
    lucy_DataReader* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, api");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);
    sv = ST(1);
    arg_api = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "api", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Fetch);
    retval = method(arg_self, arg_api);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_close);
XS_INTERNAL(XS_Lucy_Index_IndexReader_close) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_get_components);
XS_INTERNAL(XS_Lucy_Index_IndexReader_get_components) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Get_Components_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Get_Components);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_IndexReader_DESTROY) {
    dXSARGS;
    lucy_IndexReader* arg_self;
    LUCY_IxReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXREADER, LUCY_IxReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_open);
XS_INTERNAL(XS_Lucy_Index_PolyReader_open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("index", 1),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("manager", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_PolyReader* arg_self;
    cfish_Obj* arg_index;
    lucy_Snapshot* arg_snapshot;
    lucy_IndexManager* arg_manager;
    lucy_PolyReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_index = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "index", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_snapshot = locations[1] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[2]);
    arg_manager = locations[2] < items ? (lucy_IndexManager*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "manager", LUCY_INDEXMANAGER, NULL) : NULL;
    arg_self = (lucy_PolyReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyReader_do_open(arg_self, arg_index, arg_snapshot, arg_manager);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyReader_new);
XS_INTERNAL(XS_Lucy_Index_PolyReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("manager", 0),
        XSBIND_PARAM("sub_readers", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_PolyReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    lucy_IndexManager* arg_manager;
    cfish_Vector* arg_sub_readers;
    lucy_PolyReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_manager = locations[3] < items ? (lucy_IndexManager*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "manager", LUCY_INDEXMANAGER, NULL) : NULL;
    sv = ST(locations[4]);
    arg_sub_readers = locations[4] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "sub_readers", CFISH_VECTOR, NULL) : NULL;
    arg_self = (lucy_PolyReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_manager, arg_sub_readers);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyReader_doc_max);
XS_INTERNAL(XS_Lucy_Index_PolyReader_doc_max) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Doc_Max_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Doc_Max);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_doc_count);
XS_INTERNAL(XS_Lucy_Index_PolyReader_doc_count) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Doc_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Doc_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_del_count);
XS_INTERNAL(XS_Lucy_Index_PolyReader_del_count) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Del_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader__offsets);
XS_INTERNAL(XS_Lucy_Index_PolyReader__offsets) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Offsets_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Offsets);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_seg_readers);
XS_INTERNAL(XS_Lucy_Index_PolyReader_seg_readers) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Seg_Readers_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Seg_Readers);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_get_seg_readers);
XS_INTERNAL(XS_Lucy_Index_PolyReader_get_seg_readers) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Get_Seg_Readers_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Get_Seg_Readers);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_close);
XS_INTERNAL(XS_Lucy_Index_PolyReader_close) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PolyReader_DESTROY) {
    dXSARGS;
    lucy_PolyReader* arg_self;
    LUCY_PolyReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYREADER, LUCY_PolyReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_new);
XS_INTERNAL(XS_Lucy_Index_SegReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_SegReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_SegReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    arg_self = (lucy_SegReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SegReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SegReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SegReader_DESTROY) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_register);
XS_INTERNAL(XS_Lucy_Index_SegReader_register) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("api", 1),
        XSBIND_PARAM("component", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_SegReader* arg_self;
    cfish_String* arg_api;
    lucy_DataReader* arg_component;
    LUCY_SegReader_Register_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);
    sv = ST(locations[0]);
    arg_api = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "api", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_component = (lucy_DataReader*)XSBind_arg_to_cfish(aTHX_ sv, "component", LUCY_DATAREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Register);
    arg_component = (lucy_DataReader*)CFISH_INCREF(arg_component);
    method(arg_self, arg_api, arg_component);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_get_seg_name);
XS_INTERNAL(XS_Lucy_Index_SegReader_get_seg_name) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Get_Seg_Name_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Get_Seg_Name);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_get_seg_num);
XS_INTERNAL(XS_Lucy_Index_SegReader_get_seg_num) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Get_Seg_Num_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Get_Seg_Num);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_del_count);
XS_INTERNAL(XS_Lucy_Index_SegReader_del_count) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Del_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_doc_max);
XS_INTERNAL(XS_Lucy_Index_SegReader_doc_max) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Doc_Max_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Doc_Max);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_doc_count);
XS_INTERNAL(XS_Lucy_Index_SegReader_doc_count) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Doc_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Doc_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegReader__offsets);
XS_INTERNAL(XS_Lucy_Index_SegReader__offsets) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Offsets_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Offsets);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegReader_seg_readers);
XS_INTERNAL(XS_Lucy_Index_SegReader_seg_readers) {
    dXSARGS;
    lucy_SegReader* arg_self;
    LUCY_SegReader_Seg_Readers_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGREADER, LUCY_SegReader_Seg_Readers);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsReader_new);
XS_INTERNAL(XS_Lucy_Index_DeletionsReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DeletionsReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DeletionsReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_DeletionsReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DelReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DeletionsReader_del_count);
XS_INTERNAL(XS_Lucy_Index_DeletionsReader_del_count) {
    dXSARGS;
    lucy_DeletionsReader* arg_self;
    LUCY_DelReader_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSREADER, LUCY_DelReader_Del_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsReader_iterator);
XS_INTERNAL(XS_Lucy_Index_DeletionsReader_iterator) {
    dXSARGS;
    lucy_DeletionsReader* arg_self;
    LUCY_DelReader_Iterator_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSREADER, LUCY_DelReader_Iterator);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DeletionsReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_DeletionsReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DeletionsReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_DelReader_Aggregator_t method;
    lucy_DeletionsReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DELETIONSREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DELETIONSREADER, LUCY_DelReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_new);
XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyDeletionsReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    lucy_PolyDeletionsReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);
    arg_self = (lucy_PolyDeletionsReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyDelReader_init(arg_self, arg_readers, arg_offsets);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_del_count);
XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_del_count) {
    dXSARGS;
    lucy_PolyDeletionsReader* arg_self;
    LUCY_PolyDelReader_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDELETIONSREADER, LUCY_PolyDelReader_Del_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_iterator);
XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_iterator) {
    dXSARGS;
    lucy_PolyDeletionsReader* arg_self;
    LUCY_PolyDelReader_Iterator_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDELETIONSREADER, LUCY_PolyDelReader_Iterator);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_close);
XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_close) {
    dXSARGS;
    lucy_PolyDeletionsReader* arg_self;
    LUCY_PolyDelReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDELETIONSREADER, LUCY_PolyDelReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PolyDeletionsReader_DESTROY) {
    dXSARGS;
    lucy_PolyDeletionsReader* arg_self;
    LUCY_PolyDelReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDELETIONSREADER, LUCY_PolyDelReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_new);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DefaultDeletionsReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DefaultDeletionsReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    arg_self = (lucy_DefaultDeletionsReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefDelReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_del_count);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_del_count) {
    dXSARGS;
    lucy_DefaultDeletionsReader* arg_self;
    LUCY_DefDelReader_Del_Count_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSREADER, LUCY_DefDelReader_Del_Count);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_iterator);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_iterator) {
    dXSARGS;
    lucy_DefaultDeletionsReader* arg_self;
    LUCY_DefDelReader_Iterator_t method;
    lucy_Matcher* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSREADER, LUCY_DefDelReader_Iterator);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_read_deletions);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_read_deletions) {
    dXSARGS;
    lucy_DefaultDeletionsReader* arg_self;
    LUCY_DefDelReader_Read_Deletions_t method;
    lucy_BitVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSREADER, LUCY_DefDelReader_Read_Deletions);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_close);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_close) {
    dXSARGS;
    lucy_DefaultDeletionsReader* arg_self;
    LUCY_DefDelReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSREADER, LUCY_DefDelReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultDeletionsReader_DESTROY) {
    dXSARGS;
    lucy_DefaultDeletionsReader* arg_self;
    LUCY_DefDelReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDeletionsReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDELETIONSREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDELETIONSREADER, LUCY_DefDelReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocReader_new);
XS_INTERNAL(XS_Lucy_Index_DocReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("folder", 0),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("segments", 0),
        XSBIND_PARAM("seg_tick", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DocReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DocReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_folder = locations[1] < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;
    sv = ST(locations[2]);
    arg_snapshot = locations[2] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[3]);
    arg_segments = locations[3] < items ? (cfish_Vector*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "segments", CFISH_VECTOR, NULL) : NULL;
    sv = ST(locations[4]);
    arg_seg_tick = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : -1;
    arg_self = (lucy_DocReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DocReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DocReader_fetch_doc);
XS_INTERNAL(XS_Lucy_Index_DocReader_fetch_doc) {
    dXSARGS;
    SV *sv;
    lucy_DocReader* arg_self;
    int32_t arg_doc_id;
    LUCY_DocReader_Fetch_Doc_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCREADER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCREADER, LUCY_DocReader_Fetch_Doc);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DocReader_aggregator);
XS_INTERNAL(XS_Lucy_Index_DocReader_aggregator) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DocReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    LUCY_DocReader_Aggregator_t method;
    lucy_DocReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCREADER, NULL);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCREADER, LUCY_DocReader_Aggregator);
    retval = method(arg_self, arg_readers, arg_offsets);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyDocReader_new);
XS_INTERNAL(XS_Lucy_Index_PolyDocReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("readers", 1),
        XSBIND_PARAM("offsets", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyDocReader* arg_self;
    cfish_Vector* arg_readers;
    lucy_I32Array* arg_offsets;
    lucy_PolyDocReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "readers", CFISH_VECTOR, NULL);
    sv = ST(locations[1]);
    arg_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "offsets", LUCY_I32ARRAY, NULL);
    arg_self = (lucy_PolyDocReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyDocReader_init(arg_self, arg_readers, arg_offsets);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyDocReader_fetch_doc);
XS_INTERNAL(XS_Lucy_Index_PolyDocReader_fetch_doc) {
    dXSARGS;
    SV *sv;
    lucy_PolyDocReader* arg_self;
    int32_t arg_doc_id;
    LUCY_PolyDocReader_Fetch_Doc_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDOCREADER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDOCREADER, LUCY_PolyDocReader_Fetch_Doc);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyDocReader_close);
XS_INTERNAL(XS_Lucy_Index_PolyDocReader_close) {
    dXSARGS;
    lucy_PolyDocReader* arg_self;
    LUCY_PolyDocReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDOCREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDOCREADER, LUCY_PolyDocReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyDocReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PolyDocReader_DESTROY) {
    dXSARGS;
    lucy_PolyDocReader* arg_self;
    LUCY_PolyDocReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYDOCREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYDOCREADER, LUCY_PolyDocReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_new);
XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 1),
        XSBIND_PARAM("segments", 1),
        XSBIND_PARAM("seg_tick", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_DefaultDocReader* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    cfish_Vector* arg_segments;
    int32_t arg_seg_tick;
    lucy_DefaultDocReader* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);
    sv = ST(locations[3]);
    arg_segments = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "segments", CFISH_VECTOR, NULL);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "seg_tick");
    }
    arg_seg_tick = (int32_t)SvIV(sv);
    arg_self = (lucy_DefaultDocReader*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DefDocReader_init(arg_self, arg_schema, arg_folder, arg_snapshot, arg_segments, arg_seg_tick);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_fetch_doc);
XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_fetch_doc) {
    dXSARGS;
    SV *sv;
    lucy_DefaultDocReader* arg_self;
    int32_t arg_doc_id;
    LUCY_DefDocReader_Fetch_Doc_t method;
    lucy_HitDoc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDOCREADER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDOCREADER, LUCY_DefDocReader_Fetch_Doc);
    retval = method(arg_self, arg_doc_id);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_read_record);
XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_read_record) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("buffer", 1),
        XSBIND_PARAM("doc_id", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DefaultDocReader* arg_self;
    cfish_ByteBuf* arg_buffer;
    int32_t arg_doc_id;
    LUCY_DefDocReader_Read_Record_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DefaultDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDOCREADER, NULL);
    sv = ST(locations[0]);
    arg_buffer = (cfish_ByteBuf*)XSBind_arg_to_cfish(aTHX_ sv, "buffer", CFISH_BYTEBUF, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDOCREADER, LUCY_DefDocReader_Read_Record);
    method(arg_self, arg_buffer, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_close);
XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_close) {
    dXSARGS;
    lucy_DefaultDocReader* arg_self;
    LUCY_DefDocReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDOCREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDOCREADER, LUCY_DefDocReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DefaultDocReader_DESTROY) {
    dXSARGS;
    lucy_DefaultDocReader* arg_self;
    LUCY_DefDocReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DefaultDocReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DEFAULTDOCREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DEFAULTDOCREADER, LUCY_DefDocReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Counter_new);
XS_INTERNAL(XS_Lucy_Index_Counter_new) {
    dXSARGS;
    lucy_Counter* arg_self;
    lucy_Counter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_Counter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Counter_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Counter_add);
XS_INTERNAL(XS_Lucy_Index_Counter_add) {
    dXSARGS;
    SV *sv;
    lucy_Counter* arg_self;
    int64_t arg_amount;
    LUCY_Counter_Add_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, amount");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Counter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COUNTER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "amount");
    }
    arg_amount = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COUNTER, LUCY_Counter_Add);
    retval = method(arg_self, arg_amount);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Counter_get_value);
XS_INTERNAL(XS_Lucy_Index_Counter_get_value) {
    dXSARGS;
    lucy_Counter* arg_self;
    LUCY_Counter_Get_Value_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Counter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COUNTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COUNTER, LUCY_Counter_Get_Value);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Counter_reset);
XS_INTERNAL(XS_Lucy_Index_Counter_reset) {
    dXSARGS;
    lucy_Counter* arg_self;
    LUCY_Counter_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Counter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COUNTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COUNTER, LUCY_Counter_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_SFWriterElem_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SortFieldWriter_SFWriterElem_DESTROY) {
    dXSARGS;
    lucy_SFWriterElem* arg_self;
    LUCY_SFWriterElem_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SFWriterElem*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SFWRITERELEM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SFWRITERELEM, LUCY_SFWriterElem_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_FilePurger_new);
XS_INTERNAL(XS_Lucy_Index_FilePurger_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("snapshot", 0),
        XSBIND_PARAM("manager", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_FilePurger* arg_self;
    lucy_Folder* arg_folder;
    lucy_Snapshot* arg_snapshot;
    lucy_IndexManager* arg_manager;
    lucy_FilePurger* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_snapshot = locations[1] < items ? (lucy_Snapshot*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL) : NULL;
    sv = ST(locations[2]);
    arg_manager = locations[2] < items ? (lucy_IndexManager*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "manager", LUCY_INDEXMANAGER, NULL) : NULL;
    arg_self = (lucy_FilePurger*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FilePurger_init(arg_self, arg_folder, arg_snapshot, arg_manager);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_FilePurger_purge);
XS_INTERNAL(XS_Lucy_Index_FilePurger_purge) {
    dXSARGS;
    lucy_FilePurger* arg_self;
    LUCY_FilePurger_Purge_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilePurger*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEPURGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEPURGER, LUCY_FilePurger_Purge);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_FilePurger_DESTROY);
XS_INTERNAL(XS_Lucy_Index_FilePurger_DESTROY) {
    dXSARGS;
    lucy_FilePurger* arg_self;
    LUCY_FilePurger_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FilePurger*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEPURGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEPURGER, LUCY_FilePurger_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_new);
XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("index", 1),
        XSBIND_PARAM("manager", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_BackgroundMerger* arg_self;
    cfish_Obj* arg_index;
    lucy_IndexManager* arg_manager;
    lucy_BackgroundMerger* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_index = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "index", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_manager = locations[1] < items ? (lucy_IndexManager*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "manager", LUCY_INDEXMANAGER, NULL) : NULL;
    arg_self = (lucy_BackgroundMerger*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_BGMerger_init(arg_self, arg_index, arg_manager);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_optimize);
XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_optimize) {
    dXSARGS;
    lucy_BackgroundMerger* arg_self;
    LUCY_BGMerger_Optimize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BackgroundMerger*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BACKGROUNDMERGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BACKGROUNDMERGER, LUCY_BGMerger_Optimize);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_commit);
XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_commit) {
    dXSARGS;
    lucy_BackgroundMerger* arg_self;
    LUCY_BGMerger_Commit_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BackgroundMerger*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BACKGROUNDMERGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BACKGROUNDMERGER, LUCY_BGMerger_Commit);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_prepare_commit);
XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_prepare_commit) {
    dXSARGS;
    lucy_BackgroundMerger* arg_self;
    LUCY_BGMerger_Prepare_Commit_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BackgroundMerger*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BACKGROUNDMERGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BACKGROUNDMERGER, LUCY_BGMerger_Prepare_Commit);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_DESTROY);
XS_INTERNAL(XS_Lucy_Index_BackgroundMerger_DESTROY) {
    dXSARGS;
    lucy_BackgroundMerger* arg_self;
    LUCY_BGMerger_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_BackgroundMerger*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_BACKGROUNDMERGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_BACKGROUNDMERGER, LUCY_BGMerger_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_new);
XS_INTERNAL(XS_Lucy_Index_Lexicon_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_Lexicon* arg_self;
    cfish_String* arg_field;
    lucy_Lexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_Lexicon*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Lex_init(arg_self, arg_field);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Lexicon_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Lexicon_DESTROY) {
    dXSARGS;
    lucy_Lexicon* arg_self;
    LUCY_Lex_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_seek);
XS_INTERNAL(XS_Lucy_Index_Lexicon_seek) {
    dXSARGS;
    SV *sv;
    lucy_Lexicon* arg_self;
    cfish_Obj* arg_target;
    LUCY_Lex_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [target]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);
    sv = ST(1);
    arg_target = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "target", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_next);
XS_INTERNAL(XS_Lucy_Index_Lexicon_next) {
    dXSARGS;
    lucy_Lexicon* arg_self;
    LUCY_Lex_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_reset);
XS_INTERNAL(XS_Lucy_Index_Lexicon_reset) {
    dXSARGS;
    lucy_Lexicon* arg_self;
    LUCY_Lex_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_doc_freq);
XS_INTERNAL(XS_Lucy_Index_Lexicon_doc_freq) {
    dXSARGS;
    lucy_Lexicon* arg_self;
    LUCY_Lex_Doc_Freq_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Doc_Freq);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_get_term);
XS_INTERNAL(XS_Lucy_Index_Lexicon_get_term) {
    dXSARGS;
    lucy_Lexicon* arg_self;
    LUCY_Lex_Get_Term_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Get_Term);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Lexicon_get_field);
XS_INTERNAL(XS_Lucy_Index_Lexicon_get_field) {
    dXSARGS;
    lucy_Lexicon* arg_self;
    LUCY_Lex_Get_Field_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXICON, LUCY_Lex_Get_Field);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawLexicon_new);
XS_INTERNAL(XS_Lucy_Index_RawLexicon_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("instream", 1),
        XSBIND_PARAM("start", 1),
        XSBIND_PARAM("end", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_RawLexicon* arg_self;
    lucy_Schema* arg_schema;
    cfish_String* arg_field;
    lucy_InStream* arg_instream;
    int64_t arg_start;
    int64_t arg_end;
    lucy_RawLexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);
    sv = ST(locations[3]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "start");
    }
    arg_start = (int64_t)SvNV(sv);
    sv = ST(locations[4]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "end");
    }
    arg_end = (int64_t)SvNV(sv);
    arg_self = (lucy_RawLexicon*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RawLex_init(arg_self, arg_schema, arg_field, arg_instream, arg_start, arg_end);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_RawLexicon_DESTROY);
XS_INTERNAL(XS_Lucy_Index_RawLexicon_DESTROY) {
    dXSARGS;
    lucy_RawLexicon* arg_self;
    LUCY_RawLex_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWLEXICON, LUCY_RawLex_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_RawLexicon_next);
XS_INTERNAL(XS_Lucy_Index_RawLexicon_next) {
    dXSARGS;
    lucy_RawLexicon* arg_self;
    LUCY_RawLex_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWLEXICON, LUCY_RawLex_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawLexicon_get_term);
XS_INTERNAL(XS_Lucy_Index_RawLexicon_get_term) {
    dXSARGS;
    lucy_RawLexicon* arg_self;
    LUCY_RawLex_Get_Term_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWLEXICON, LUCY_RawLex_Get_Term);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_RawLexicon_doc_freq);
XS_INTERNAL(XS_Lucy_Index_RawLexicon_doc_freq) {
    dXSARGS;
    lucy_RawLexicon* arg_self;
    LUCY_RawLex_Doc_Freq_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RawLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAWLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAWLEXICON, LUCY_RawLex_Doc_Freq);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_new);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_SegLexicon* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Segment* arg_segment;
    cfish_String* arg_field;
    lucy_SegLexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_SegLexicon*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_SegLex_init(arg_self, arg_schema, arg_folder, arg_segment, arg_field);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_term_info);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_term_info) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Get_Term_Info_t method;
    lucy_TermInfo* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Get_Term_Info);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_field_num);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_field_num) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Get_Field_Num_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Get_Field_Num);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_segment);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_segment) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Get_Segment_t method;
    lucy_Segment* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Get_Segment);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_DESTROY);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_DESTROY) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_seek);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_seek) {
    dXSARGS;
    SV *sv;
    lucy_SegLexicon* arg_self;
    cfish_Obj* arg_target;
    LUCY_SegLex_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [target]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);
    sv = ST(1);
    arg_target = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "target", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_reset);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_reset) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_term);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_get_term) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Get_Term_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Get_Term);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_doc_freq);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_doc_freq) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Doc_Freq_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Doc_Freq);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_SegLexicon_next);
XS_INTERNAL(XS_Lucy_Index_SegLexicon_next) {
    dXSARGS;
    lucy_SegLexicon* arg_self;
    LUCY_SegLex_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SegLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SEGLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SEGLEXICON, LUCY_SegLex_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexIndex_new);
XS_INTERNAL(XS_Lucy_Index_LexIndex_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("segment", 1),
        XSBIND_PARAM("field", 1)
    };
    int32_t locations[4];
    SV *sv;
    lucy_LexIndex* arg_self;
    lucy_Schema* arg_schema;
    lucy_Folder* arg_folder;
    lucy_Segment* arg_segment;
    cfish_String* arg_field;
    lucy_LexIndex* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[2]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    sv = ST(locations[3]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_LexIndex*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LexIndex_init(arg_self, arg_schema, arg_folder, arg_segment, arg_field);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_LexIndex_seek);
XS_INTERNAL(XS_Lucy_Index_LexIndex_seek) {
    dXSARGS;
    SV *sv;
    lucy_LexIndex* arg_self;
    cfish_Obj* arg_target;
    LUCY_LexIndex_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [target]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexIndex*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXINDEX, NULL);
    sv = ST(1);
    arg_target = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "target", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXINDEX, LUCY_LexIndex_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_LexIndex_get_term_num);
XS_INTERNAL(XS_Lucy_Index_LexIndex_get_term_num) {
    dXSARGS;
    lucy_LexIndex* arg_self;
    LUCY_LexIndex_Get_Term_Num_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexIndex*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXINDEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXINDEX, LUCY_LexIndex_Get_Term_Num);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexIndex_get_term_info);
XS_INTERNAL(XS_Lucy_Index_LexIndex_get_term_info) {
    dXSARGS;
    lucy_LexIndex* arg_self;
    LUCY_LexIndex_Get_Term_Info_t method;
    lucy_TermInfo* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexIndex*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXINDEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXINDEX, LUCY_LexIndex_Get_Term_Info);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexIndex_get_term);
XS_INTERNAL(XS_Lucy_Index_LexIndex_get_term) {
    dXSARGS;
    lucy_LexIndex* arg_self;
    LUCY_LexIndex_Get_Term_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexIndex*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXINDEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXINDEX, LUCY_LexIndex_Get_Term);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_LexIndex_DESTROY);
XS_INTERNAL(XS_Lucy_Index_LexIndex_DESTROY) {
    dXSARGS;
    lucy_LexIndex* arg_self;
    LUCY_LexIndex_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LexIndex*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LEXINDEX, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LEXINDEX, LUCY_LexIndex_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexicon_new);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("sub_readers", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_PolyLexicon* arg_self;
    cfish_String* arg_field;
    cfish_Vector* arg_sub_readers;
    lucy_PolyLexicon* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_sub_readers = (cfish_Vector*)XSBind_arg_to_cfish(aTHX_ sv, "sub_readers", CFISH_VECTOR, NULL);
    arg_self = (lucy_PolyLexicon*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_PolyLex_init(arg_self, arg_field, arg_sub_readers);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_PolyLexicon_seek);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_seek) {
    dXSARGS;
    SV *sv;
    lucy_PolyLexicon* arg_self;
    cfish_Obj* arg_target;
    LUCY_PolyLex_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [target]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICON, NULL);
    sv = ST(1);
    arg_target = 1 < items ? (cfish_Obj*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "target", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICON, LUCY_PolyLex_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexicon_next);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_next) {
    dXSARGS;
    lucy_PolyLexicon* arg_self;
    LUCY_PolyLex_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICON, LUCY_PolyLex_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexicon_reset);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_reset) {
    dXSARGS;
    lucy_PolyLexicon* arg_self;
    LUCY_PolyLex_Reset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICON, LUCY_PolyLex_Reset);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexicon_get_term);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_get_term) {
    dXSARGS;
    lucy_PolyLexicon* arg_self;
    LUCY_PolyLex_Get_Term_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICON, LUCY_PolyLex_Get_Term);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexicon_get_num_seg_lexicons);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_get_num_seg_lexicons) {
    dXSARGS;
    lucy_PolyLexicon* arg_self;
    LUCY_PolyLex_Get_Num_Seg_Lexicons_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICON, LUCY_PolyLex_Get_Num_Seg_Lexicons);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_PolyLexicon_DESTROY);
XS_INTERNAL(XS_Lucy_Index_PolyLexicon_DESTROY) {
    dXSARGS;
    lucy_PolyLexicon* arg_self;
    LUCY_PolyLex_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_PolyLexicon*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_POLYLEXICON, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_POLYLEXICON, LUCY_PolyLex_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer__new);
XS_INTERNAL(XS_Lucy_Index_Indexer__new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("schema", 0),
        XSBIND_PARAM("index", 1),
        XSBIND_PARAM("manager", 0),
        XSBIND_PARAM("flags", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_Indexer* arg_self;
    lucy_Schema* arg_schema;
    cfish_Obj* arg_index;
    lucy_IndexManager* arg_manager;
    int32_t arg_flags;
    lucy_Indexer* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    sv = ST(locations[0]);
    arg_schema = locations[0] < items ? (lucy_Schema*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "schema", LUCY_SCHEMA, NULL) : NULL;
    sv = ST(locations[1]);
    arg_index = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "index", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_manager = locations[2] < items ? (lucy_IndexManager*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "manager", LUCY_INDEXMANAGER, NULL) : NULL;
    sv = ST(locations[3]);
    arg_flags = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    arg_self = (lucy_Indexer*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Indexer_init(arg_self, arg_schema, arg_index, arg_manager, arg_flags);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Indexer_add_index);
XS_INTERNAL(XS_Lucy_Index_Indexer_add_index) {
    dXSARGS;
    SV *sv;
    lucy_Indexer* arg_self;
    cfish_Obj* arg_index;
    LUCY_Indexer_Add_Index_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, index");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);
    sv = ST(1);
    arg_index = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "index", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Add_Index);
    method(arg_self, arg_index);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_delete_by_term);
XS_INTERNAL(XS_Lucy_Index_Indexer_delete_by_term) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Indexer* arg_self;
    cfish_String* arg_field;
    cfish_Obj* arg_term;
    LUCY_Indexer_Delete_By_Term_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Delete_By_Term);
    method(arg_self, arg_field, arg_term);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_delete_by_query);
XS_INTERNAL(XS_Lucy_Index_Indexer_delete_by_query) {
    dXSARGS;
    SV *sv;
    lucy_Indexer* arg_self;
    lucy_Query* arg_query;
    LUCY_Indexer_Delete_By_Query_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, query");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);
    sv = ST(1);
    arg_query = (lucy_Query*)XSBind_arg_to_cfish(aTHX_ sv, "query", LUCY_QUERY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Delete_By_Query);
    method(arg_self, arg_query);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_delete_by_doc_id);
XS_INTERNAL(XS_Lucy_Index_Indexer_delete_by_doc_id) {
    dXSARGS;
    SV *sv;
    lucy_Indexer* arg_self;
    int32_t arg_doc_id;
    LUCY_Indexer_Delete_By_Doc_ID_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_id");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "doc_id");
    }
    arg_doc_id = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Delete_By_Doc_ID);
    method(arg_self, arg_doc_id);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_optimize);
XS_INTERNAL(XS_Lucy_Index_Indexer_optimize) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Optimize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Optimize);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_commit);
XS_INTERNAL(XS_Lucy_Index_Indexer_commit) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Commit_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Commit);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_prepare_commit);
XS_INTERNAL(XS_Lucy_Index_Indexer_prepare_commit) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Prepare_Commit_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Prepare_Commit);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_get_schema);
XS_INTERNAL(XS_Lucy_Index_Indexer_get_schema) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Get_Schema_t method;
    lucy_Schema* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Get_Schema);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_get_seg_writer);
XS_INTERNAL(XS_Lucy_Index_Indexer_get_seg_writer) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Get_Seg_Writer_t method;
    lucy_SegWriter* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Get_Seg_Writer);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_get_stock_doc);
XS_INTERNAL(XS_Lucy_Index_Indexer_get_stock_doc) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Get_Stock_Doc_t method;
    lucy_Doc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Get_Stock_Doc);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Indexer_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Indexer_DESTROY) {
    dXSARGS;
    lucy_Indexer* arg_self;
    LUCY_Indexer_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXER, LUCY_Indexer_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_new);
XS_INTERNAL(XS_Lucy_Index_TermVector_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("text", 1),
        XSBIND_PARAM("positions", 1),
        XSBIND_PARAM("start_offsets", 1),
        XSBIND_PARAM("end_offsets", 1)
    };
    int32_t locations[5];
    SV *sv;
    lucy_TermVector* arg_self;
    cfish_String* arg_field;
    cfish_String* arg_text;
    lucy_I32Array* arg_positions;
    lucy_I32Array* arg_start_offsets;
    lucy_I32Array* arg_end_offsets;
    lucy_TermVector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_text = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "text", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_positions = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "positions", LUCY_I32ARRAY, NULL);
    sv = ST(locations[3]);
    arg_start_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "start_offsets", LUCY_I32ARRAY, NULL);
    sv = ST(locations[4]);
    arg_end_offsets = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "end_offsets", LUCY_I32ARRAY, NULL);
    arg_self = (lucy_TermVector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_TV_init(arg_self, arg_field, arg_text, arg_positions, arg_start_offsets, arg_end_offsets);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_TermVector_get_positions);
XS_INTERNAL(XS_Lucy_Index_TermVector_get_positions) {
    dXSARGS;
    lucy_TermVector* arg_self;
    LUCY_TV_Get_Positions_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Get_Positions);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_get_start_offsets);
XS_INTERNAL(XS_Lucy_Index_TermVector_get_start_offsets) {
    dXSARGS;
    lucy_TermVector* arg_self;
    LUCY_TV_Get_Start_Offsets_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Get_Start_Offsets);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_get_end_offsets);
XS_INTERNAL(XS_Lucy_Index_TermVector_get_end_offsets) {
    dXSARGS;
    lucy_TermVector* arg_self;
    LUCY_TV_Get_End_Offsets_t method;
    lucy_I32Array* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Get_End_Offsets);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_serialize);
XS_INTERNAL(XS_Lucy_Index_TermVector_serialize) {
    dXSARGS;
    SV *sv;
    lucy_TermVector* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_TV_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_deserialize);
XS_INTERNAL(XS_Lucy_Index_TermVector_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_TermVector* arg_self;
    lucy_InStream* arg_instream;
    LUCY_TV_Deserialize_t method;
    lucy_TermVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Deserialize);
    arg_self = (lucy_TermVector*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_equals);
XS_INTERNAL(XS_Lucy_Index_TermVector_equals) {
    dXSARGS;
    SV *sv;
    lucy_TermVector* arg_self;
    cfish_Obj* arg_other;
    LUCY_TV_Equals_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Equals);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_TermVector_DESTROY);
XS_INTERNAL(XS_Lucy_Index_TermVector_DESTROY) {
    dXSARGS;
    lucy_TermVector* arg_self;
    LUCY_TV_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_TermVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TERMVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_TERMVECTOR, LUCY_TV_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocVector_new);
XS_INTERNAL(XS_Lucy_Index_DocVector_new) {
    dXSARGS;
    lucy_DocVector* arg_self;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_DocVector*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DocVec_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_DocVector_term_vector);
XS_INTERNAL(XS_Lucy_Index_DocVector_term_vector) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("term", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DocVector* arg_self;
    cfish_String* arg_field;
    cfish_String* arg_term;
    LUCY_DocVec_Term_Vector_t method;
    lucy_TermVector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DocVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCVECTOR, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_term = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "term", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCVECTOR, LUCY_DocVec_Term_Vector);
    retval = method(arg_self, arg_field, arg_term);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DocVector_add_field_buf);
XS_INTERNAL(XS_Lucy_Index_DocVector_add_field_buf) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("field", 1),
        XSBIND_PARAM("field_buf", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_DocVector* arg_self;
    cfish_String* arg_field;
    cfish_Blob* arg_field_buf;
    LUCY_DocVec_Add_Field_Buf_t method;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_DocVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCVECTOR, NULL);
    sv = ST(locations[0]);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_field_buf = (cfish_Blob*)XSBind_arg_to_cfish(aTHX_ sv, "field_buf", CFISH_BLOB, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCVECTOR, LUCY_DocVec_Add_Field_Buf);
    method(arg_self, arg_field, arg_field_buf);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocVector_field_buf);
XS_INTERNAL(XS_Lucy_Index_DocVector_field_buf) {
    dXSARGS;
    SV *sv;
    lucy_DocVector* arg_self;
    cfish_String* arg_field;
    LUCY_DocVec_Field_Buf_t method;
    cfish_Blob* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, field");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCVECTOR, NULL);
    sv = ST(1);
    arg_field = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCVECTOR, LUCY_DocVec_Field_Buf);
    retval = method(arg_self, arg_field);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DocVector_serialize);
XS_INTERNAL(XS_Lucy_Index_DocVector_serialize) {
    dXSARGS;
    SV *sv;
    lucy_DocVector* arg_self;
    lucy_OutStream* arg_outstream;
    LUCY_DocVec_Serialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, outstream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCVECTOR, NULL);
    sv = ST(1);
    arg_outstream = (lucy_OutStream*)XSBind_arg_to_cfish(aTHX_ sv, "outstream", LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCVECTOR, LUCY_DocVec_Serialize);
    method(arg_self, arg_outstream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_DocVector_deserialize);
XS_INTERNAL(XS_Lucy_Index_DocVector_deserialize) {
    dXSARGS;
    SV *sv;
    lucy_DocVector* arg_self;
    lucy_InStream* arg_instream;
    LUCY_DocVec_Deserialize_t method;
    lucy_DocVector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCVECTOR, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCVECTOR, LUCY_DocVec_Deserialize);
    arg_self = (lucy_DocVector*)CFISH_INCREF(arg_self);
    retval = method(arg_self, arg_instream);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_DocVector_DESTROY);
XS_INTERNAL(XS_Lucy_Index_DocVector_DESTROY) {
    dXSARGS;
    lucy_DocVector* arg_self;
    LUCY_DocVec_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DocVector*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOCVECTOR, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DOCVECTOR, LUCY_DocVec_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_new);
XS_INTERNAL(XS_Lucy_Index_Inverter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("segment", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Inverter* arg_self;
    lucy_Schema* arg_schema;
    lucy_Segment* arg_segment;
    lucy_Inverter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_segment = (lucy_Segment*)XSBind_arg_to_cfish(aTHX_ sv, "segment", LUCY_SEGMENT, NULL);
    arg_self = (lucy_Inverter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Inverter_init(arg_self, arg_schema, arg_segment);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Inverter_invert_doc);
XS_INTERNAL(XS_Lucy_Index_Inverter_invert_doc) {
    dXSARGS;
    SV *sv;
    lucy_Inverter* arg_self;
    lucy_Doc* arg_doc;
    LUCY_Inverter_Invert_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);
    sv = ST(1);
    arg_doc = (lucy_Doc*)XSBind_arg_to_cfish(aTHX_ sv, "doc", LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Invert_Doc);
    method(arg_self, arg_doc);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_set_doc);
XS_INTERNAL(XS_Lucy_Index_Inverter_set_doc) {
    dXSARGS;
    SV *sv;
    lucy_Inverter* arg_self;
    lucy_Doc* arg_doc;
    LUCY_Inverter_Set_Doc_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);
    sv = ST(1);
    arg_doc = (lucy_Doc*)XSBind_arg_to_cfish(aTHX_ sv, "doc", LUCY_DOC, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Set_Doc);
    method(arg_self, arg_doc);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_set_boost);
XS_INTERNAL(XS_Lucy_Index_Inverter_set_boost) {
    dXSARGS;
    SV *sv;
    lucy_Inverter* arg_self;
    float arg_boost;
    LUCY_Inverter_Set_Boost_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, boost");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "boost");
    }
    arg_boost = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Set_Boost);
    method(arg_self, arg_boost);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_add_field);
XS_INTERNAL(XS_Lucy_Index_Inverter_add_field) {
    dXSARGS;
    SV *sv;
    lucy_Inverter* arg_self;
    lucy_InverterEntry* arg_entry;
    LUCY_Inverter_Add_Field_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, entry");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);
    sv = ST(1);
    arg_entry = (lucy_InverterEntry*)XSBind_arg_to_cfish(aTHX_ sv, "entry", LUCY_INVERTERENTRY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Add_Field);
    method(arg_self, arg_entry);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_clear);
XS_INTERNAL(XS_Lucy_Index_Inverter_clear) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Clear_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Clear);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_iterate);
XS_INTERNAL(XS_Lucy_Index_Inverter_iterate) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Iterate_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Iterate);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_next);
XS_INTERNAL(XS_Lucy_Index_Inverter_next) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Next_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_doc);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_doc) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Doc_t method;
    lucy_Doc* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Doc);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_boost);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_boost) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Boost_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Boost);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_field_name);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_field_name) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Field_Name_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Field_Name);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_value);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_value) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Value_t method;
    cfish_Obj* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Value);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_type);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_type) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Type_t method;
    lucy_FieldType* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Type);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_analyzer);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_analyzer) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Analyzer_t method;
    lucy_Analyzer* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Analyzer);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_similarity);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_similarity) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Similarity_t method;
    lucy_Similarity* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Similarity);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_get_inversion);
XS_INTERNAL(XS_Lucy_Index_Inverter_get_inversion) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Get_Inversion_t method;
    lucy_Inversion* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Get_Inversion);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Inverter_DESTROY) {
    dXSARGS;
    lucy_Inverter* arg_self;
    LUCY_Inverter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Inverter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTER, LUCY_Inverter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_new);
XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("schema", 1),
        XSBIND_PARAM("field_name", 1),
        XSBIND_PARAM("field_num", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_InverterEntry* arg_self;
    lucy_Schema* arg_schema;
    cfish_String* arg_field_name;
    int32_t arg_field_num;
    lucy_InverterEntry* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_schema = (lucy_Schema*)XSBind_arg_to_cfish(aTHX_ sv, "schema", LUCY_SCHEMA, NULL);
    sv = ST(locations[1]);
    arg_field_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "field_name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "field_num");
    }
    arg_field_num = (int32_t)SvIV(sv);
    arg_self = (lucy_InverterEntry*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_InvEntry_init(arg_self, arg_schema, arg_field_name, arg_field_num);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_compare_to);
XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_compare_to) {
    dXSARGS;
    SV *sv;
    lucy_InverterEntry* arg_self;
    cfish_Obj* arg_other;
    LUCY_InvEntry_Compare_To_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, other");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InverterEntry*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTERENTRY, NULL);
    sv = ST(1);
    arg_other = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "other", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTERENTRY, LUCY_InvEntry_Compare_To);
    retval = method(arg_self, arg_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_clear);
XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_clear) {
    dXSARGS;
    lucy_InverterEntry* arg_self;
    LUCY_InvEntry_Clear_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InverterEntry*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTERENTRY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTERENTRY, LUCY_InvEntry_Clear);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_DESTROY);
XS_INTERNAL(XS_Lucy_Index_Inverter_InverterEntry_DESTROY) {
    dXSARGS;
    lucy_InverterEntry* arg_self;
    LUCY_InvEntry_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InverterEntry*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INVERTERENTRY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INVERTERENTRY, LUCY_InvEntry_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_new);
XS_INTERNAL(XS_Lucy_Index_IndexManager_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("host", 0),
        XSBIND_PARAM("lock_factory", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_IndexManager* arg_self;
    cfish_String* arg_host;
    lucy_LockFactory* arg_lock_factory;
    lucy_IndexManager* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_host = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "host", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    arg_lock_factory = locations[1] < items ? (lucy_LockFactory*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "lock_factory", LUCY_LOCKFACTORY, NULL) : NULL;
    arg_self = (lucy_IndexManager*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_IxManager_init(arg_self, arg_host, arg_lock_factory);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Index_IndexManager_DESTROY);
XS_INTERNAL(XS_Lucy_Index_IndexManager_DESTROY) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_folder);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_folder) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    lucy_Folder* arg_folder;
    LUCY_IxManager_Set_Folder_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [folder]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    arg_folder = 1 < items ? (lucy_Folder*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "folder", LUCY_FOLDER, NULL) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Folder);
    method(arg_self, arg_folder);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_folder);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_folder) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Folder);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_host);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_host) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Host_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Host);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_recycle);
XS_INTERNAL(XS_Lucy_Index_IndexManager_recycle) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[4] = {
        XSBIND_PARAM("reader", 1),
        XSBIND_PARAM("del_writer", 1),
        XSBIND_PARAM("cutoff", 1),
        XSBIND_PARAM("optimize", 0)
    };
    int32_t locations[4];
    SV *sv;
    lucy_IndexManager* arg_self;
    lucy_PolyReader* arg_reader;
    lucy_DeletionsWriter* arg_del_writer;
    int64_t arg_cutoff;
    bool arg_optimize;
    LUCY_IxManager_Recycle_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 4);
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(locations[0]);
    arg_reader = (lucy_PolyReader*)XSBind_arg_to_cfish(aTHX_ sv, "reader", LUCY_POLYREADER, NULL);
    sv = ST(locations[1]);
    arg_del_writer = (lucy_DeletionsWriter*)XSBind_arg_to_cfish(aTHX_ sv, "del_writer", LUCY_DELETIONSWRITER, NULL);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cutoff");
    }
    arg_cutoff = (int64_t)SvNV(sv);
    sv = ST(locations[3]);
    arg_optimize = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Recycle);
    retval = method(arg_self, arg_reader, arg_del_writer, arg_cutoff, arg_optimize);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_choose_sparse);
XS_INTERNAL(XS_Lucy_Index_IndexManager_choose_sparse) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    lucy_I32Array* arg_doc_counts;
    LUCY_IxManager_Choose_Sparse_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, doc_counts");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    arg_doc_counts = (lucy_I32Array*)XSBind_arg_to_cfish(aTHX_ sv, "doc_counts", LUCY_I32ARRAY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Choose_Sparse);
    retval = method(arg_self, arg_doc_counts);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_make_write_lock);
XS_INTERNAL(XS_Lucy_Index_IndexManager_make_write_lock) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Make_Write_Lock_t method;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Make_Write_Lock);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_make_deletion_lock);
XS_INTERNAL(XS_Lucy_Index_IndexManager_make_deletion_lock) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Make_Deletion_Lock_t method;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Make_Deletion_Lock);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_make_merge_lock);
XS_INTERNAL(XS_Lucy_Index_IndexManager_make_merge_lock) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Make_Merge_Lock_t method;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Make_Merge_Lock);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_write_merge_data);
XS_INTERNAL(XS_Lucy_Index_IndexManager_write_merge_data) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    int64_t arg_cutoff;
    LUCY_IxManager_Write_Merge_Data_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, cutoff");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "cutoff");
    }
    arg_cutoff = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Write_Merge_Data);
    method(arg_self, arg_cutoff);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_read_merge_data);
XS_INTERNAL(XS_Lucy_Index_IndexManager_read_merge_data) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Read_Merge_Data_t method;
    cfish_Hash* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Read_Merge_Data);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_remove_merge_data);
XS_INTERNAL(XS_Lucy_Index_IndexManager_remove_merge_data) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Remove_Merge_Data_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Remove_Merge_Data);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_make_snapshot_read_lock);
XS_INTERNAL(XS_Lucy_Index_IndexManager_make_snapshot_read_lock) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    cfish_String* arg_filename;
    LUCY_IxManager_Make_Snapshot_Read_Lock_t method;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, filename");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    arg_filename = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "filename", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Make_Snapshot_Read_Lock);
    retval = method(arg_self, arg_filename);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_highest_seg_num);
XS_INTERNAL(XS_Lucy_Index_IndexManager_highest_seg_num) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    lucy_Snapshot* arg_snapshot;
    LUCY_IxManager_Highest_Seg_Num_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, snapshot");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    arg_snapshot = (lucy_Snapshot*)XSBind_arg_to_cfish(aTHX_ sv, "snapshot", LUCY_SNAPSHOT, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Highest_Seg_Num);
    retval = method(arg_self, arg_snapshot);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_make_snapshot_filename);
XS_INTERNAL(XS_Lucy_Index_IndexManager_make_snapshot_filename) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Make_Snapshot_Filename_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Make_Snapshot_Filename);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_write_lock_timeout);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_write_lock_timeout) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    uint32_t arg_timeout;
    LUCY_IxManager_Set_Write_Lock_Timeout_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, timeout");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "timeout");
    }
    arg_timeout = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Write_Lock_Timeout);
    method(arg_self, arg_timeout);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_write_lock_timeout);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_write_lock_timeout) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Write_Lock_Timeout_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Write_Lock_Timeout);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_write_lock_interval);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_write_lock_interval) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    uint32_t arg_timeout;
    LUCY_IxManager_Set_Write_Lock_Interval_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, timeout");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "timeout");
    }
    arg_timeout = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Write_Lock_Interval);
    method(arg_self, arg_timeout);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_write_lock_interval);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_write_lock_interval) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Write_Lock_Interval_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Write_Lock_Interval);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_merge_lock_timeout);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_merge_lock_timeout) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    uint32_t arg_timeout;
    LUCY_IxManager_Set_Merge_Lock_Timeout_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, timeout");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "timeout");
    }
    arg_timeout = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Merge_Lock_Timeout);
    method(arg_self, arg_timeout);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_merge_lock_timeout);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_merge_lock_timeout) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Merge_Lock_Timeout_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Merge_Lock_Timeout);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_merge_lock_interval);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_merge_lock_interval) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    uint32_t arg_timeout;
    LUCY_IxManager_Set_Merge_Lock_Interval_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, timeout");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "timeout");
    }
    arg_timeout = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Merge_Lock_Interval);
    method(arg_self, arg_timeout);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_merge_lock_interval);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_merge_lock_interval) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Merge_Lock_Interval_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Merge_Lock_Interval);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_deletion_lock_timeout);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_deletion_lock_timeout) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    uint32_t arg_timeout;
    LUCY_IxManager_Set_Deletion_Lock_Timeout_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, timeout");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "timeout");
    }
    arg_timeout = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Deletion_Lock_Timeout);
    method(arg_self, arg_timeout);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_deletion_lock_timeout);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_deletion_lock_timeout) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Deletion_Lock_Timeout_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Deletion_Lock_Timeout);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_set_deletion_lock_interval);
XS_INTERNAL(XS_Lucy_Index_IndexManager_set_deletion_lock_interval) {
    dXSARGS;
    SV *sv;
    lucy_IndexManager* arg_self;
    uint32_t arg_timeout;
    LUCY_IxManager_Set_Deletion_Lock_Interval_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, timeout");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "timeout");
    }
    arg_timeout = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Set_Deletion_Lock_Interval);
    method(arg_self, arg_timeout);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Index_IndexManager_get_deletion_lock_interval);
XS_INTERNAL(XS_Lucy_Index_IndexManager_get_deletion_lock_interval) {
    dXSARGS;
    lucy_IndexManager* arg_self;
    LUCY_IxManager_Get_Deletion_Lock_Interval_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_IndexManager*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXMANAGER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INDEXMANAGER, LUCY_IxManager_Get_Deletion_Lock_Interval);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFile_new);
XS_INTERNAL(XS_Lucy_Store_RAMFile_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("contents", 0),
        XSBIND_PARAM("read_only", 0)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RAMFile* arg_self;
    cfish_ByteBuf* arg_contents;
    bool arg_read_only;
    lucy_RAMFile* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_contents = locations[0] < items ? (cfish_ByteBuf*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "contents", CFISH_BYTEBUF, NULL) : NULL;
    sv = ST(locations[1]);
    arg_read_only = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? XSBind_sv_true(aTHX_ sv) : false;
    arg_self = (lucy_RAMFile*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RAMFile_init(arg_self, arg_contents, arg_read_only);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_RAMFile_get_contents);
XS_INTERNAL(XS_Lucy_Store_RAMFile_get_contents) {
    dXSARGS;
    lucy_RAMFile* arg_self;
    LUCY_RAMFile_Get_Contents_t method;
    cfish_ByteBuf* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFile*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILE, LUCY_RAMFile_Get_Contents);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFile_read_only);
XS_INTERNAL(XS_Lucy_Store_RAMFile_read_only) {
    dXSARGS;
    lucy_RAMFile* arg_self;
    LUCY_RAMFile_Read_Only_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFile*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILE, LUCY_RAMFile_Read_Only);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFile_set_read_only);
XS_INTERNAL(XS_Lucy_Store_RAMFile_set_read_only) {
    dXSARGS;
    SV *sv;
    lucy_RAMFile* arg_self;
    bool arg_read_only;
    LUCY_RAMFile_Set_Read_Only_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, read_only");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFile*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "read_only");
    }
    arg_read_only = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILE, LUCY_RAMFile_Set_Read_Only);
    method(arg_self, arg_read_only);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_RAMFile_DESTROY);
XS_INTERNAL(XS_Lucy_Store_RAMFile_DESTROY) {
    dXSARGS;
    lucy_RAMFile* arg_self;
    LUCY_RAMFile_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFile*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILE, LUCY_RAMFile_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Lock_new);
XS_INTERNAL(XS_Lucy_Store_Lock_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("host", 1),
        XSBIND_PARAM("timeout", 0),
        XSBIND_PARAM("interval", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_Lock* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_name;
    cfish_String* arg_host;
    int32_t arg_timeout;
    int32_t arg_interval;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_host = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "host", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_timeout = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    sv = ST(locations[4]);
    arg_interval = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 100;
    arg_self = (lucy_Lock*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Lock_init(arg_self, arg_folder, arg_name, arg_host, arg_timeout, arg_interval);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_Lock_shared);
XS_INTERNAL(XS_Lucy_Store_Lock_shared) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Shared_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Shared);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_obtain);
XS_INTERNAL(XS_Lucy_Store_Lock_obtain) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Obtain_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Obtain);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_request);
XS_INTERNAL(XS_Lucy_Store_Lock_request) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Request_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Request);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_release);
XS_INTERNAL(XS_Lucy_Store_Lock_release) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Release_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Release);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Lock_is_locked);
XS_INTERNAL(XS_Lucy_Store_Lock_is_locked) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Is_Locked_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Is_Locked);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_clear_stale);
XS_INTERNAL(XS_Lucy_Store_Lock_clear_stale) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Clear_Stale_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Clear_Stale);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Lock_get_name);
XS_INTERNAL(XS_Lucy_Store_Lock_get_name) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Get_Name_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Get_Name);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_get_host);
XS_INTERNAL(XS_Lucy_Store_Lock_get_host) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Get_Host_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Get_Host);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_get_lock_path);
XS_INTERNAL(XS_Lucy_Store_Lock_get_lock_path) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Get_Lock_Path_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Get_Lock_Path);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Lock_DESTROY);
XS_INTERNAL(XS_Lucy_Store_Lock_DESTROY) {
    dXSARGS;
    lucy_Lock* arg_self;
    LUCY_Lock_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Lock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCK, LUCY_Lock_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_new);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("host", 1),
        XSBIND_PARAM("timeout", 0),
        XSBIND_PARAM("interval", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_LockFileLock* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_name;
    cfish_String* arg_host;
    int32_t arg_timeout;
    int32_t arg_interval;
    lucy_LockFileLock* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_host = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "host", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_timeout = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    sv = ST(locations[4]);
    arg_interval = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 100;
    arg_self = (lucy_LockFileLock*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LFLock_init(arg_self, arg_folder, arg_name, arg_host, arg_timeout, arg_interval);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_LockFileLock_shared);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_shared) {
    dXSARGS;
    lucy_LockFileLock* arg_self;
    LUCY_LFLock_Shared_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Shared);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_request);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_request) {
    dXSARGS;
    lucy_LockFileLock* arg_self;
    LUCY_LFLock_Request_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Request);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_release);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_release) {
    dXSARGS;
    lucy_LockFileLock* arg_self;
    LUCY_LFLock_Release_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Release);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_is_locked);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_is_locked) {
    dXSARGS;
    lucy_LockFileLock* arg_self;
    LUCY_LFLock_Is_Locked_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Is_Locked);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_clear_stale);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_clear_stale) {
    dXSARGS;
    lucy_LockFileLock* arg_self;
    LUCY_LFLock_Clear_Stale_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Clear_Stale);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_maybe_delete_file);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_maybe_delete_file) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("filepath", 1),
        XSBIND_PARAM("delete_mine", 1),
        XSBIND_PARAM("delete_other", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_LockFileLock* arg_self;
    cfish_String* arg_filepath;
    bool arg_delete_mine;
    bool arg_delete_other;
    LUCY_LFLock_Maybe_Delete_File_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);
    sv = ST(locations[0]);
    arg_filepath = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "filepath", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "delete_mine");
    }
    arg_delete_mine = XSBind_sv_true(aTHX_ sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "delete_other");
    }
    arg_delete_other = XSBind_sv_true(aTHX_ sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Maybe_Delete_File);
    retval = method(arg_self, arg_filepath, arg_delete_mine, arg_delete_other);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFileLock_DESTROY);
XS_INTERNAL(XS_Lucy_Store_LockFileLock_DESTROY) {
    dXSARGS;
    lucy_LockFileLock* arg_self;
    LUCY_LFLock_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFileLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFILELOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFILELOCK, LUCY_LFLock_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_SharedLock_new);
XS_INTERNAL(XS_Lucy_Store_SharedLock_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("host", 1),
        XSBIND_PARAM("timeout", 0),
        XSBIND_PARAM("interval", 0)
    };
    int32_t locations[5];
    SV *sv;
    lucy_SharedLock* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_name;
    cfish_String* arg_host;
    int32_t arg_timeout;
    int32_t arg_interval;
    lucy_SharedLock* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 5);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[2]);
    arg_host = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "host", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[3]);
    arg_timeout = locations[3] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    sv = ST(locations[4]);
    arg_interval = locations[4] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 100;
    arg_self = (lucy_SharedLock*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_ShLock_init(arg_self, arg_folder, arg_name, arg_host, arg_timeout, arg_interval);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_SharedLock_shared);
XS_INTERNAL(XS_Lucy_Store_SharedLock_shared) {
    dXSARGS;
    lucy_SharedLock* arg_self;
    LUCY_ShLock_Shared_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SharedLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SHAREDLOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SHAREDLOCK, LUCY_ShLock_Shared);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_SharedLock_request);
XS_INTERNAL(XS_Lucy_Store_SharedLock_request) {
    dXSARGS;
    lucy_SharedLock* arg_self;
    LUCY_ShLock_Request_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SharedLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SHAREDLOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SHAREDLOCK, LUCY_ShLock_Request);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_SharedLock_release);
XS_INTERNAL(XS_Lucy_Store_SharedLock_release) {
    dXSARGS;
    lucy_SharedLock* arg_self;
    LUCY_ShLock_Release_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SharedLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SHAREDLOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SHAREDLOCK, LUCY_ShLock_Release);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_SharedLock_is_locked);
XS_INTERNAL(XS_Lucy_Store_SharedLock_is_locked) {
    dXSARGS;
    lucy_SharedLock* arg_self;
    LUCY_ShLock_Is_Locked_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SharedLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SHAREDLOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SHAREDLOCK, LUCY_ShLock_Is_Locked);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_SharedLock_clear_stale);
XS_INTERNAL(XS_Lucy_Store_SharedLock_clear_stale) {
    dXSARGS;
    lucy_SharedLock* arg_self;
    LUCY_ShLock_Clear_Stale_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_SharedLock*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SHAREDLOCK, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_SHAREDLOCK, LUCY_ShLock_Clear_Stale);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_open);
XS_INTERNAL(XS_Lucy_Store_OutStream_open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("file", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_OutStream* arg_self;
    cfish_Obj* arg_file;
    lucy_OutStream* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_file = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "file", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_OutStream*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_OutStream_do_open(arg_self, arg_file);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_OutStream_get_path);
XS_INTERNAL(XS_Lucy_Store_OutStream_get_path) {
    dXSARGS;
    lucy_OutStream* arg_self;
    LUCY_OutStream_Get_Path_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Get_Path);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_tell);
XS_INTERNAL(XS_Lucy_Store_OutStream_tell) {
    dXSARGS;
    lucy_OutStream* arg_self;
    LUCY_OutStream_Tell_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Tell);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_align);
XS_INTERNAL(XS_Lucy_Store_OutStream_align) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int64_t arg_modulus;
    LUCY_OutStream_Align_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, modulus");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "modulus");
    }
    arg_modulus = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Align);
    retval = method(arg_self, arg_modulus);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_flush);
XS_INTERNAL(XS_Lucy_Store_OutStream_flush) {
    dXSARGS;
    lucy_OutStream* arg_self;
    LUCY_OutStream_Flush_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Flush);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_length);
XS_INTERNAL(XS_Lucy_Store_OutStream_length) {
    dXSARGS;
    lucy_OutStream* arg_self;
    LUCY_OutStream_Length_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Length);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_grow);
XS_INTERNAL(XS_Lucy_Store_OutStream_grow) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int64_t arg_length;
    LUCY_OutStream_Grow_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, length");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "length");
    }
    arg_length = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Grow);
    method(arg_self, arg_length);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_i8);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_i8) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int8_t arg_value;
    LUCY_OutStream_Write_I8_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (int8_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_I8);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_u8);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_u8) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    uint8_t arg_value;
    LUCY_OutStream_Write_U8_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (uint8_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_U8);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_i32);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_i32) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int32_t arg_value;
    LUCY_OutStream_Write_I32_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_I32);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_u32);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_u32) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    uint32_t arg_value;
    LUCY_OutStream_Write_U32_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_U32);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_i64);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_i64) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int64_t arg_value;
    LUCY_OutStream_Write_I64_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_I64);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_u64);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_u64) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    uint64_t arg_value;
    LUCY_OutStream_Write_U64_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (uint64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_U64);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_ci32);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_ci32) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int32_t arg_value;
    LUCY_OutStream_Write_CI32_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (int32_t)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_CI32);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_cu32);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_cu32) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    uint32_t arg_value;
    LUCY_OutStream_Write_CU32_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_CU32);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_ci64);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_ci64) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    int64_t arg_value;
    LUCY_OutStream_Write_CI64_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_CI64);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_cu64);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_cu64) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    uint64_t arg_value;
    LUCY_OutStream_Write_CU64_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (uint64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_CU64);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_f32);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_f32) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    float arg_value;
    LUCY_OutStream_Write_F32_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = (float)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_F32);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_write_f64);
XS_INTERNAL(XS_Lucy_Store_OutStream_write_f64) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    double arg_value;
    LUCY_OutStream_Write_F64_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, value");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "value");
    }
    arg_value = SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Write_F64);
    method(arg_self, arg_value);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_absorb);
XS_INTERNAL(XS_Lucy_Store_OutStream_absorb) {
    dXSARGS;
    SV *sv;
    lucy_OutStream* arg_self;
    lucy_InStream* arg_instream;
    LUCY_OutStream_Absorb_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, instream");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);
    sv = ST(1);
    arg_instream = (lucy_InStream*)XSBind_arg_to_cfish(aTHX_ sv, "instream", LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Absorb);
    method(arg_self, arg_instream);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_close);
XS_INTERNAL(XS_Lucy_Store_OutStream_close) {
    dXSARGS;
    lucy_OutStream* arg_self;
    LUCY_OutStream_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_OutStream_DESTROY);
XS_INTERNAL(XS_Lucy_Store_OutStream_DESTROY) {
    dXSARGS;
    lucy_OutStream* arg_self;
    LUCY_OutStream_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_OUTSTREAM, LUCY_OutStream_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_InStream_open);
XS_INTERNAL(XS_Lucy_Store_InStream_open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("file", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_InStream* arg_self;
    cfish_Obj* arg_file;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_file = (cfish_Obj*)XSBind_arg_to_cfish(aTHX_ sv, "file", CFISH_OBJ, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_InStream*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_InStream_do_open(arg_self, arg_file);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_InStream_reopen);
XS_INTERNAL(XS_Lucy_Store_InStream_reopen) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("filename", 0),
        XSBIND_PARAM("offset", 1),
        XSBIND_PARAM("len", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_InStream* arg_self;
    cfish_String* arg_filename;
    int64_t arg_offset;
    int64_t arg_len;
    LUCY_InStream_Reopen_t method;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);
    sv = ST(locations[0]);
    arg_filename = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "filename", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int64_t)SvNV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "len");
    }
    arg_len = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Reopen);
    retval = method(arg_self, arg_filename, arg_offset, arg_len);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_clone);
XS_INTERNAL(XS_Lucy_Store_InStream_clone) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Clone_t method;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Clone);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_close);
XS_INTERNAL(XS_Lucy_Store_InStream_close) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_InStream_DESTROY);
XS_INTERNAL(XS_Lucy_Store_InStream_DESTROY) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_InStream_seek);
XS_INTERNAL(XS_Lucy_Store_InStream_seek) {
    dXSARGS;
    SV *sv;
    lucy_InStream* arg_self;
    int64_t arg_target;
    LUCY_InStream_Seek_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, target");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "target");
    }
    arg_target = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Seek);
    method(arg_self, arg_target);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_InStream_tell);
XS_INTERNAL(XS_Lucy_Store_InStream_tell) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Tell_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Tell);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_length);
XS_INTERNAL(XS_Lucy_Store_InStream_length) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Length_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Length);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_refill);
XS_INTERNAL(XS_Lucy_Store_InStream_refill) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Refill_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Refill);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_InStream_fill);
XS_INTERNAL(XS_Lucy_Store_InStream_fill) {
    dXSARGS;
    SV *sv;
    lucy_InStream* arg_self;
    int64_t arg_amount;
    LUCY_InStream_Fill_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, amount");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "amount");
    }
    arg_amount = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Fill);
    method(arg_self, arg_amount);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_i8);
XS_INTERNAL(XS_Lucy_Store_InStream_read_i8) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_I8_t method;
    int8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_I8);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_u8);
XS_INTERNAL(XS_Lucy_Store_InStream_read_u8) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_U8_t method;
    uint8_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_U8);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_i32);
XS_INTERNAL(XS_Lucy_Store_InStream_read_i32) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_I32_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_I32);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_u32);
XS_INTERNAL(XS_Lucy_Store_InStream_read_u32) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_U32_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_U32);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_i64);
XS_INTERNAL(XS_Lucy_Store_InStream_read_i64) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_I64_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_I64);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_u64);
XS_INTERNAL(XS_Lucy_Store_InStream_read_u64) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_U64_t method;
    uint64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_U64);
    retval = method(arg_self);
    ST(0) = sizeof(UV) == 8 ? newSVuv((UV)retval) : newSVnv((NV)CFISH_U64_TO_DOUBLE(retval));
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_f32);
XS_INTERNAL(XS_Lucy_Store_InStream_read_f32) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_F32_t method;
    float retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_F32);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_f64);
XS_INTERNAL(XS_Lucy_Store_InStream_read_f64) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_F64_t method;
    double retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_F64);
    retval = method(arg_self);
    ST(0) = newSVnv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_ci32);
XS_INTERNAL(XS_Lucy_Store_InStream_read_ci32) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_CI32_t method;
    int32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_CI32);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_cu32);
XS_INTERNAL(XS_Lucy_Store_InStream_read_cu32) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_CU32_t method;
    uint32_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_CU32);
    retval = method(arg_self);
    ST(0) = newSVuv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_ci64);
XS_INTERNAL(XS_Lucy_Store_InStream_read_ci64) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_CI64_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_CI64);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_read_cu64);
XS_INTERNAL(XS_Lucy_Store_InStream_read_cu64) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Read_CU64_t method;
    uint64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Read_CU64);
    retval = method(arg_self);
    ST(0) = sizeof(UV) == 8 ? newSVuv((UV)retval) : newSVnv((NV)CFISH_U64_TO_DOUBLE(retval));
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_get_filename);
XS_INTERNAL(XS_Lucy_Store_InStream_get_filename) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Get_Filename_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Get_Filename);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_get_window);
XS_INTERNAL(XS_Lucy_Store_InStream_get_window) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Get_Window_t method;
    lucy_FileWindow* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Get_Window);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_get_handle);
XS_INTERNAL(XS_Lucy_Store_InStream_get_handle) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Get_Handle_t method;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Get_Handle);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_InStream_bytes_in_buf);
XS_INTERNAL(XS_Lucy_Store_InStream_bytes_in_buf) {
    dXSARGS;
    lucy_InStream* arg_self;
    LUCY_InStream_Bytes_In_Buf_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_INSTREAM, LUCY_InStream_Bytes_In_Buf);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle__open);
XS_INTERNAL(XS_Lucy_Store_FileHandle__open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("path", 0),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FileHandle* arg_self;
    cfish_String* arg_path;
    uint32_t arg_flags;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_path = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);
    arg_self = (lucy_FileHandle*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FH_do_open(arg_self, arg_path, arg_flags);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_FileHandle_window);
XS_INTERNAL(XS_Lucy_Store_FileHandle_window) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("window", 1),
        XSBIND_PARAM("offset", 1),
        XSBIND_PARAM("len", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_FileHandle* arg_self;
    lucy_FileWindow* arg_window;
    int64_t arg_offset;
    int64_t arg_len;
    LUCY_FH_Window_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);
    sv = ST(locations[0]);
    arg_window = (lucy_FileWindow*)XSBind_arg_to_cfish(aTHX_ sv, "window", LUCY_FILEWINDOW, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int64_t)SvNV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "len");
    }
    arg_len = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Window);
    retval = method(arg_self, arg_window, arg_offset, arg_len);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_release_window);
XS_INTERNAL(XS_Lucy_Store_FileHandle_release_window) {
    dXSARGS;
    SV *sv;
    lucy_FileHandle* arg_self;
    lucy_FileWindow* arg_window;
    LUCY_FH_Release_Window_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, window");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);
    sv = ST(1);
    arg_window = (lucy_FileWindow*)XSBind_arg_to_cfish(aTHX_ sv, "window", LUCY_FILEWINDOW, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Release_Window);
    retval = method(arg_self, arg_window);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_length);
XS_INTERNAL(XS_Lucy_Store_FileHandle_length) {
    dXSARGS;
    lucy_FileHandle* arg_self;
    LUCY_FH_Length_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Length);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_grow);
XS_INTERNAL(XS_Lucy_Store_FileHandle_grow) {
    dXSARGS;
    SV *sv;
    lucy_FileHandle* arg_self;
    int64_t arg_len;
    LUCY_FH_Grow_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, len");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "len");
    }
    arg_len = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Grow);
    retval = method(arg_self, arg_len);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_close);
XS_INTERNAL(XS_Lucy_Store_FileHandle_close) {
    dXSARGS;
    lucy_FileHandle* arg_self;
    LUCY_FH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_set_path);
XS_INTERNAL(XS_Lucy_Store_FileHandle_set_path) {
    dXSARGS;
    SV *sv;
    lucy_FileHandle* arg_self;
    cfish_String* arg_path;
    LUCY_FH_Set_Path_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Set_Path);
    method(arg_self, arg_path);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_get_path);
XS_INTERNAL(XS_Lucy_Store_FileHandle_get_path) {
    dXSARGS;
    lucy_FileHandle* arg_self;
    LUCY_FH_Get_Path_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Get_Path);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileHandle_DESTROY);
XS_INTERNAL(XS_Lucy_Store_FileHandle_DESTROY) {
    dXSARGS;
    lucy_FileHandle* arg_self;
    LUCY_FH_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEHANDLE, LUCY_FH_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FSFileHandle__open);
XS_INTERNAL(XS_Lucy_Store_FSFileHandle__open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("path", 0),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FSFileHandle* arg_self;
    cfish_String* arg_path;
    uint32_t arg_flags;
    lucy_FSFileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_path = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);
    arg_self = (lucy_FSFileHandle*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FSFH_do_open(arg_self, arg_path, arg_flags);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_FSFileHandle_window);
XS_INTERNAL(XS_Lucy_Store_FSFileHandle_window) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("window", 1),
        XSBIND_PARAM("offset", 1),
        XSBIND_PARAM("len", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_FSFileHandle* arg_self;
    lucy_FileWindow* arg_window;
    int64_t arg_offset;
    int64_t arg_len;
    LUCY_FSFH_Window_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_FSFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFILEHANDLE, NULL);
    sv = ST(locations[0]);
    arg_window = (lucy_FileWindow*)XSBind_arg_to_cfish(aTHX_ sv, "window", LUCY_FILEWINDOW, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int64_t)SvNV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "len");
    }
    arg_len = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFILEHANDLE, LUCY_FSFH_Window);
    retval = method(arg_self, arg_window, arg_offset, arg_len);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFileHandle_release_window);
XS_INTERNAL(XS_Lucy_Store_FSFileHandle_release_window) {
    dXSARGS;
    SV *sv;
    lucy_FSFileHandle* arg_self;
    lucy_FileWindow* arg_window;
    LUCY_FSFH_Release_Window_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, window");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFILEHANDLE, NULL);
    sv = ST(1);
    arg_window = (lucy_FileWindow*)XSBind_arg_to_cfish(aTHX_ sv, "window", LUCY_FILEWINDOW, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFILEHANDLE, LUCY_FSFH_Release_Window);
    retval = method(arg_self, arg_window);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFileHandle_length);
XS_INTERNAL(XS_Lucy_Store_FSFileHandle_length) {
    dXSARGS;
    lucy_FSFileHandle* arg_self;
    LUCY_FSFH_Length_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFILEHANDLE, LUCY_FSFH_Length);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFileHandle_close);
XS_INTERNAL(XS_Lucy_Store_FSFileHandle_close) {
    dXSARGS;
    lucy_FSFileHandle* arg_self;
    LUCY_FSFH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFILEHANDLE, LUCY_FSFH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFileHandle_set_fd);
XS_INTERNAL(XS_Lucy_Store_FSFileHandle_set_fd) {
    dXSARGS;
    SV *sv;
    lucy_FSFileHandle* arg_self;
    int arg_fd;
    LUCY_FSFH_Set_FD_t method;
    int retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, fd");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFILEHANDLE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "fd");
    }
    arg_fd = (int)SvIV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFILEHANDLE, LUCY_FSFH_Set_FD);
    retval = method(arg_self, arg_fd);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle__open);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle__open) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("path", 0),
        XSBIND_PARAM("flags", 1),
        XSBIND_PARAM("file", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RAMFileHandle* arg_self;
    cfish_String* arg_path;
    uint32_t arg_flags;
    lucy_RAMFile* arg_file;
    lucy_RAMFileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    sv = ST(locations[0]);
    arg_path = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);
    sv = ST(locations[2]);
    arg_file = locations[2] < items ? (lucy_RAMFile*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "file", LUCY_RAMFILE, NULL) : NULL;
    arg_self = (lucy_RAMFileHandle*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RAMFH_do_open(arg_self, arg_path, arg_flags, arg_file);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_get_file);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_get_file) {
    dXSARGS;
    lucy_RAMFileHandle* arg_self;
    LUCY_RAMFH_Get_File_t method;
    lucy_RAMFile* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Get_File);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_grow);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_grow) {
    dXSARGS;
    SV *sv;
    lucy_RAMFileHandle* arg_self;
    int64_t arg_len;
    LUCY_RAMFH_Grow_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, len");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "len");
    }
    arg_len = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Grow);
    retval = method(arg_self, arg_len);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_DESTROY);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_DESTROY) {
    dXSARGS;
    lucy_RAMFileHandle* arg_self;
    LUCY_RAMFH_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_window);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_window) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("window", 1),
        XSBIND_PARAM("offset", 1),
        XSBIND_PARAM("len", 1)
    };
    int32_t locations[3];
    SV *sv;
    lucy_RAMFileHandle* arg_self;
    lucy_FileWindow* arg_window;
    int64_t arg_offset;
    int64_t arg_len;
    LUCY_RAMFH_Window_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);
    sv = ST(locations[0]);
    arg_window = (lucy_FileWindow*)XSBind_arg_to_cfish(aTHX_ sv, "window", LUCY_FILEWINDOW, NULL);
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int64_t)SvNV(sv);
    sv = ST(locations[2]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "len");
    }
    arg_len = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Window);
    retval = method(arg_self, arg_window, arg_offset, arg_len);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_release_window);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_release_window) {
    dXSARGS;
    SV *sv;
    lucy_RAMFileHandle* arg_self;
    lucy_FileWindow* arg_window;
    LUCY_RAMFH_Release_Window_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, window");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);
    sv = ST(1);
    arg_window = (lucy_FileWindow*)XSBind_arg_to_cfish(aTHX_ sv, "window", LUCY_FILEWINDOW, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Release_Window);
    retval = method(arg_self, arg_window);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_length);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_length) {
    dXSARGS;
    lucy_RAMFileHandle* arg_self;
    LUCY_RAMFH_Length_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Length);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_close);
XS_INTERNAL(XS_Lucy_Store_RAMFileHandle_close) {
    dXSARGS;
    lucy_RAMFileHandle* arg_self;
    LUCY_RAMFH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFileHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFILEHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFILEHANDLE, LUCY_RAMFH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_new);
XS_INTERNAL(XS_Lucy_Store_Folder_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("path", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_Folder*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_Folder_init(arg_self, arg_path);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_Folder_DESTROY);
XS_INTERNAL(XS_Lucy_Store_Folder_DESTROY) {
    dXSARGS;
    lucy_Folder* arg_self;
    LUCY_Folder_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Folder_get_path);
XS_INTERNAL(XS_Lucy_Store_Folder_get_path) {
    dXSARGS;
    lucy_Folder* arg_self;
    LUCY_Folder_Get_Path_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Get_Path);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_set_path);
XS_INTERNAL(XS_Lucy_Store_Folder_set_path) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Set_Path_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Set_Path);
    method(arg_self, arg_path);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Folder_open_out);
XS_INTERNAL(XS_Lucy_Store_Folder_open_out) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Open_Out_t method;
    lucy_OutStream* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Open_Out);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_open_in);
XS_INTERNAL(XS_Lucy_Store_Folder_open_in) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Open_In_t method;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Open_In);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_open_filehandle);
XS_INTERNAL(XS_Lucy_Store_Folder_open_filehandle) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("path", 1),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    uint32_t arg_flags;
    LUCY_Folder_Open_FileHandle_t method;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(locations[0]);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Open_FileHandle);
    retval = method(arg_self, arg_path, arg_flags);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_open_dir);
XS_INTERNAL(XS_Lucy_Store_Folder_open_dir) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Open_Dir_t method;
    lucy_DirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [path]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Open_Dir);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_mkdir);
XS_INTERNAL(XS_Lucy_Store_Folder_mkdir) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_MkDir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_MkDir);
    retval = method(arg_self, arg_path);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_list);
XS_INTERNAL(XS_Lucy_Store_Folder_list) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_List_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [path]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_List);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_list_r);
XS_INTERNAL(XS_Lucy_Store_Folder_list_r) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_List_R_t method;
    cfish_Vector* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items < 1 || items > 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, [path]");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = 1 < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_List_R);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_exists);
XS_INTERNAL(XS_Lucy_Store_Folder_exists) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Exists_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Exists);
    retval = method(arg_self, arg_path);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_is_directory);
XS_INTERNAL(XS_Lucy_Store_Folder_is_directory) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Is_Directory_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Is_Directory);
    retval = method(arg_self, arg_path);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_delete);
XS_INTERNAL(XS_Lucy_Store_Folder_delete) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Delete_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Delete);
    retval = method(arg_self, arg_path);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_delete_tree);
XS_INTERNAL(XS_Lucy_Store_Folder_delete_tree) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Delete_Tree_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Delete_Tree);
    retval = method(arg_self, arg_path);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_rename);
XS_INTERNAL(XS_Lucy_Store_Folder_rename) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("from", 1),
        XSBIND_PARAM("to", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_from;
    cfish_String* arg_to;
    LUCY_Folder_Rename_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(locations[0]);
    arg_from = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "from", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_to = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "to", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Rename);
    retval = method(arg_self, arg_from, arg_to);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_hard_link);
XS_INTERNAL(XS_Lucy_Store_Folder_hard_link) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("from", 1),
        XSBIND_PARAM("to", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_from;
    cfish_String* arg_to;
    LUCY_Folder_Hard_Link_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(locations[0]);
    arg_from = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "from", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_to = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "to", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Hard_Link);
    retval = method(arg_self, arg_from, arg_to);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_slurp_file);
XS_INTERNAL(XS_Lucy_Store_Folder_slurp_file) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Slurp_File_t method;
    cfish_Blob* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Slurp_File);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_consolidate);
XS_INTERNAL(XS_Lucy_Store_Folder_consolidate) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Consolidate_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Consolidate);
    method(arg_self, arg_path);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Folder_enclosing_folder);
XS_INTERNAL(XS_Lucy_Store_Folder_enclosing_folder) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Enclosing_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Enclosing_Folder);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_find_folder);
XS_INTERNAL(XS_Lucy_Store_Folder_find_folder) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_path;
    LUCY_Folder_Find_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Find_Folder);
    retval = method(arg_self, arg_path);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_initialize);
XS_INTERNAL(XS_Lucy_Store_Folder_initialize) {
    dXSARGS;
    lucy_Folder* arg_self;
    LUCY_Folder_Initialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Initialize);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Folder_check);
XS_INTERNAL(XS_Lucy_Store_Folder_check) {
    dXSARGS;
    lucy_Folder* arg_self;
    LUCY_Folder_Check_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Check);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_close);
XS_INTERNAL(XS_Lucy_Store_Folder_close) {
    dXSARGS;
    lucy_Folder* arg_self;
    LUCY_Folder_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_open_filehandle);
XS_INTERNAL(XS_Lucy_Store_Folder_local_open_filehandle) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    uint32_t arg_flags;
    LUCY_Folder_Local_Open_FileHandle_t method;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Open_FileHandle);
    retval = method(arg_self, arg_name, arg_flags);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_open_in);
XS_INTERNAL(XS_Lucy_Store_Folder_local_open_in) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    LUCY_Folder_Local_Open_In_t method;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Open_In);
    retval = method(arg_self, arg_name);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_open_dir);
XS_INTERNAL(XS_Lucy_Store_Folder_local_open_dir) {
    dXSARGS;
    lucy_Folder* arg_self;
    LUCY_Folder_Local_Open_Dir_t method;
    lucy_DirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Open_Dir);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_mkdir);
XS_INTERNAL(XS_Lucy_Store_Folder_local_mkdir) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    LUCY_Folder_Local_MkDir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_MkDir);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_exists);
XS_INTERNAL(XS_Lucy_Store_Folder_local_exists) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    LUCY_Folder_Local_Exists_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Exists);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_is_directory);
XS_INTERNAL(XS_Lucy_Store_Folder_local_is_directory) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    LUCY_Folder_Local_Is_Directory_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Is_Directory);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_find_folder);
XS_INTERNAL(XS_Lucy_Store_Folder_local_find_folder) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    LUCY_Folder_Local_Find_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Find_Folder);
    retval = method(arg_self, arg_name);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_Folder_local_delete);
XS_INTERNAL(XS_Lucy_Store_Folder_local_delete) {
    dXSARGS;
    SV *sv;
    lucy_Folder* arg_self;
    cfish_String* arg_name;
    LUCY_Folder_Local_Delete_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FOLDER, LUCY_Folder_Local_Delete);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_new);
XS_INTERNAL(XS_Lucy_Store_FSFolder_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("path", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_path;
    lucy_FSFolder* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_FSFolder*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FSFolder_init(arg_self, arg_path);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_FSFolder_initialize);
XS_INTERNAL(XS_Lucy_Store_FSFolder_initialize) {
    dXSARGS;
    lucy_FSFolder* arg_self;
    LUCY_FSFolder_Initialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Initialize);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_check);
XS_INTERNAL(XS_Lucy_Store_FSFolder_check) {
    dXSARGS;
    lucy_FSFolder* arg_self;
    LUCY_FSFolder_Check_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Check);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_close);
XS_INTERNAL(XS_Lucy_Store_FSFolder_close) {
    dXSARGS;
    lucy_FSFolder* arg_self;
    LUCY_FSFolder_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_open_filehandle);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_open_filehandle) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_name;
    uint32_t arg_flags;
    LUCY_FSFolder_Local_Open_FileHandle_t method;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_Open_FileHandle);
    retval = method(arg_self, arg_name, arg_flags);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_open_dir);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_open_dir) {
    dXSARGS;
    lucy_FSFolder* arg_self;
    LUCY_FSFolder_Local_Open_Dir_t method;
    lucy_DirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_Open_Dir);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_mkdir);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_mkdir) {
    dXSARGS;
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_name;
    LUCY_FSFolder_Local_MkDir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_MkDir);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_exists);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_exists) {
    dXSARGS;
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_name;
    LUCY_FSFolder_Local_Exists_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_Exists);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_is_directory);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_is_directory) {
    dXSARGS;
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_name;
    LUCY_FSFolder_Local_Is_Directory_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_Is_Directory);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_find_folder);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_find_folder) {
    dXSARGS;
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_name;
    LUCY_FSFolder_Local_Find_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_Find_Folder);
    retval = method(arg_self, arg_name);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_local_delete);
XS_INTERNAL(XS_Lucy_Store_FSFolder_local_delete) {
    dXSARGS;
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_name;
    LUCY_FSFolder_Local_Delete_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Local_Delete);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_rename);
XS_INTERNAL(XS_Lucy_Store_FSFolder_rename) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("from", 1),
        XSBIND_PARAM("to", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_from;
    cfish_String* arg_to;
    LUCY_FSFolder_Rename_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(locations[0]);
    arg_from = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "from", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_to = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "to", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Rename);
    retval = method(arg_self, arg_from, arg_to);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSFolder_hard_link);
XS_INTERNAL(XS_Lucy_Store_FSFolder_hard_link) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("from", 1),
        XSBIND_PARAM("to", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_FSFolder* arg_self;
    cfish_String* arg_from;
    cfish_String* arg_to;
    LUCY_FSFolder_Hard_Link_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_FSFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSFOLDER, NULL);
    sv = ST(locations[0]);
    arg_from = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "from", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_to = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "to", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSFOLDER, LUCY_FSFolder_Hard_Link);
    retval = method(arg_self, arg_from, arg_to);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_new);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("path", 0)
    };
    int32_t locations[1];
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_path;
    lucy_RAMFolder* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_path = locations[0] < items ? (cfish_String*)XSBind_arg_to_cfish_nullable(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING)) : NULL;
    arg_self = (lucy_RAMFolder*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RAMFolder_init(arg_self, arg_path);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_RAMFolder_initialize);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_initialize) {
    dXSARGS;
    lucy_RAMFolder* arg_self;
    LUCY_RAMFolder_Initialize_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Initialize);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_check);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_check) {
    dXSARGS;
    lucy_RAMFolder* arg_self;
    LUCY_RAMFolder_Check_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Check);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_close);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_close) {
    dXSARGS;
    lucy_RAMFolder* arg_self;
    LUCY_RAMFolder_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_open_filehandle);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_open_filehandle) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_name;
    uint32_t arg_flags;
    LUCY_RAMFolder_Local_Open_FileHandle_t method;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_Open_FileHandle);
    retval = method(arg_self, arg_name, arg_flags);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_open_dir);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_open_dir) {
    dXSARGS;
    lucy_RAMFolder* arg_self;
    LUCY_RAMFolder_Local_Open_Dir_t method;
    lucy_DirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_Open_Dir);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_mkdir);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_mkdir) {
    dXSARGS;
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_name;
    LUCY_RAMFolder_Local_MkDir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_MkDir);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_exists);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_exists) {
    dXSARGS;
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_name;
    LUCY_RAMFolder_Local_Exists_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_Exists);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_is_directory);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_is_directory) {
    dXSARGS;
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_name;
    LUCY_RAMFolder_Local_Is_Directory_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_Is_Directory);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_find_folder);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_find_folder) {
    dXSARGS;
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_name;
    LUCY_RAMFolder_Local_Find_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_Find_Folder);
    retval = method(arg_self, arg_name);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_delete);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_local_delete) {
    dXSARGS;
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_name;
    LUCY_RAMFolder_Local_Delete_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Local_Delete);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_rename);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_rename) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("from", 1),
        XSBIND_PARAM("to", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_from;
    cfish_String* arg_to;
    LUCY_RAMFolder_Rename_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(locations[0]);
    arg_from = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "from", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_to = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "to", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Rename);
    retval = method(arg_self, arg_from, arg_to);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMFolder_hard_link);
XS_INTERNAL(XS_Lucy_Store_RAMFolder_hard_link) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("from", 1),
        XSBIND_PARAM("to", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_RAMFolder* arg_self;
    cfish_String* arg_from;
    cfish_String* arg_to;
    LUCY_RAMFolder_Hard_Link_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_RAMFolder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMFOLDER, NULL);
    sv = ST(locations[0]);
    arg_from = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "from", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_to = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "to", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMFOLDER, LUCY_RAMFolder_Hard_Link);
    retval = method(arg_self, arg_from, arg_to);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_get_real_folder);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_get_real_folder) {
    dXSARGS;
    lucy_CompoundFileReader* arg_self;
    LUCY_CFReader_Get_Real_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Get_Real_Folder);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_set_path);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_set_path) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_path;
    LUCY_CFReader_Set_Path_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, path");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_path = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "path", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Set_Path);
    method(arg_self, arg_path);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_close);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_close) {
    dXSARGS;
    lucy_CompoundFileReader* arg_self;
    LUCY_CFReader_Close_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Close);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_DESTROY);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_DESTROY) {
    dXSARGS;
    lucy_CompoundFileReader* arg_self;
    LUCY_CFReader_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_delete);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_delete) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    LUCY_CFReader_Local_Delete_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Delete);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_exists);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_exists) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    LUCY_CFReader_Local_Exists_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Exists);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_is_directory);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_is_directory) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    LUCY_CFReader_Local_Is_Directory_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Is_Directory);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_open_filehandle);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_open_filehandle) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("flags", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    uint32_t arg_flags;
    LUCY_CFReader_Local_Open_FileHandle_t method;
    lucy_FileHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "flags");
    }
    arg_flags = (uint32_t)SvUV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Open_FileHandle);
    retval = method(arg_self, arg_name, arg_flags);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_open_in);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_open_in) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    LUCY_CFReader_Local_Open_In_t method;
    lucy_InStream* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Open_In);
    retval = method(arg_self, arg_name);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_mkdir);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_mkdir) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    LUCY_CFReader_Local_MkDir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_MkDir);
    retval = method(arg_self, arg_name);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_find_folder);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_find_folder) {
    dXSARGS;
    SV *sv;
    lucy_CompoundFileReader* arg_self;
    cfish_String* arg_name;
    LUCY_CFReader_Local_Find_Folder_t method;
    lucy_Folder* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, name");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);
    sv = ST(1);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Find_Folder);
    retval = method(arg_self, arg_name);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_open_dir);
XS_INTERNAL(XS_Lucy_Store_CompoundFileReader_local_open_dir) {
    dXSARGS;
    lucy_CompoundFileReader* arg_self;
    LUCY_CFReader_Local_Open_Dir_t method;
    lucy_DirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileReader*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEREADER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEREADER, LUCY_CFReader_Local_Open_Dir);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_new);
XS_INTERNAL(XS_Lucy_Store_DirHandle_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("dir", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_DirHandle* arg_self;
    cfish_String* arg_dir;
    lucy_DirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_dir = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "dir", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_DirHandle*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_DH_init(arg_self, arg_dir);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_DirHandle_next);
XS_INTERNAL(XS_Lucy_Store_DirHandle_next) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_close);
XS_INTERNAL(XS_Lucy_Store_DirHandle_close) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_get_dir);
XS_INTERNAL(XS_Lucy_Store_DirHandle_get_dir) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Get_Dir_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Get_Dir);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_get_entry);
XS_INTERNAL(XS_Lucy_Store_DirHandle_get_entry) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Get_Entry_t method;
    cfish_String* retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Get_Entry);
    retval = method(arg_self);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_entry_is_dir);
XS_INTERNAL(XS_Lucy_Store_DirHandle_entry_is_dir) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Entry_Is_Dir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Entry_Is_Dir);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_entry_is_symlink);
XS_INTERNAL(XS_Lucy_Store_DirHandle_entry_is_symlink) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Entry_Is_Symlink_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Entry_Is_Symlink);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_DirHandle_DESTROY);
XS_INTERNAL(XS_Lucy_Store_DirHandle_DESTROY) {
    dXSARGS;
    lucy_DirHandle* arg_self;
    LUCY_DH_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_DirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_DIRHANDLE, LUCY_DH_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FSDirHandle_next);
XS_INTERNAL(XS_Lucy_Store_FSDirHandle_next) {
    dXSARGS;
    lucy_FSDirHandle* arg_self;
    LUCY_FSDH_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSDIRHANDLE, LUCY_FSDH_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSDirHandle_entry_is_dir);
XS_INTERNAL(XS_Lucy_Store_FSDirHandle_entry_is_dir) {
    dXSARGS;
    lucy_FSDirHandle* arg_self;
    LUCY_FSDH_Entry_Is_Dir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSDIRHANDLE, LUCY_FSDH_Entry_Is_Dir);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSDirHandle_entry_is_symlink);
XS_INTERNAL(XS_Lucy_Store_FSDirHandle_entry_is_symlink) {
    dXSARGS;
    lucy_FSDirHandle* arg_self;
    LUCY_FSDH_Entry_Is_Symlink_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSDIRHANDLE, LUCY_FSDH_Entry_Is_Symlink);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSDirHandle_close);
XS_INTERNAL(XS_Lucy_Store_FSDirHandle_close) {
    dXSARGS;
    lucy_FSDirHandle* arg_self;
    LUCY_FSDH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSDIRHANDLE, LUCY_FSDH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FSDirHandle_DESTROY);
XS_INTERNAL(XS_Lucy_Store_FSDirHandle_DESTROY) {
    dXSARGS;
    lucy_FSDirHandle* arg_self;
    LUCY_FSDH_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FSDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FSDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FSDIRHANDLE, LUCY_FSDH_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_new);
XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("cf_reader", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_CFReaderDirHandle* arg_self;
    lucy_CompoundFileReader* arg_cf_reader;
    lucy_CFReaderDirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_cf_reader = (lucy_CompoundFileReader*)XSBind_arg_to_cfish(aTHX_ sv, "cf_reader", LUCY_COMPOUNDFILEREADER, NULL);
    arg_self = (lucy_CFReaderDirHandle*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_CFReaderDH_init(arg_self, arg_cf_reader);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_next);
XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_next) {
    dXSARGS;
    lucy_CFReaderDirHandle* arg_self;
    LUCY_CFReaderDH_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CFReaderDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CFREADERDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CFREADERDIRHANDLE, LUCY_CFReaderDH_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_entry_is_dir);
XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_entry_is_dir) {
    dXSARGS;
    lucy_CFReaderDirHandle* arg_self;
    LUCY_CFReaderDH_Entry_Is_Dir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CFReaderDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CFREADERDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CFREADERDIRHANDLE, LUCY_CFReaderDH_Entry_Is_Dir);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_close);
XS_INTERNAL(XS_Lucy_Store_CFReaderDirHandle_close) {
    dXSARGS;
    lucy_CFReaderDirHandle* arg_self;
    LUCY_CFReaderDH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CFReaderDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_CFREADERDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_CFREADERDIRHANDLE, LUCY_CFReaderDH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_new);
XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("folder", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_RAMDirHandle* arg_self;
    lucy_RAMFolder* arg_folder;
    lucy_RAMDirHandle* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_folder = (lucy_RAMFolder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_RAMFOLDER, NULL);
    arg_self = (lucy_RAMDirHandle*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_RAMDH_init(arg_self, arg_folder);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_next);
XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_next) {
    dXSARGS;
    lucy_RAMDirHandle* arg_self;
    LUCY_RAMDH_Next_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMDIRHANDLE, LUCY_RAMDH_Next);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_entry_is_dir);
XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_entry_is_dir) {
    dXSARGS;
    lucy_RAMDirHandle* arg_self;
    LUCY_RAMDH_Entry_Is_Dir_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMDIRHANDLE, LUCY_RAMDH_Entry_Is_Dir);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_entry_is_symlink);
XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_entry_is_symlink) {
    dXSARGS;
    lucy_RAMDirHandle* arg_self;
    LUCY_RAMDH_Entry_Is_Symlink_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMDIRHANDLE, LUCY_RAMDH_Entry_Is_Symlink);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_close);
XS_INTERNAL(XS_Lucy_Store_RAMDirHandle_close) {
    dXSARGS;
    lucy_RAMDirHandle* arg_self;
    LUCY_RAMDH_Close_t method;
    bool retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_RAMDirHandle*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_RAMDIRHANDLE, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_RAMDIRHANDLE, LUCY_RAMDH_Close);
    retval = method(arg_self);
    ST(0) = newSViv(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileWriter_new);
XS_INTERNAL(XS_Lucy_Store_CompoundFileWriter_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("folder", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_CompoundFileWriter* arg_self;
    lucy_Folder* arg_folder;
    lucy_CompoundFileWriter* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    arg_self = (lucy_CompoundFileWriter*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_CFWriter_init(arg_self, arg_folder);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_CompoundFileWriter_consolidate);
XS_INTERNAL(XS_Lucy_Store_CompoundFileWriter_consolidate) {
    dXSARGS;
    lucy_CompoundFileWriter* arg_self;
    LUCY_CFWriter_Consolidate_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEWRITER, LUCY_CFWriter_Consolidate);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_CompoundFileWriter_DESTROY);
XS_INTERNAL(XS_Lucy_Store_CompoundFileWriter_DESTROY) {
    dXSARGS;
    lucy_CompoundFileWriter* arg_self;
    LUCY_CFWriter_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_CompoundFileWriter*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_COMPOUNDFILEWRITER, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_COMPOUNDFILEWRITER, LUCY_CFWriter_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FileWindow_new);
XS_INTERNAL(XS_Lucy_Store_FileWindow_new) {
    dXSARGS;
    lucy_FileWindow* arg_self;
    lucy_FileWindow* retval;

    CFISH_UNUSED_VAR(cv);
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    arg_self = (lucy_FileWindow*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_FileWindow_init(arg_self);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_FileWindow_set_offset);
XS_INTERNAL(XS_Lucy_Store_FileWindow_set_offset) {
    dXSARGS;
    SV *sv;
    lucy_FileWindow* arg_self;
    int64_t arg_offset;
    LUCY_FileWindow_Set_Offset_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 2) {
        XSBind_invalid_args_error(aTHX_ cv, "self, offset");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileWindow*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEWINDOW, NULL);
    sv = ST(1);
    if (!XSBind_sv_defined(aTHX_ sv)) {
        XSBind_undef_arg_error(aTHX_ "offset");
    }
    arg_offset = (int64_t)SvNV(sv);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEWINDOW, LUCY_FileWindow_Set_Offset);
    method(arg_self, arg_offset);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_FileWindow_get_offset);
XS_INTERNAL(XS_Lucy_Store_FileWindow_get_offset) {
    dXSARGS;
    lucy_FileWindow* arg_self;
    LUCY_FileWindow_Get_Offset_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileWindow*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEWINDOW, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEWINDOW, LUCY_FileWindow_Get_Offset);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_FileWindow_get_len);
XS_INTERNAL(XS_Lucy_Store_FileWindow_get_len) {
    dXSARGS;
    lucy_FileWindow* arg_self;
    LUCY_FileWindow_Get_Len_t method;
    int64_t retval;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_FileWindow*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FILEWINDOW, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_FILEWINDOW, LUCY_FileWindow_Get_Len);
    retval = method(arg_self);
    ST(0) = sizeof(IV) == 8 ? newSViv((IV)retval) : newSVnv((NV)retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFactory_new);
XS_INTERNAL(XS_Lucy_Store_LockFactory_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("folder", 1),
        XSBIND_PARAM("host", 1)
    };
    int32_t locations[2];
    SV *sv;
    lucy_LockFactory* arg_self;
    lucy_Folder* arg_folder;
    cfish_String* arg_host;
    lucy_LockFactory* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 2);
    sv = ST(locations[0]);
    arg_folder = (lucy_Folder*)XSBind_arg_to_cfish(aTHX_ sv, "folder", LUCY_FOLDER, NULL);
    sv = ST(locations[1]);
    arg_host = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "host", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_LockFactory*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LockFact_init(arg_self, arg_folder, arg_host);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}


XS_INTERNAL(XS_Lucy_Store_LockFactory_make_lock);
XS_INTERNAL(XS_Lucy_Store_LockFactory_make_lock) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("timeout", 0),
        XSBIND_PARAM("interval", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_LockFactory* arg_self;
    cfish_String* arg_name;
    int32_t arg_timeout;
    int32_t arg_interval;
    LUCY_LockFact_Make_Lock_t method;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_LockFactory*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFACTORY, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_timeout = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    sv = ST(locations[2]);
    arg_interval = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 100;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFACTORY, LUCY_LockFact_Make_Lock);
    retval = method(arg_self, arg_name, arg_timeout, arg_interval);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFactory_make_shared_lock);
XS_INTERNAL(XS_Lucy_Store_LockFactory_make_shared_lock) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("name", 1),
        XSBIND_PARAM("timeout", 0),
        XSBIND_PARAM("interval", 0)
    };
    int32_t locations[3];
    SV *sv;
    lucy_LockFactory* arg_self;
    cfish_String* arg_name;
    int32_t arg_timeout;
    int32_t arg_interval;
    LUCY_LockFact_Make_Shared_Lock_t method;
    lucy_Lock* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self, ...");
    }
    SP -= items;

    /* Locate args on Perl stack. */
    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 3);
    arg_self = (lucy_LockFactory*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFACTORY, NULL);
    sv = ST(locations[0]);
    arg_name = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "name", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    sv = ST(locations[1]);
    arg_timeout = locations[1] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 0;
    sv = ST(locations[2]);
    arg_interval = locations[2] < items && XSBind_sv_defined(aTHX_ sv)
             ? (int32_t)SvIV(sv) : 100;

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFACTORY, LUCY_LockFact_Make_Shared_Lock);
    retval = method(arg_self, arg_name, arg_timeout, arg_interval);
    ST(0) = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)retval);
    CFISH_DECREF(retval);
    sv_2mortal( ST(0) );
    XSRETURN(1);
}

XS_INTERNAL(XS_Lucy_Store_LockFactory_DESTROY);
XS_INTERNAL(XS_Lucy_Store_LockFactory_DESTROY) {
    dXSARGS;
    lucy_LockFactory* arg_self;
    LUCY_LockFact_Destroy_t method;

    CFISH_UNUSED_VAR(cv);
    SP -= items;
    if (items != 1) {
        XSBind_invalid_args_error(aTHX_ cv, "self");
    }

    /* Extract vars from Perl stack. */
    arg_self = (lucy_LockFactory*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_LOCKFACTORY, NULL);

    /* Execute */
    method = CFISH_METHOD_PTR(LUCY_LOCKFACTORY, LUCY_LockFact_Destroy);
    method(arg_self);
    XSRETURN(0);
}

XS_INTERNAL(XS_Lucy_Store_LockErr_new);
XS_INTERNAL(XS_Lucy_Store_LockErr_new) {
    dXSARGS;
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("message", 1)
    };
    int32_t locations[1];
    SV *sv;
    lucy_LockErr* arg_self;
    cfish_String* arg_message;
    lucy_LockErr* retval;

    CFISH_UNUSED_VAR(cv);
    if (items < 1) {
        XSBind_invalid_args_error(aTHX_ cv, "class_name, ...");
    }
    SP -= items;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs,
                       locations, 1);
    sv = ST(locations[0]);
    arg_message = (cfish_String*)XSBind_arg_to_cfish(aTHX_ sv, "message", CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING));
    arg_self = (lucy_LockErr*)XSBind_new_blank_obj(aTHX_ ST(0));

    retval = lucy_LockErr_init(arg_self, arg_message);
    ST(0) = sv_2mortal(CFISH_OBJ_TO_SV_NOINC(retval));
    XSRETURN(1);
}



#line 39989 "lib/Lucy.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
	    Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

#line 40133 "lib/Lucy.c"

XS_EUPXS(XS_Lucy__dummy_function); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__dummy_function)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	IV	RETVAL;
	dXSTARG;
#line 41594 "lib/Lucy.xs"
    RETVAL = 1;
#line 40146 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy_STORABLE_freeze); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy_STORABLE_freeze)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "self, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	cfish_Obj *    self = (cfish_Obj*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), CFISH_OBJ, NULL)
;
#line 41602 "lib/Lucy.xs"
{
    CFISH_UNUSED_VAR(self);
    if (items < 2 || !SvTRUE(ST(1))) {
        SV *retval;
        cfish_ByteBuf *serialized_bb;
        lucy_RAMFileHandle *file_handle
            = lucy_RAMFH_open(NULL, LUCY_FH_WRITE_ONLY | LUCY_FH_CREATE, NULL);
        lucy_OutStream *target = lucy_OutStream_open((cfish_Obj*)file_handle);

        lucy_Freezer_serialize(self, target);

        LUCY_OutStream_Close(target);
        serialized_bb
            = LUCY_RAMFile_Get_Contents(LUCY_RAMFH_Get_File(file_handle));
        retval = (SV*)CFISH_BB_To_Host(serialized_bb, NULL);
        CFISH_DECREF(file_handle);
        CFISH_DECREF(target);

        if (SvCUR(retval) == 0) { // Thwart Storable bug
            THROW(CFISH_ERR, "Calling serialize produced an empty string");
        }
        ST(0) = sv_2mortal(retval);
        XSRETURN(1);
    }
}
#line 40191 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy_STORABLE_thaw); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy_STORABLE_thaw)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "blank_obj, cloning, serialized_sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	blank_obj = ST(0)
;
	SV *	cloning = ST(1)
;
	SV *	serialized_sv = ST(2)
;
#line 41643 "lib/Lucy.xs"
{
    char *class_name = HvNAME(SvSTASH(SvRV(blank_obj)));
    cfish_String *class_name_str = CFISH_SSTR_WRAP_C(class_name);
    cfish_Class *klass = cfish_Class_singleton(class_name_str, NULL);
    STRLEN len;
    char *ptr = SvPV(serialized_sv, len);
    cfish_ByteBuf *contents = cfish_BB_new_bytes(ptr, len);
    lucy_RAMFile *ram_file = lucy_RAMFile_new(contents, true);
    lucy_RAMFileHandle *file_handle
        = lucy_RAMFH_open(NULL, LUCY_FH_READ_ONLY, ram_file);
    lucy_InStream *instream = lucy_InStream_open((cfish_Obj*)file_handle);
    cfish_Obj *self = XSBind_foster_obj(aTHX_ blank_obj, klass);
    cfish_Obj *deserialized = lucy_Freezer_deserialize(self, instream);

    CFISH_UNUSED_VAR(cloning);
    CFISH_DECREF(contents);
    CFISH_DECREF(ram_file);
    CFISH_DECREF(file_handle);
    CFISH_DECREF(instream);

    // Catch bad deserialize() override.
    if (deserialized != self) {
        THROW(CFISH_ERR, "Error when deserializing obj of class %o", klass);
    }
}
#line 40239 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Analysis__Inversion_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Analysis__Inversion_new)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
	SV *	RETVAL;
#line 41674 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("text", false)
    };
    int32_t     locations[1];
    SV         *text_sv       = NULL;
    lucy_Token *starter_token = NULL;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 1);

    text_sv = locations[0] < items ? ST(locations[0]) : NULL;
    if (XSBind_sv_defined(aTHX_ text_sv)) {
        STRLEN len;
        char *text = SvPVutf8(text_sv, len);
        STRLEN length = utf8_length((U8*)text, (U8*)text + len);
        starter_token = lucy_Token_new(text, len, 0, length, 1.0, 1);
    }

    RETVAL = CFISH_OBJ_TO_SV_NOINC(lucy_Inversion_new(starter_token));
    CFISH_DECREF(starter_token);
}
#line 40276 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Analysis__Token_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Analysis__Token_new)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "either_sv, ...");
    {
	SV *	either_sv = ST(0)
;
	SV *	RETVAL;
#line 41703 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[5] = {
        XSBIND_PARAM("text", true),
        XSBIND_PARAM("start_offset", true),
        XSBIND_PARAM("end_offset", true),
        XSBIND_PARAM("pos_inc", false),
        XSBIND_PARAM("boost", false)
    };
    int32_t     locations[5];
    uint32_t    start_off = 0;
    uint32_t    end_off   = 0;
    int32_t     pos_inc   = 1;
    float       boost     = 1.0f;
    STRLEN      len       = 0;
    char       *text      = NULL;
    lucy_Token *self      = NULL;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 5);

    text      = SvPVutf8(ST(locations[0]), len);
    start_off = (uint32_t)SvUV(ST(locations[1]));
    end_off   = (uint32_t)SvUV(ST(locations[2]));
    pos_inc   = locations[3] < items ? (int32_t)SvIV(ST(locations[3])) : 1;
    boost     = locations[4] < items ? (float)SvNV(ST(locations[4])) : 1.0f;

    self = (lucy_Token*)XSBind_new_blank_obj(aTHX_ either_sv);
    lucy_Token_init(self, text, len, start_off, end_off, boost,
                    pos_inc);
    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
}
#line 40325 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Analysis__Token_get_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Analysis__Token_get_text)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "self");
    {
	lucy_Token *    self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL)
;
	SV *	RETVAL;
#line 41739 "lib/Lucy.xs"
    RETVAL = newSVpvn(LUCY_Token_Get_Text(self), LUCY_Token_Get_Len(self));
    SvUTF8_on(RETVAL);
#line 40346 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Analysis__Token_set_text); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Analysis__Token_set_text)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "self, sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_Token *    self = (lucy_Token*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_TOKEN, NULL)
;
	SV *	sv = ST(1)
;
#line 41748 "lib/Lucy.xs"
{
    STRLEN len;
    char *ptr = SvPVutf8(sv, len);
    LUCY_Token_Set_Text(self, ptr, len);
}
#line 40373 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Document__Doc_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Document__Doc_new)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "either_sv, ...");
    {
	SV *	either_sv = ST(0)
;
	SV *	RETVAL;
#line 41760 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("fields", false),
        XSBIND_PARAM("doc_id", false)
    };
    int32_t   locations[2];
    SV*       fields_sv = NULL;
    HV       *fields    = NULL;
    int32_t   doc_id    = 0;
    lucy_Doc *self      = NULL;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 2);

    fields_sv = locations[0] < items ? ST(locations[0]) : NULL;
    doc_id    = locations[1] < items ? (int32_t)SvIV(ST(locations[1])) : 0;

    if (fields_sv && XSBind_sv_defined(aTHX_ fields_sv)) {
        if (SvROK(fields_sv)) {
            fields = (HV*)SvRV(fields_sv);
        }
        if (!fields || SvTYPE((SV*)fields) != SVt_PVHV) {
            CFISH_THROW(CFISH_ERR, "fields is not a hashref");
        }
    }

    self = (lucy_Doc*)XSBind_new_blank_obj(aTHX_ either_sv);
    lucy_Doc_init(self, fields, doc_id);
    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
}
#line 40420 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Document__Doc_store); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Document__Doc_store)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "self, field, value_sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_Doc *    self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL)
;
	cfish_String *    field = (cfish_String*)XSBind_perl_to_cfish_noinc(aTHX_ ST(1), CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING))
;
	SV *	value_sv = ST(2)
;
#line 41797 "lib/Lucy.xs"
{
    cfish_Obj *value
        = (cfish_Obj*)XSBind_perl_to_cfish(aTHX_ value_sv, CFISH_OBJ);
    LUCY_Doc_Store(self, field, value);
    CFISH_DECREF(value);
}
#line 40450 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Document__Doc_get_fields); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Document__Doc_get_fields)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "self, ...");
    {
	lucy_Doc *    self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL)
;
	SV *	RETVAL;
#line 41808 "lib/Lucy.xs"
    CFISH_UNUSED_VAR(items);
    RETVAL = newRV_inc((SV*)LUCY_Doc_Get_Fields(self));
#line 40470 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Document__Doc_set_fields); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Document__Doc_set_fields)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "self, fields");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_Doc *    self = (lucy_Doc*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_DOC, NULL)
;
	HV *	fields;

	STMT_START {
		SV* const xsub_tmp_sv = ST(1);
		SvGETMAGIC(xsub_tmp_sv);
		if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv)) == SVt_PVHV){
		    fields = (HV*)SvRV(xsub_tmp_sv);
		}
		else{
		    Perl_croak_nocontext("%s: %s is not a HASH reference",
				"Lucy::Document::Doc::set_fields",
				"fields");
		}
	} STMT_END
;
#line 41817 "lib/Lucy.xs"
    LUCY_Doc_Set_Fields_IMP(self, fields);
#line 40506 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Document__HitDoc_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Document__HitDoc_new)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "either_sv, ...");
    {
	SV *	either_sv = ST(0)
;
	SV *	RETVAL;
#line 41825 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[3] = {
        XSBIND_PARAM("fields", false),
        XSBIND_PARAM("doc_id", false),
        XSBIND_PARAM("score", false)
    };
    int32_t      locations[3];
    SV          *fields_sv = NULL;
    HV          *fields    = NULL;
    int32_t      doc_id    = 0;
    float        score     = 0.0f;
    lucy_HitDoc *self      = NULL;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 3);

    fields_sv = locations[0] < items ? ST(locations[0]) : NULL;
    doc_id    = locations[1] < items ? (int32_t)SvIV(ST(locations[1])) : 0;
    score     = locations[2] < items ? (float)SvNV(ST(locations[2])) : 0.0f;

    if (fields_sv && XSBind_sv_defined(aTHX_ fields_sv)) {
        if (SvROK(fields_sv)) {
            fields = (HV*)SvRV(fields_sv);
        }
        if (!fields || SvTYPE((SV*)fields) != SVt_PVHV) {
            CFISH_THROW(CFISH_ERR, "fields is not a hashref");
        }
    }

    self = (lucy_HitDoc*)XSBind_new_blank_obj(aTHX_ either_sv);
    lucy_HitDoc_init(self, fields, doc_id, score);
    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
}
#line 40556 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__IndexReader_set_race_condition_debug1); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__IndexReader_set_race_condition_debug1)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "val_sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	val_sv = ST(0)
;
#line 41865 "lib/Lucy.xs"
    CFISH_DECREF(lucy_PolyReader_race_condition_debug1);
    lucy_PolyReader_race_condition_debug1 = (cfish_String*)
        XSBind_perl_to_cfish_nullable(aTHX_ val_sv, CFISH_STRING);
#line 40579 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Index__IndexReader_debug1_num_passes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__IndexReader_debug1_num_passes)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int32_t	RETVAL;
	dXSTARG;
#line 41872 "lib/Lucy.xs"
    RETVAL = lucy_PolyReader_debug1_num_passes;
#line 40597 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__Indexer_CREATE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__Indexer_CREATE)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
	int32_t	RETVAL;
	dXSTARG;
#line 41880 "lib/Lucy.xs"
    CFISH_UNUSED_VAR(items);
    RETVAL = lucy_Indexer_CREATE;
#line 40617 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__Indexer_TRUNCATE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__Indexer_TRUNCATE)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
	int32_t	RETVAL;
	dXSTARG;
#line 41887 "lib/Lucy.xs"
    CFISH_UNUSED_VAR(items);
    RETVAL = lucy_Indexer_TRUNCATE;
#line 40637 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__Indexer_add_doc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__Indexer_add_doc)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "self, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_Indexer *    self = (lucy_Indexer*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INDEXER, NULL)
;
#line 41895 "lib/Lucy.xs"
{
    lucy_Doc *doc = NULL;
    SV *doc_sv = NULL;
    float boost = 1.0;

    if (items == 2) {
        doc_sv = ST(1);
    }
    else {
        static const XSBind_ParamSpec param_specs[2] = {
            XSBIND_PARAM("doc", true),
            XSBIND_PARAM("boost", false)
        };
        int32_t locations[2];

        XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 2);

        doc_sv = ST(locations[0]);
        if (locations[1] < items) { boost = (float)SvNV(ST(locations[1])); }
    }

    // Either get a Doc or use the stock doc.
    if (sv_isobject(doc_sv)
        && sv_derived_from(doc_sv, "Lucy::Document::Doc")
       ) {
        IV tmp = SvIV(SvRV(doc_sv));
        doc = INT2PTR(lucy_Doc*, tmp);
    }
    else if (XSBind_sv_defined(aTHX_ doc_sv) && SvROK(doc_sv)) {
        HV *maybe_fields = (HV*)SvRV(doc_sv);
        if (SvTYPE((SV*)maybe_fields) == SVt_PVHV) {
            doc = LUCY_Indexer_Get_Stock_Doc(self);
            LUCY_Doc_Set_Fields(doc, maybe_fields);
        }
    }
    if (!doc) {
        THROW(CFISH_ERR, "Need either a hashref or a %o",
              CFISH_Class_Get_Name(LUCY_DOC));
    }

    LUCY_Indexer_Add_Doc(self, doc, boost);
}
#line 40699 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Index__PolyReader_sub_tick); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__PolyReader_sub_tick)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "offsets, doc_id");
    {
	lucy_I32Array *    offsets = (lucy_I32Array*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_I32ARRAY, NULL)
;
	int32_t    doc_id = (int32_t)SvIV(ST(1))
;
	uint32_t	RETVAL;
	dXSTARG;
#line 41945 "lib/Lucy.xs"
    RETVAL = lucy_PolyReader_sub_tick(offsets, doc_id);
#line 40721 "lib/Lucy.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__Posting__ScorePosting_get_prox); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__Posting__ScorePosting_get_prox)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "self");
    {
	lucy_ScorePosting *    self = (lucy_ScorePosting*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SCOREPOSTING, NULL)
;
	SV *	RETVAL;
#line 41955 "lib/Lucy.xs"
{
    AV *out_av            = newAV();
    uint32_t *positions  = LUCY_ScorePost_Get_Prox(self);
    uint32_t i, max;

    for (i = 0, max = LUCY_ScorePost_Get_Freq(self); i < max; i++) {
        SV *pos_sv = newSVuv(positions[i]);
        av_push(out_av, pos_sv);
    }

    RETVAL = newRV_noinc((SV*)out_av);
}
#line 40752 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__PostingListWriter_set_default_mem_thresh); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__PostingListWriter_set_default_mem_thresh)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mem_thresh");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	uint32_t    mem_thresh = (uint32_t)SvUV(ST(0))
;
#line 41975 "lib/Lucy.xs"
    lucy_PListWriter_set_default_mem_thresh(mem_thresh);
#line 40773 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Index__Similarity_get_norm_decoder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__Similarity_get_norm_decoder)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "self");
    {
	lucy_Similarity *    self = (lucy_Similarity*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMILARITY, NULL)
;
	SV *	RETVAL;
#line 41983 "lib/Lucy.xs"
    RETVAL = newSVpvn((char*)LUCY_Sim_Get_Norm_Decoder(self),
                      (256 * sizeof(float)));
#line 40793 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__SortCache_value); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__SortCache_value)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "self, ...");
    {
	lucy_SortCache *    self = (lucy_SortCache*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SORTCACHE, NULL)
;
	SV *	RETVAL;
#line 41993 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("ord", false)
    };
    int32_t locations[1];
    int32_t ord = 0;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 1);

    ord = locations[0] < items ? (int32_t)SvIV(ST(locations[0])) : 0;

    {
        cfish_Obj *value = LUCY_SortCache_Value(self, ord);
        RETVAL = XSBind_cfish_to_perl(aTHX_ value);
        CFISH_DECREF(value);
    }
}
#line 40829 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Index__SortWriter_set_default_mem_thresh); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Index__SortWriter_set_default_mem_thresh)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mem_thresh");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	size_t	mem_thresh = (size_t)SvUV(ST(0))
;
#line 42018 "lib/Lucy.xs"
    lucy_SortWriter_set_default_mem_thresh(mem_thresh);
#line 40850 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}

#include "Clownfish/Util/Memory.h"

XS_EUPXS(XS_Lucy__Object__I32Array_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Object__I32Array_new)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "either_sv, ...");
    {
	SV *	either_sv = ST(0)
;
	SV *	RETVAL;
#line 42028 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[1] = {
        XSBIND_PARAM("ints", true)
    };
    int32_t        locations[1];
    SV            *ints_sv = NULL;
    AV            *ints_av = NULL;
    lucy_I32Array *self    = NULL;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 1);

    ints_sv = ST(locations[0]);
    if (SvROK(ints_sv)) {
        ints_av = (AV*)SvRV(ints_sv);
    }
    if (ints_av && SvTYPE(ints_av) == SVt_PVAV) {
        int64_t size = av_len(ints_av) + 1;
        int32_t *ints;
        int64_t i;
        if (size < 0 || size > INT32_MAX) {
            THROW(CFISH_ERR, "Size out of range: %i64", size);
        }
        ints = (int32_t*)CFISH_MALLOCATE(size * sizeof(int32_t));

        for (i = 0; i < size; i++) {
            SV **const sv_ptr = av_fetch(ints_av, (I32)i, 0);
            ints[i] = (sv_ptr && XSBind_sv_defined(aTHX_ *sv_ptr))
                      ? SvIV(*sv_ptr)
                      : 0;
        }
        self = (lucy_I32Array*)XSBind_new_blank_obj(aTHX_ either_sv);
        lucy_I32Arr_init(self, ints, (size_t)size);
    }
    else {
        THROW(CFISH_ERR, "Required param 'ints' isn't an arrayref");
    }

    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
}
#line 40908 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Object__I32Array_to_arrayref); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Object__I32Array_to_arrayref)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "self");
    {
	lucy_I32Array *    self = (lucy_I32Array*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_I32ARRAY, NULL)
;
	SV *	RETVAL;
#line 42073 "lib/Lucy.xs"
{
    AV *out_av = newAV();
    size_t i;
    size_t size = LUCY_I32Arr_Get_Size(self);

    av_extend(out_av, size);
    for (i = 0; i < size; i++) {
        int32_t result = LUCY_I32Arr_Get(self, i);
        SV* result_sv = result == -1 ? newSV(0) : newSViv(result);
        av_push(out_av, result_sv);
    }
    RETVAL = newRV_noinc((SV*)out_av);
}
#line 40940 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Search__QueryParser__ParserElem_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Search__QueryParser__ParserElem_new)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "either_sv, ...");
    {
	SV *	either_sv = ST(0)
;
	SV *	RETVAL;
#line 42094 "lib/Lucy.xs"
{
    static const XSBind_ParamSpec param_specs[2] = {
        XSBIND_PARAM("type", true),
        XSBIND_PARAM("value", false)
    };
    int32_t          locations[2];
    SV              *type_sv  = NULL;
    SV              *value_sv = NULL;
    const char      *type_str = NULL;
    cfish_Obj       *value    = NULL;
    uint32_t         type     = 0;
    lucy_ParserElem *self     = NULL;

    XSBind_locate_args(aTHX_ &ST(0), 1, items, param_specs, locations, 2);

    type_sv  = ST(locations[0]);
    value_sv = locations[1] < items ? ST(locations[1]) : NULL;

    type_str = SvPVutf8_nolen(type_sv);

    if (strcmp(type_str, "OPEN_PAREN") == 0) {
        type = LUCY_QPARSER_TOKEN_OPEN_PAREN; 
    }
    else if (strcmp(type_str, "CLOSE_PAREN") == 0) {
        type = LUCY_QPARSER_TOKEN_CLOSE_PAREN; 
    }
    else if (strcmp(type_str, "MINUS") == 0) {
        type = LUCY_QPARSER_TOKEN_MINUS; 
    }
    else if (strcmp(type_str, "PLUS") == 0) {
        type = LUCY_QPARSER_TOKEN_PLUS; 
    }
    else if (strcmp(type_str, "NOT") == 0) {
        type = LUCY_QPARSER_TOKEN_NOT; 
    }
    else if (strcmp(type_str, "AND") == 0) {
        type = LUCY_QPARSER_TOKEN_AND; 
    }
    else if (strcmp(type_str, "OR") == 0) {
        type = LUCY_QPARSER_TOKEN_OR; 
    }
    else if (strcmp(type_str, "FIELD") == 0) {
        type = LUCY_QPARSER_TOKEN_FIELD; 
        value = XSBind_perl_to_cfish(aTHX_ value_sv, CFISH_STRING);
    }
    else if (strcmp(type_str, "STRING") == 0) {
        type = LUCY_QPARSER_TOKEN_STRING; 
        value = XSBind_perl_to_cfish(aTHX_ value_sv, CFISH_STRING);
    }
    else if (strcmp(type_str, "QUERY") == 0) {
        type = LUCY_QPARSER_TOKEN_QUERY; 
        value = XSBind_perl_to_cfish(aTHX_ value_sv, LUCY_QUERY);
    }
    else {
        CFISH_THROW(CFISH_ERR, "Bad type: '%s'", type_str);
    }

    self = (lucy_ParserElem*)XSBind_new_blank_obj(aTHX_ either_sv);
    self = lucy_ParserElem_init(self, type, value);
    RETVAL = XSBind_cfish_to_perl(aTHX_ (cfish_Obj*)self);
    CFISH_DECREF(self);
}
#line 41021 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Search__SortRule_FIELD); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Search__SortRule_FIELD)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int32_t	RETVAL;
	dXSTARG;
#line 42164 "lib/Lucy.xs"
    RETVAL = lucy_SortRule_FIELD;
#line 41040 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Search__SortRule_SCORE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Search__SortRule_SCORE)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int32_t	RETVAL;
	dXSTARG;
#line 42170 "lib/Lucy.xs"
    RETVAL = lucy_SortRule_SCORE;
#line 41059 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Search__SortRule_DOC_ID); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Search__SortRule_DOC_ID)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int32_t	RETVAL;
	dXSTARG;
#line 42176 "lib/Lucy.xs"
    RETVAL = lucy_SortRule_DOC_ID;
#line 41078 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Simple_add_doc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Simple_add_doc)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "self, doc_sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_Simple *    self = (lucy_Simple*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_SIMPLE, NULL)
;
	SV *	doc_sv = ST(1)
;
#line 42186 "lib/Lucy.xs"
{
    lucy_Doc *doc = NULL;

    // Either get a Doc or use the stock doc.
    if (sv_isobject(doc_sv)
        && sv_derived_from(doc_sv, "Lucy::Document::Doc")
       ) {
        IV tmp = SvIV(SvRV(doc_sv));
        doc = INT2PTR(lucy_Doc*, tmp);
    }
    else if (XSBind_sv_defined(aTHX_ doc_sv) && SvROK(doc_sv)) {
        HV *maybe_fields = (HV*)SvRV(doc_sv);
        if (SvTYPE((SV*)maybe_fields) == SVt_PVHV) {
            lucy_Indexer *indexer = LUCY_Simple_Get_Indexer(self);
            doc = LUCY_Indexer_Get_Stock_Doc(indexer);
            LUCY_Doc_Set_Fields(doc, maybe_fields);
        }
    }
    if (!doc) {
        THROW(CFISH_ERR, "Need either a hashref or a %o",
              CFISH_Class_Get_Name(LUCY_DOC));
    }

    LUCY_Simple_Add_Doc(self, doc);
}
#line 41125 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Store__FileHandle_FH_READ_ONLY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__FileHandle_FH_READ_ONLY)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	uint32_t	RETVAL;
	dXSTARG;
#line 42223 "lib/Lucy.xs"
    RETVAL = LUCY_FH_READ_ONLY;
#line 41143 "lib/Lucy.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__FileHandle_FH_WRITE_ONLY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__FileHandle_FH_WRITE_ONLY)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	uint32_t	RETVAL;
	dXSTARG;
#line 42229 "lib/Lucy.xs"
    RETVAL = LUCY_FH_WRITE_ONLY;
#line 41162 "lib/Lucy.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__FileHandle_FH_CREATE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__FileHandle_FH_CREATE)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	uint32_t	RETVAL;
	dXSTARG;
#line 42235 "lib/Lucy.xs"
    RETVAL = LUCY_FH_CREATE;
#line 41181 "lib/Lucy.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__FileHandle_FH_EXCLUSIVE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__FileHandle_FH_EXCLUSIVE)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	uint32_t	RETVAL;
	dXSTARG;
#line 42241 "lib/Lucy.xs"
    RETVAL = LUCY_FH_EXCLUSIVE;
#line 41200 "lib/Lucy.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__FileHandle_object_count); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__FileHandle_object_count)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int32_t	RETVAL;
	dXSTARG;
#line 42248 "lib/Lucy.xs"
    RETVAL = lucy_FH_object_count;
#line 41219 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__FileHandle__BUF_SIZE); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__FileHandle__BUF_SIZE)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	IV	RETVAL;
	dXSTARG;
#line 42260 "lib/Lucy.xs"
   RETVAL = LUCY_IO_STREAM_BUF_SIZE;
#line 41238 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__InStream_read); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__InStream_read)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "self, buffer_sv, len, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_InStream *    self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL)
;
	SV *	buffer_sv = ST(1)
;
	size_t	len = (size_t)SvUV(ST(2))
;
#line 42271 "lib/Lucy.xs"
{
    UV offset = items == 4 ? SvUV(ST(3)) : 0;
    char *ptr;
    size_t total_len = offset + len;
    (void)SvUPGRADE(buffer_sv, SVt_PV);
    if (!SvPOK(buffer_sv)) { SvCUR_set(buffer_sv, 0); }
    ptr = SvGROW(buffer_sv, total_len + 1);
    LUCY_InStream_Read_Bytes(self, ptr + offset, len);
    SvPOK_on(buffer_sv);
    if (SvCUR(buffer_sv) < total_len) {
        SvCUR_set(buffer_sv, total_len);
        *(SvEND(buffer_sv)) = '\0';
    }
}
#line 41276 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Store__InStream_read_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__InStream_read_string)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "self");
    {
	lucy_InStream *    self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL)
;
	SV *	RETVAL;
#line 42290 "lib/Lucy.xs"
{
    char *ptr;
    size_t len = LUCY_InStream_Read_CU32(self);
    RETVAL = newSV(len + 1);
    SvCUR_set(RETVAL, len);
    SvPOK_on(RETVAL);
    SvUTF8_on(RETVAL); // Trust source.  Reconsider if API goes public.
    *SvEND(RETVAL) = '\0';
    ptr = SvPVX(RETVAL);
    LUCY_InStream_Read_Bytes(self, ptr, len);
}
#line 41305 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__InStream_read_raw_c64); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__InStream_read_raw_c64)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "self, buffer_sv");
    {
	lucy_InStream *    self = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL)
;
	SV *	buffer_sv = ST(1)
;
	int	RETVAL;
	dXSTARG;
#line 42308 "lib/Lucy.xs"
{
    char *ptr;
    (void)SvUPGRADE(buffer_sv, SVt_PV);
    ptr = SvGROW(buffer_sv, 10 + 1);
    RETVAL = LUCY_InStream_Read_Raw_C64(self, ptr);
    SvPOK_on(buffer_sv);
    SvCUR_set(buffer_sv, RETVAL);
}
#line 41335 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Store__OutStream_print); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__OutStream_print)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "self, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_OutStream *    self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL)
;
#line 42324 "lib/Lucy.xs"
{
    int i;
    for (i = 1; i < items; i++) {
        STRLEN len;
        char *ptr = SvPV(ST(i), len);
        LUCY_OutStream_Write_Bytes(self, ptr, len);
    }
}
#line 41363 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Store__OutStream_write_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Store__OutStream_write_string)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "self, aSV");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	lucy_OutStream *    self = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_OUTSTREAM, NULL)
;
	SV *	aSV = ST(1)
;
#line 42338 "lib/Lucy.xs"
{
    STRLEN len = 0;
    char *ptr = SvPVutf8(aSV, len);
    if (len > INT32_MAX) {
        CFISH_THROW(CFISH_ERR, "String too long: %u64", (uint64_t)len);
    }
    LUCY_OutStream_Write_CU32(self, len);
    LUCY_OutStream_Write_Bytes(self, ptr, len);
}
#line 41393 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}

#include "Lucy/Util/Debug.h"

XS_EUPXS(XS_Lucy__Util__Debug_DEBUG_PRINT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_DEBUG_PRINT)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	message = (char *)SvPV_nolen(ST(0))
;
#line 42356 "lib/Lucy.xs"
    CFISH_UNUSED_VAR(message);
    LUCY_DEBUG_PRINT("%s", message);
#line 41415 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__Debug_DEBUG); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_DEBUG)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	message = (char *)SvPV_nolen(ST(0))
;
#line 42363 "lib/Lucy.xs"
    CFISH_UNUSED_VAR(message);
    LUCY_DEBUG("%s", message);
#line 41436 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__Debug_DEBUG_ENABLED); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_DEBUG_ENABLED)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	bool	RETVAL;
	dXSTARG;
#line 42369 "lib/Lucy.xs"
    RETVAL = LUCY_DEBUG_ENABLED;
#line 41454 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__Debug_track_globals); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_track_globals)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 42383 "lib/Lucy.xs"
{
    CFISH_UNUSED_VAR(items);
    LUCY_IFDEF_DEBUG(lucy_Debug_num_globals++;);
}
#line 41476 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__Debug_set_env_cache); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_set_env_cache)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "str");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	char *	str = (char *)SvPV_nolen(ST(0))
;
#line 42392 "lib/Lucy.xs"
    lucy_Debug_set_env_cache(str);
#line 41496 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__Debug_ASSERT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_ASSERT)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "maybe");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	int	maybe = (int)SvIV(ST(0))
;
#line 42398 "lib/Lucy.xs"
    CFISH_UNUSED_VAR(maybe);
    LUCY_ASSERT(maybe, "XS ASSERT binding test");
#line 41517 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__Debug_num_allocated); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_num_allocated)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	IV	RETVAL;
	dXSTARG;
#line 42404 "lib/Lucy.xs"
    RETVAL = lucy_Debug_num_allocated;
#line 41535 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__Debug_num_freed); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_num_freed)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	IV	RETVAL;
	dXSTARG;
#line 42410 "lib/Lucy.xs"
    RETVAL = lucy_Debug_num_freed;
#line 41554 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__Debug_num_globals); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Debug_num_globals)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	IV	RETVAL;
	dXSTARG;
#line 42416 "lib/Lucy.xs"
    RETVAL = lucy_Debug_num_globals;
#line 41573 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__Freezer_freeze); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Freezer_freeze)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "obj, outstream");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	cfish_Obj *    obj = (cfish_Obj*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), CFISH_OBJ, NULL)
;
	lucy_OutStream *    outstream = (lucy_OutStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(1), LUCY_OUTSTREAM, NULL)
;
#line 42426 "lib/Lucy.xs"
    lucy_Freezer_serialize(obj, outstream);
#line 41596 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__Freezer_thaw); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__Freezer_thaw)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "instream");
    {
	lucy_InStream *    instream = (lucy_InStream*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_INSTREAM, NULL)
;
	SV *	RETVAL;
#line 42432 "lib/Lucy.xs"
    cfish_Obj *obj = lucy_Freezer_thaw(instream);
    RETVAL = CFISH_OBJ_TO_SV_NOINC(obj);
#line 41616 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__IndexFileNames_extract_gen); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__IndexFileNames_extract_gen)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "name");
    {
	cfish_String *    name = (cfish_String*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), CFISH_STRING, CFISH_ALLOCA_OBJ(CFISH_STRING))
;
	uint64_t	RETVAL;
#line 42443 "lib/Lucy.xs"
    RETVAL = lucy_IxFileNames_extract_gen(name);
#line 41636 "lib/Lucy.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
    if (sizeof(UV) == 8) { sv_setuv(RETVALSV, (UV)RETVAL); }
    else {
	    sv_setnv(RETVALSV, (NV)CFISH_U64_TO_DOUBLE(RETVAL));
    }
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__IndexFileNames_latest_snapshot); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__IndexFileNames_latest_snapshot)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "folder");
    {
	lucy_Folder *    folder = (lucy_Folder*)XSBind_perl_to_cfish_noinc(aTHX_ ST(0), LUCY_FOLDER, NULL)
;
	SV *	RETVAL;
#line 42450 "lib/Lucy.xs"
{
    cfish_String *latest = lucy_IxFileNames_latest_snapshot(folder);
    RETVAL = (SV*)CFISH_Str_To_Host(latest, NULL);
    CFISH_DECREF(latest);
}
#line 41667 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__StringHelper_utf8_flag_on); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__StringHelper_utf8_flag_on)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	sv = ST(0)
;
#line 42470 "lib/Lucy.xs"
    SvUTF8_on(sv);
#line 41688 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__StringHelper_utf8_flag_off); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__StringHelper_utf8_flag_off)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	sv = ST(0)
;
#line 42482 "lib/Lucy.xs"
    SvUTF8_off(sv);
#line 41708 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__StringHelper_to_base36); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__StringHelper_to_base36)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "num");
    {
	uint64_t    num = (sizeof(UV) == 8) ? (uint64_t)SvUV(ST(0)) : (uint64_t)SvNV(ST(0))
;
	SV *	RETVAL;
#line 42488 "lib/Lucy.xs"
{
    char base36[lucy_StrHelp_MAX_BASE36_BYTES];
    size_t size = lucy_StrHelp_to_base36(num, &base36);
    RETVAL = newSVpvn(base36, size);
}
#line 41731 "lib/Lucy.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__StringHelper_utf8ify); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__StringHelper_utf8ify)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	sv = ST(0)
;
#line 42506 "lib/Lucy.xs"
    sv_utf8_upgrade(sv);
#line 41752 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Lucy__Util__StringHelper_utf8_valid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__StringHelper_utf8_valid)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0)
;
	bool	RETVAL;
	dXSTARG;
#line 42512 "lib/Lucy.xs"
{
    STRLEN len;
    char *ptr = SvPV(sv, len);
    RETVAL = cfish_Str_utf8_valid(ptr, len);
}
#line 41776 "lib/Lucy.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Lucy__Util__StringHelper_cat_bytes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Lucy__Util__StringHelper_cat_bytes)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "sv, catted");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	sv = ST(0)
;
	SV *	catted = ST(1)
;
#line 42532 "lib/Lucy.xs"
{
    STRLEN len;
    char *ptr = SvPV(catted, len);
    if (SvUTF8(sv)) { CFISH_THROW(CFISH_ERR, "Can't cat_bytes onto a UTF-8 SV"); }
    sv_catpvn(sv, ptr, len);
}
#line 41804 "lib/Lucy.c"
	PUTBACK;
	return;
    }
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_Lucy); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Lucy)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

        newXS_deffile("Lucy::_dummy_function", XS_Lucy__dummy_function);
        newXS_deffile("Lucy::STORABLE_freeze", XS_Lucy_STORABLE_freeze);
        newXS_deffile("Lucy::STORABLE_thaw", XS_Lucy_STORABLE_thaw);
        newXS_deffile("Lucy::Analysis::Inversion::new", XS_Lucy__Analysis__Inversion_new);
        newXS_deffile("Lucy::Analysis::Token::new", XS_Lucy__Analysis__Token_new);
        newXS_deffile("Lucy::Analysis::Token::get_text", XS_Lucy__Analysis__Token_get_text);
        newXS_deffile("Lucy::Analysis::Token::set_text", XS_Lucy__Analysis__Token_set_text);
        newXS_deffile("Lucy::Document::Doc::new", XS_Lucy__Document__Doc_new);
        newXS_deffile("Lucy::Document::Doc::store", XS_Lucy__Document__Doc_store);
        newXS_deffile("Lucy::Document::Doc::get_fields", XS_Lucy__Document__Doc_get_fields);
        newXS_deffile("Lucy::Document::Doc::set_fields", XS_Lucy__Document__Doc_set_fields);
        newXS_deffile("Lucy::Document::HitDoc::new", XS_Lucy__Document__HitDoc_new);
        newXS_deffile("Lucy::Index::IndexReader::set_race_condition_debug1", XS_Lucy__Index__IndexReader_set_race_condition_debug1);
        newXS_deffile("Lucy::Index::IndexReader::debug1_num_passes", XS_Lucy__Index__IndexReader_debug1_num_passes);
        newXS_deffile("Lucy::Index::Indexer::CREATE", XS_Lucy__Index__Indexer_CREATE);
        newXS_deffile("Lucy::Index::Indexer::TRUNCATE", XS_Lucy__Index__Indexer_TRUNCATE);
        newXS_deffile("Lucy::Index::Indexer::add_doc", XS_Lucy__Index__Indexer_add_doc);
        newXS_deffile("Lucy::Index::PolyReader::sub_tick", XS_Lucy__Index__PolyReader_sub_tick);
        newXS_deffile("Lucy::Index::Posting::ScorePosting::get_prox", XS_Lucy__Index__Posting__ScorePosting_get_prox);
        newXS_deffile("Lucy::Index::PostingListWriter::set_default_mem_thresh", XS_Lucy__Index__PostingListWriter_set_default_mem_thresh);
        newXS_deffile("Lucy::Index::Similarity::get_norm_decoder", XS_Lucy__Index__Similarity_get_norm_decoder);
        newXS_deffile("Lucy::Index::SortCache::value", XS_Lucy__Index__SortCache_value);
        newXS_deffile("Lucy::Index::SortWriter::set_default_mem_thresh", XS_Lucy__Index__SortWriter_set_default_mem_thresh);
        newXS_deffile("Lucy::Object::I32Array::new", XS_Lucy__Object__I32Array_new);
        newXS_deffile("Lucy::Object::I32Array::to_arrayref", XS_Lucy__Object__I32Array_to_arrayref);
        newXS_deffile("Lucy::Search::QueryParser::ParserElem::new", XS_Lucy__Search__QueryParser__ParserElem_new);
        newXS_deffile("Lucy::Search::SortRule::FIELD", XS_Lucy__Search__SortRule_FIELD);
        newXS_deffile("Lucy::Search::SortRule::SCORE", XS_Lucy__Search__SortRule_SCORE);
        newXS_deffile("Lucy::Search::SortRule::DOC_ID", XS_Lucy__Search__SortRule_DOC_ID);
        newXS_deffile("Lucy::Simple::add_doc", XS_Lucy__Simple_add_doc);
        newXS_deffile("Lucy::Store::FileHandle::FH_READ_ONLY", XS_Lucy__Store__FileHandle_FH_READ_ONLY);
        newXS_deffile("Lucy::Store::FileHandle::FH_WRITE_ONLY", XS_Lucy__Store__FileHandle_FH_WRITE_ONLY);
        newXS_deffile("Lucy::Store::FileHandle::FH_CREATE", XS_Lucy__Store__FileHandle_FH_CREATE);
        newXS_deffile("Lucy::Store::FileHandle::FH_EXCLUSIVE", XS_Lucy__Store__FileHandle_FH_EXCLUSIVE);
        newXS_deffile("Lucy::Store::FileHandle::object_count", XS_Lucy__Store__FileHandle_object_count);
        newXS_deffile("Lucy::Store::FileHandle::_BUF_SIZE", XS_Lucy__Store__FileHandle__BUF_SIZE);
        newXS_deffile("Lucy::Store::InStream::read", XS_Lucy__Store__InStream_read);
        newXS_deffile("Lucy::Store::InStream::read_string", XS_Lucy__Store__InStream_read_string);
        newXS_deffile("Lucy::Store::InStream::read_raw_c64", XS_Lucy__Store__InStream_read_raw_c64);
        newXS_deffile("Lucy::Store::OutStream::print", XS_Lucy__Store__OutStream_print);
        newXS_deffile("Lucy::Store::OutStream::write_string", XS_Lucy__Store__OutStream_write_string);
        newXS_deffile("Lucy::Util::Debug::DEBUG_PRINT", XS_Lucy__Util__Debug_DEBUG_PRINT);
        newXS_deffile("Lucy::Util::Debug::DEBUG", XS_Lucy__Util__Debug_DEBUG);
        newXS_deffile("Lucy::Util::Debug::DEBUG_ENABLED", XS_Lucy__Util__Debug_DEBUG_ENABLED);
        newXS_deffile("Lucy::Util::Debug::track_globals", XS_Lucy__Util__Debug_track_globals);
        newXS_deffile("Lucy::Util::Debug::set_env_cache", XS_Lucy__Util__Debug_set_env_cache);
        newXS_deffile("Lucy::Util::Debug::ASSERT", XS_Lucy__Util__Debug_ASSERT);
        newXS_deffile("Lucy::Util::Debug::num_allocated", XS_Lucy__Util__Debug_num_allocated);
        newXS_deffile("Lucy::Util::Debug::num_freed", XS_Lucy__Util__Debug_num_freed);
        newXS_deffile("Lucy::Util::Debug::num_globals", XS_Lucy__Util__Debug_num_globals);
        newXS_deffile("Lucy::Util::Freezer::freeze", XS_Lucy__Util__Freezer_freeze);
        newXS_deffile("Lucy::Util::Freezer::thaw", XS_Lucy__Util__Freezer_thaw);
        newXS_deffile("Lucy::Util::IndexFileNames::extract_gen", XS_Lucy__Util__IndexFileNames_extract_gen);
        newXS_deffile("Lucy::Util::IndexFileNames::latest_snapshot", XS_Lucy__Util__IndexFileNames_latest_snapshot);
        newXS_deffile("Lucy::Util::StringHelper::utf8_flag_on", XS_Lucy__Util__StringHelper_utf8_flag_on);
        newXS_deffile("Lucy::Util::StringHelper::utf8_flag_off", XS_Lucy__Util__StringHelper_utf8_flag_off);
        newXS_deffile("Lucy::Util::StringHelper::to_base36", XS_Lucy__Util__StringHelper_to_base36);
        newXS_deffile("Lucy::Util::StringHelper::utf8ify", XS_Lucy__Util__StringHelper_utf8ify);
        newXS_deffile("Lucy::Util::StringHelper::utf8_valid", XS_Lucy__Util__StringHelper_utf8_valid);
        newXS_deffile("Lucy::Util::StringHelper::cat_bytes", XS_Lucy__Util__StringHelper_cat_bytes);

    /* Initialisation Section */

#line 39982 "lib/Lucy.xs"
{
    static const cfish_XSBind_ClassSpec class_specs[] = {
        { "Lucy::Analysis::Token", "Clownfish::Obj", 7 },
        { "Lucy::Analysis::Inversion", "Clownfish::Obj", 6 },
        { "Lucy::Analysis::Analyzer", "Clownfish::Obj", 6 },
        { "Lucy::Analysis::SnowballStemmer", "Lucy::Analysis::Analyzer", 6 },
        { "Lucy::Analysis::Normalizer", "Lucy::Analysis::Analyzer", 5 },
        { "Lucy::Analysis::EasyAnalyzer", "Lucy::Analysis::Analyzer", 7 },
        { "Lucy::Analysis::CaseFolder", "Lucy::Analysis::Analyzer", 7 },
        { "Lucy::Analysis::PolyAnalyzer", "Lucy::Analysis::Analyzer", 8 },
        { "Lucy::Analysis::SnowballStopFilter", "Lucy::Analysis::Analyzer", 6 },
        { "Lucy::Analysis::RegexTokenizer", "Lucy::Analysis::Analyzer", 7 },
        { "Lucy::Analysis::StandardTokenizer", "Lucy::Analysis::Analyzer", 4 },
        { "Lucy::Util::MemoryPool", "Clownfish::Obj", 4 },
        { "Lucy::Util::Json", "Clownfish::Obj", 0 },
        { "Lucy::Util::SortExternal", "Clownfish::Obj", 15 },
        { "Lucy::Util::BlobSortEx", "Lucy::Util::SortExternal", 10 },
        { "Lucy::Index::PostingPool", "Lucy::Util::SortExternal", 9 },
        { "Lucy::Index::SortFieldWriter", "Lucy::Util::SortExternal", 10 },
        { "Lucy::Util::Stepper", "Clownfish::Obj", 7 },
        { "Lucy::Index::TermStepper", "Lucy::Util::Stepper", 4 },
        { "Lucy::Index::TermStepper::TextTermStepper", "Lucy::Index::TermStepper", 9 },
        { "Lucy::Index::Posting::MatchPosting::MatchTermInfoStepper", "Lucy::Index::TermStepper", 6 },
        { "Lucy::Index::Posting", "Lucy::Util::Stepper", 6 },
        { "Lucy::Index::RawPosting", "Lucy::Index::Posting", 2 },
        { "Lucy::Index::Posting::MatchPosting", "Lucy::Index::Posting", 8 },
        { "Lucy::Index::Posting::ScorePosting", "Lucy::Index::Posting::MatchPosting", 7 },
        { "Lucy::Index::Posting::RichPosting", "Lucy::Index::Posting::ScorePosting", 6 },
        { "Lucy::Index::SkipStepper", "Lucy::Util::Stepper", 4 },
        { "Lucy::Util::PriorityQueue", "Clownfish::Obj", 9 },
        { "Lucy::Search::HitQueue", "Lucy::Util::PriorityQueue", 4 },
        { "Lucy::Index::SegLexQueue", "Lucy::Util::PriorityQueue", 1 },
        { "Lucy::Highlight::Highlighter", "Clownfish::Obj", 15 },
        { "Lucy::Highlight::HeatMap", "Clownfish::Obj", 6 },
        { "Lucy::Plan::FieldType", "Clownfish::Obj", 17 },
        { "Lucy::Plan::NumericType", "Lucy::Plan::FieldType", 6 },
        { "Lucy::Plan::FloatType", "Lucy::Plan::NumericType", 0 },
        { "Lucy::Plan::Float64Type", "Lucy::Plan::FloatType", 4 },
        { "Lucy::Plan::Float32Type", "Lucy::Plan::FloatType", 4 },
        { "Lucy::Plan::IntType", "Lucy::Plan::NumericType", 0 },
        { "Lucy::Plan::Int32Type", "Lucy::Plan::IntType", 4 },
        { "Lucy::Plan::Int64Type", "Lucy::Plan::IntType", 4 },
        { "Lucy::Plan::BlobType", "Lucy::Plan::FieldType", 8 },
        { "Lucy::Plan::TextType", "Lucy::Plan::FieldType", 2 },
        { "Lucy::Plan::FullTextType", "Lucy::Plan::TextType", 10 },
        { "Lucy::Plan::StringType", "Lucy::Plan::TextType", 6 },
        { "Lucy::Plan::Schema", "Clownfish::Obj", 15 },
        { "Lucy::Plan::Architecture", "Clownfish::Obj", 19 },
        { "Lucy::Document::Doc", "Clownfish::Obj", 11 },
        { "Lucy::Document::HitDoc", "Lucy::Document::Doc", 7 },
        { "Lucy::Search::Searcher", "Clownfish::Obj", 12 },
        { "Lucy::Search::PolySearcher", "Lucy::Search::Searcher", 8 },
        { "Lucy::Search::IndexSearcher", "Lucy::Search::Searcher", 10 },
        { "Lucy::Search::MatchDoc", "Clownfish::Obj", 10 },
        { "Lucy::Search::QueryParser::ParserElem", "Clownfish::Obj", 10 },
        { "Lucy::Search::QueryParser::QueryLexer", "Clownfish::Obj", 4 },
        { "Lucy::Search::Span", "Clownfish::Obj", 9 },
        { "Lucy::Search::TopDocs", "Clownfish::Obj", 8 },
        { "Lucy::Search::Hits", "Clownfish::Obj", 4 },
        { "Lucy::Search::Collector", "Clownfish::Obj", 7 },
        { "Lucy::Search::Collector::BitCollector", "Lucy::Search::Collector", 4 },
        { "Lucy::Search::Collector::OffsetCollector", "Lucy::Search::Collector", 7 },
        { "Lucy::Search::Collector::SortCollector", "Lucy::Search::Collector", 7 },
        { "Lucy::Search::QueryParser", "Clownfish::Obj", 19 },
        { "Lucy::Search::Matcher", "Clownfish::Obj", 6 },
        { "LucyX::Search::MockMatcher", "Lucy::Search::Matcher", 5 },
        { "LucyX::Search::ProximityMatcher", "Lucy::Search::Matcher", 7 },
        { "LucyX::Search::FilterMatcher", "Lucy::Search::Matcher", 6 },
        { "Lucy::Search::PhraseMatcher", "Lucy::Search::Matcher", 7 },
        { "Lucy::Search::MatchAllMatcher", "Lucy::Search::Matcher", 5 },
        { "Lucy::Search::SeriesMatcher", "Lucy::Search::Matcher", 5 },
        { "Lucy::Search::TermMatcher", "Lucy::Search::Matcher", 5 },
        { "Lucy::Index::Posting::MatchPostingMatcher", "Lucy::Search::TermMatcher", 2 },
        { "Lucy::Index::Posting::ScorePostingMatcher", "Lucy::Search::TermMatcher", 3 },
        { "Lucy::Index::Posting::RichPostingMatcher", "Lucy::Index::Posting::ScorePostingMatcher", 1 },
        { "Lucy::Search::BitVecMatcher", "Lucy::Search::Matcher", 5 },
        { "Lucy::Search::NoMatchMatcher", "Lucy::Search::Matcher", 3 },
        { "Lucy::Search::PolyMatcher", "Lucy::Search::Matcher", 2 },
        { "Lucy::Search::ANDMatcher", "Lucy::Search::PolyMatcher", 6 },
        { "Lucy::Search::ORMatcher", "Lucy::Search::PolyMatcher", 5 },
        { "Lucy::Search::ORScorer", "Lucy::Search::ORMatcher", 6 },
        { "Lucy::Search::RequiredOptionalMatcher", "Lucy::Search::PolyMatcher", 6 },
        { "Lucy::Search::NOTMatcher", "Lucy::Search::PolyMatcher", 6 },
        { "Lucy::Search::RangeMatcher", "Lucy::Search::Matcher", 6 },
        { "Lucy::Index::PostingList", "Lucy::Search::Matcher", 7 },
        { "Lucy::Index::RawPostingList", "Lucy::Index::PostingList", 4 },
        { "Lucy::Index::SegPostingList", "Lucy::Index::PostingList", 13 },
        { "Lucy::Search::SortSpec", "Clownfish::Obj", 5 },
        { "Lucy::Search::Query", "Clownfish::Obj", 8 },
        { "LucyX::Search::ProximityQuery", "Lucy::Search::Query", 12 },
        { "Lucy::Search::PhraseQuery", "Lucy::Search::Query", 11 },
        { "Lucy::Search::TermQuery", "Lucy::Search::Query", 11 },
        { "Lucy::Search::MatchAllQuery", "Lucy::Search::Query", 4 },
        { "Lucy::Search::RangeQuery", "Lucy::Search::Query", 9 },
        { "Lucy::Search::NoMatchQuery", "Lucy::Search::Query", 10 },
        { "Lucy::Search::PolyQuery", "Lucy::Search::Query", 10 },
        { "Lucy::Search::ORQuery", "Lucy::Search::PolyQuery", 4 },
        { "Lucy::Search::NOTQuery", "Lucy::Search::PolyQuery", 6 },
        { "Lucy::Search::RequiredOptionalQuery", "Lucy::Search::PolyQuery", 8 },
        { "Lucy::Search::ANDQuery", "Lucy::Search::PolyQuery", 4 },
        { "Lucy::Search::LeafQuery", "Lucy::Search::Query", 11 },
        { "Lucy::Search::Compiler", "Lucy::Search::Query", 14 },
        { "LucyX::Search::ProximityCompiler", "Lucy::Search::Compiler", 9 },
        { "Lucy::Search::PhraseCompiler", "Lucy::Search::Compiler", 9 },
        { "Lucy::Search::TermCompiler", "Lucy::Search::Compiler", 9 },
        { "Lucy::Search::MatchAllCompiler", "Lucy::Search::Compiler", 2 },
        { "Lucy::Search::RangeCompiler", "Lucy::Search::Compiler", 2 },
        { "Lucy::Search::NoMatchCompiler", "Lucy::Search::Compiler", 2 },
        { "Lucy::Search::PolyCompiler", "Lucy::Search::Compiler", 7 },
        { "Lucy::Search::ORCompiler", "Lucy::Search::PolyCompiler", 2 },
        { "Lucy::Search::NOTCompiler", "Lucy::Search::PolyCompiler", 4 },
        { "Lucy::Search::RequiredOptionalCompiler", "Lucy::Search::PolyCompiler", 2 },
        { "Lucy::Search::ANDCompiler", "Lucy::Search::PolyCompiler", 2 },
        { "Lucy::Search::SortRule", "Clownfish::Obj", 7 },
        { "Lucy::Simple", "Clownfish::Obj", 7 },
        { "Lucy::Object::BitVector", "Clownfish::Obj", 19 },
        { "Lucy::Index::BitVecDelDocs", "Lucy::Object::BitVector", 2 },
        { "Lucy::Object::I32Array", "Clownfish::Obj", 4 },
        { "Lucy::Index::Segment", "Clownfish::Obj", 16 },
        { "Lucy::Index::Similarity", "Clownfish::Obj", 16 },
        { "Lucy::Index::TermInfo", "Clownfish::Obj", 13 },
        { "Lucy::Index::DataWriter", "Clownfish::Obj", 14 },
        { "Lucy::Index::LexiconWriter", "Lucy::Index::DataWriter", 11 },
        { "Lucy::Index::HighlightWriter", "Lucy::Index::DataWriter", 7 },
        { "Lucy::Index::SortWriter", "Lucy::Index::DataWriter", 7 },
        { "Lucy::Index::DeletionsWriter", "Lucy::Index::DataWriter", 8 },
        { "Lucy::Index::DefaultDeletionsWriter", "Lucy::Index::DeletionsWriter", 13 },
        { "Lucy::Index::DocWriter", "Lucy::Index::DataWriter", 6 },
        { "Lucy::Index::Posting::PostingWriter", "Lucy::Index::DataWriter", 4 },
        { "Lucy::Index::Posting::RawPostingWriter", "Lucy::Index::Posting::PostingWriter", 5 },
        { "Lucy::Index::Posting::MatchPostingWriter", "Lucy::Index::Posting::PostingWriter", 5 },
        { "Lucy::Index::SegWriter", "Lucy::Index::DataWriter", 14 },
        { "Lucy::Index::PostingListWriter", "Lucy::Index::DataWriter", 6 },
        { "Lucy::Index::Snapshot", "Clownfish::Obj", 10 },
        { "Lucy::Index::SortCache", "Clownfish::Obj", 8 },
        { "Lucy::Index::SortCache::TextSortCache", "Lucy::Index::SortCache", 2 },
        { "Lucy::Index::SortCache::NumericSortCache", "Lucy::Index::SortCache", 2 },
        { "Lucy::Index::SortCache::Float64SortCache", "Lucy::Index::SortCache::NumericSortCache", 1 },
        { "Lucy::Index::SortCache::Float32SortCache", "Lucy::Index::SortCache::NumericSortCache", 1 },
        { "Lucy::Index::SortCache::Int32SortCache", "Lucy::Index::SortCache::NumericSortCache", 1 },
        { "Lucy::Index::SortCache::Int64SortCache", "Lucy::Index::SortCache::NumericSortCache", 1 },
        { "Lucy::Index::DataReader", "Clownfish::Obj", 10 },
        { "Lucy::Index::LexiconReader", "Lucy::Index::DataReader", 5 },
        { "Lucy::Index::PolyLexiconReader", "Lucy::Index::LexiconReader", 5 },
        { "Lucy::Index::DefaultLexiconReader", "Lucy::Index::LexiconReader", 6 },
        { "Lucy::Index::HighlightReader", "Lucy::Index::DataReader", 3 },
        { "Lucy::Index::PolyHighlightReader", "Lucy::Index::HighlightReader", 4 },
        { "Lucy::Index::DefaultHighlightReader", "Lucy::Index::HighlightReader", 5 },
        { "Lucy::Index::PostingListReader", "Lucy::Index::DataReader", 4 },
        { "Lucy::Index::DefaultPostingListReader", "Lucy::Index::PostingListReader", 5 },
        { "Lucy::Index::SortReader", "Lucy::Index::DataReader", 3 },
        { "Lucy::Index::DefaultSortReader", "Lucy::Index::SortReader", 4 },
        { "Lucy::Index::IndexReader", "Lucy::Index::DataReader", 11 },
        { "Lucy::Index::PolyReader", "Lucy::Index::IndexReader", 10 },
        { "Lucy::Index::SegReader", "Lucy::Index::IndexReader", 10 },
        { "Lucy::Index::DeletionsReader", "Lucy::Index::DataReader", 4 },
        { "Lucy::Index::PolyDeletionsReader", "Lucy::Index::DeletionsReader", 5 },
        { "Lucy::Index::DefaultDeletionsReader", "Lucy::Index::DeletionsReader", 6 },
        { "Lucy::Index::DocReader", "Lucy::Index::DataReader", 3 },
        { "Lucy::Index::PolyDocReader", "Lucy::Index::DocReader", 4 },
        { "Lucy::Index::DefaultDocReader", "Lucy::Index::DocReader", 5 },
        { "Lucy::Index::Counter", "Clownfish::Obj", 4 },
        { "Lucy::Index::SortFieldWriter::SFWriterElem", "Clownfish::Obj", 1 },
        { "Lucy::Index::FilePurger", "Clownfish::Obj", 3 },
        { "Lucy::Index::BackgroundMerger", "Clownfish::Obj", 5 },
        { "Lucy::Index::Lexicon", "Clownfish::Obj", 8 },
        { "Lucy::Index::RawLexicon", "Lucy::Index::Lexicon", 5 },
        { "Lucy::Index::SegLexicon", "Lucy::Index::Lexicon", 10 },
        { "Lucy::Index::LexIndex", "Lucy::Index::Lexicon", 6 },
        { "Lucy::Index::PolyLexicon", "Lucy::Index::Lexicon", 7 },
        { "Lucy::Index::Indexer", "Clownfish::Obj", 12 },
        { "Lucy::Index::TermVector", "Clownfish::Obj", 8 },
        { "Lucy::Index::DocVector", "Clownfish::Obj", 7 },
        { "Lucy::Index::Inverter", "Clownfish::Obj", 17 },
        { "Lucy::Index::Inverter::InverterEntry", "Clownfish::Obj", 4 },
        { "Lucy::Index::IndexManager", "Clownfish::Obj", 28 },
        { "Lucy::Store::RAMFile", "Clownfish::Obj", 5 },
        { "Lucy::Store::Lock", "Clownfish::Obj", 11 },
        { "Lucy::Store::LockFileLock", "Lucy::Store::Lock", 8 },
        { "Lucy::Store::SharedLock", "Lucy::Store::LockFileLock", 6 },
        { "Lucy::Store::OutStream", "Clownfish::Obj", 22 },
        { "Lucy::Store::InStream", "Clownfish::Obj", 26 },
        { "Lucy::Store::FileHandle", "Clownfish::Obj", 9 },
        { "Lucy::Store::FSFileHandle", "Lucy::Store::FileHandle", 6 },
        { "Lucy::Store::RAMFileHandle", "Lucy::Store::FileHandle", 8 },
        { "Lucy::Store::Folder", "Clownfish::Obj", 32 },
        { "Lucy::Store::FSFolder", "Lucy::Store::Folder", 13 },
        { "Lucy::Store::RAMFolder", "Lucy::Store::Folder", 13 },
        { "Lucy::Store::CompoundFileReader", "Lucy::Store::Folder", 12 },
        { "Lucy::Store::DirHandle", "Clownfish::Obj", 8 },
        { "Lucy::Store::FSDirHandle", "Lucy::Store::DirHandle", 5 },
        { "Lucy::Store::CFReaderDirHandle", "Lucy::Store::DirHandle", 4 },
        { "Lucy::Store::RAMDirHandle", "Lucy::Store::DirHandle", 5 },
        { "Lucy::Store::CompoundFileWriter", "Clownfish::Obj", 3 },
        { "Lucy::Store::FileWindow", "Clownfish::Obj", 4 },
        { "Lucy::Store::LockFactory", "Clownfish::Obj", 4 },
        { "Lucy::Store::LockErr", "Clownfish::Err", 1 }
    };
    static const cfish_XSBind_XSubSpec xsub_specs[] = {
        { "get_start_offset", XS_Lucy_Analysis_Token_get_start_offset },
        { "get_end_offset", XS_Lucy_Analysis_Token_get_end_offset },
        { "get_boost", XS_Lucy_Analysis_Token_get_boost },
        { "get_pos_inc", XS_Lucy_Analysis_Token_get_pos_inc },
        { "get_pos", XS_Lucy_Analysis_Token_get_pos },
        { "get_len", XS_Lucy_Analysis_Token_get_len },
        { "DESTROY", XS_Lucy_Analysis_Token_DESTROY },
        { "append", XS_Lucy_Analysis_Inversion_append },
        { "next", XS_Lucy_Analysis_Inversion_next },
        { "reset", XS_Lucy_Analysis_Inversion_reset },
        { "invert", XS_Lucy_Analysis_Inversion_invert },
        { "get_size", XS_Lucy_Analysis_Inversion_get_size },
        { "DESTROY", XS_Lucy_Analysis_Inversion_DESTROY },
        { "new", XS_Lucy_Analysis_Analyzer_new },
        { "transform", XS_Lucy_Analysis_Analyzer_transform },
        { "transform_text", XS_Lucy_Analysis_Analyzer_transform_text },
        { "split", XS_Lucy_Analysis_Analyzer_split },
        { "dump", XS_Lucy_Analysis_Analyzer_dump },
        { "load", XS_Lucy_Analysis_Analyzer_load },
        { "new", XS_Lucy_Analysis_SnowballStemmer_new },
        { "transform", XS_Lucy_Analysis_SnowballStemmer_transform },
        { "dump", XS_Lucy_Analysis_SnowballStemmer_dump },
        { "load", XS_Lucy_Analysis_SnowballStemmer_load },
        { "equals", XS_Lucy_Analysis_SnowballStemmer_equals },
        { "DESTROY", XS_Lucy_Analysis_SnowballStemmer_DESTROY },
        { "new", XS_Lucy_Analysis_Normalizer_new },
        { "transform", XS_Lucy_Analysis_Normalizer_transform },
        { "dump", XS_Lucy_Analysis_Normalizer_dump },
        { "load", XS_Lucy_Analysis_Normalizer_load },
        { "equals", XS_Lucy_Analysis_Normalizer_equals },
        { "new", XS_Lucy_Analysis_EasyAnalyzer_new },
        { "transform", XS_Lucy_Analysis_EasyAnalyzer_transform },
        { "transform_text", XS_Lucy_Analysis_EasyAnalyzer_transform_text },
        { "dump", XS_Lucy_Analysis_EasyAnalyzer_dump },
        { "load", XS_Lucy_Analysis_EasyAnalyzer_load },
        { "equals", XS_Lucy_Analysis_EasyAnalyzer_equals },
        { "DESTROY", XS_Lucy_Analysis_EasyAnalyzer_DESTROY },
        { "new", XS_Lucy_Analysis_CaseFolder_new },
        { "transform", XS_Lucy_Analysis_CaseFolder_transform },
        { "transform_text", XS_Lucy_Analysis_CaseFolder_transform_text },
        { "equals", XS_Lucy_Analysis_CaseFolder_equals },
        { "dump", XS_Lucy_Analysis_CaseFolder_dump },
        { "load", XS_Lucy_Analysis_CaseFolder_load },
        { "DESTROY", XS_Lucy_Analysis_CaseFolder_DESTROY },
        { "new", XS_Lucy_Analysis_PolyAnalyzer_new },
        { "get_analyzers", XS_Lucy_Analysis_PolyAnalyzer_get_analyzers },
        { "transform", XS_Lucy_Analysis_PolyAnalyzer_transform },
        { "transform_text", XS_Lucy_Analysis_PolyAnalyzer_transform_text },
        { "equals", XS_Lucy_Analysis_PolyAnalyzer_equals },
        { "dump", XS_Lucy_Analysis_PolyAnalyzer_dump },
        { "load", XS_Lucy_Analysis_PolyAnalyzer_load },
        { "DESTROY", XS_Lucy_Analysis_PolyAnalyzer_DESTROY },
        { "new", XS_Lucy_Analysis_SnowballStopFilter_new },
        { "transform", XS_Lucy_Analysis_SnowballStopFilter_transform },
        { "equals", XS_Lucy_Analysis_SnowballStopFilter_equals },
        { "dump", XS_Lucy_Analysis_SnowballStopFilter_dump },
        { "load", XS_Lucy_Analysis_SnowballStopFilter_load },
        { "DESTROY", XS_Lucy_Analysis_SnowballStopFilter_DESTROY },
        { "_new", XS_Lucy_Analysis_RegexTokenizer__new },
        { "transform", XS_Lucy_Analysis_RegexTokenizer_transform },
        { "transform_text", XS_Lucy_Analysis_RegexTokenizer_transform_text },
        { "dump", XS_Lucy_Analysis_RegexTokenizer_dump },
        { "load", XS_Lucy_Analysis_RegexTokenizer_load },
        { "equals", XS_Lucy_Analysis_RegexTokenizer_equals },
        { "DESTROY", XS_Lucy_Analysis_RegexTokenizer_DESTROY },
        { "new", XS_Lucy_Analysis_StandardTokenizer_new },
        { "transform", XS_Lucy_Analysis_StandardTokenizer_transform },
        { "transform_text", XS_Lucy_Analysis_StandardTokenizer_transform_text },
        { "equals", XS_Lucy_Analysis_StandardTokenizer_equals },
        { "new", XS_Lucy_Util_MemoryPool_new },
        { "release_all", XS_Lucy_Util_MemoryPool_release_all },
        { "get_consumed", XS_Lucy_Util_MemoryPool_get_consumed },
        { "DESTROY", XS_Lucy_Util_MemoryPool_DESTROY },
        { "new", XS_Lucy_Util_SortExternal_new },
        { "flush", XS_Lucy_Util_SortExternal_flush },
        { "feed", XS_Lucy_Util_SortExternal_feed },
        { "flip", XS_Lucy_Util_SortExternal_flip },
        { "fetch", XS_Lucy_Util_SortExternal_fetch },
        { "peek", XS_Lucy_Util_SortExternal_peek },
        { "add_run", XS_Lucy_Util_SortExternal_add_run },
        { "shrink", XS_Lucy_Util_SortExternal_shrink },
        { "refill", XS_Lucy_Util_SortExternal_refill },
        { "sort_buffer", XS_Lucy_Util_SortExternal_sort_buffer },
        { "clear_buffer", XS_Lucy_Util_SortExternal_clear_buffer },
        { "buffer_count", XS_Lucy_Util_SortExternal_buffer_count },
        { "grow_buffer", XS_Lucy_Util_SortExternal_grow_buffer },
        { "set_mem_thresh", XS_Lucy_Util_SortExternal_set_mem_thresh },
        { "DESTROY", XS_Lucy_Util_SortExternal_DESTROY },
        { "new", XS_Lucy_Util_BlobSortEx_new },
        { "feed", XS_Lucy_Util_BlobSortEx_feed },
        { "flush", XS_Lucy_Util_BlobSortEx_flush },
        { "refill", XS_Lucy_Util_BlobSortEx_refill },
        { "clear_buffer", XS_Lucy_Util_BlobSortEx_clear_buffer },
        { "flip", XS_Lucy_Util_BlobSortEx_flip },
        { "peek_cache", XS_Lucy_Util_BlobSortEx_peek_cache },
        { "peek_last", XS_Lucy_Util_BlobSortEx_peek_last },
        { "get_num_runs", XS_Lucy_Util_BlobSortEx_get_num_runs },
        { "DESTROY", XS_Lucy_Util_BlobSortEx_DESTROY },
        { "new", XS_Lucy_Index_PostingPool_new },
        { "add_inversion", XS_Lucy_Index_PostingPool_add_inversion },
        { "get_mem_pool", XS_Lucy_Index_PostingPool_get_mem_pool },
        { "add_segment", XS_Lucy_Index_PostingPool_add_segment },
        { "flip", XS_Lucy_Index_PostingPool_flip },
        { "refill", XS_Lucy_Index_PostingPool_refill },
        { "finish", XS_Lucy_Index_PostingPool_finish },
        { "flush", XS_Lucy_Index_PostingPool_flush },
        { "DESTROY", XS_Lucy_Index_PostingPool_DESTROY },
        { "new", XS_Lucy_Index_SortFieldWriter_new },
        { "add", XS_Lucy_Index_SortFieldWriter_add },
        { "add_segment", XS_Lucy_Index_SortFieldWriter_add_segment },
        { "flush", XS_Lucy_Index_SortFieldWriter_flush },
        { "flip", XS_Lucy_Index_SortFieldWriter_flip },
        { "refill", XS_Lucy_Index_SortFieldWriter_refill },
        { "finish", XS_Lucy_Index_SortFieldWriter_finish },
        { "get_null_ord", XS_Lucy_Index_SortFieldWriter_get_null_ord },
        { "get_ord_width", XS_Lucy_Index_SortFieldWriter_get_ord_width },
        { "DESTROY", XS_Lucy_Index_SortFieldWriter_DESTROY },
        { "new", XS_Lucy_Util_Stepper_new },
        { "reset", XS_Lucy_Util_Stepper_reset },
        { "write_key_frame", XS_Lucy_Util_Stepper_write_key_frame },
        { "write_delta", XS_Lucy_Util_Stepper_write_delta },
        { "read_key_frame", XS_Lucy_Util_Stepper_read_key_frame },
        { "read_delta", XS_Lucy_Util_Stepper_read_delta },
        { "read_record", XS_Lucy_Util_Stepper_read_record },
        { "new", XS_Lucy_Index_TermStepper_new },
        { "set_value", XS_Lucy_Index_TermStepper_set_value },
        { "get_value", XS_Lucy_Index_TermStepper_get_value },
        { "DESTROY", XS_Lucy_Index_TermStepper_DESTROY },
        { "new", XS_Lucy_Index_TermStepper_TextTermStepper_new },
        { "DESTROY", XS_Lucy_Index_TermStepper_TextTermStepper_DESTROY },
        { "reset", XS_Lucy_Index_TermStepper_TextTermStepper_reset },
        { "set_value", XS_Lucy_Index_TermStepper_TextTermStepper_set_value },
        { "get_value", XS_Lucy_Index_TermStepper_TextTermStepper_get_value },
        { "write_key_frame", XS_Lucy_Index_TermStepper_TextTermStepper_write_key_frame },
        { "write_delta", XS_Lucy_Index_TermStepper_TextTermStepper_write_delta },
        { "read_key_frame", XS_Lucy_Index_TermStepper_TextTermStepper_read_key_frame },
        { "read_delta", XS_Lucy_Index_TermStepper_TextTermStepper_read_delta },
        { "new", XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_new },
        { "reset", XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_reset },
        { "write_key_frame", XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_write_key_frame },
        { "write_delta", XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_write_delta },
        { "read_key_frame", XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_read_key_frame },
        { "read_delta", XS_Lucy_Index_Posting_MatchPosting_MatchTermInfoStepper_read_delta },
        { "new", XS_Lucy_Index_Posting_new },
        { "read_raw", XS_Lucy_Index_Posting_read_raw },
        { "add_inversion_to_pool", XS_Lucy_Index_Posting_add_inversion_to_pool },
        { "set_doc_id", XS_Lucy_Index_Posting_set_doc_id },
        { "get_doc_id", XS_Lucy_Index_Posting_get_doc_id },
        { "make_matcher", XS_Lucy_Index_Posting_make_matcher },
        { "compare_to", XS_Lucy_Index_RawPosting_compare_to },
        { "DESTROY", XS_Lucy_Index_RawPosting_DESTROY },
        { "new", XS_Lucy_Index_Posting_MatchPosting_new },
        { "DESTROY", XS_Lucy_Index_Posting_MatchPosting_DESTROY },
        { "get_freq", XS_Lucy_Index_Posting_MatchPosting_get_freq },
        { "read_record", XS_Lucy_Index_Posting_MatchPosting_read_record },
        { "read_raw", XS_Lucy_Index_Posting_MatchPosting_read_raw },
        { "add_inversion_to_pool", XS_Lucy_Index_Posting_MatchPosting_add_inversion_to_pool },
        { "reset", XS_Lucy_Index_Posting_MatchPosting_reset },
        { "make_matcher", XS_Lucy_Index_Posting_MatchPosting_make_matcher },
        { "new", XS_Lucy_Index_Posting_ScorePosting_new },
        { "DESTROY", XS_Lucy_Index_Posting_ScorePosting_DESTROY },
        { "read_record", XS_Lucy_Index_Posting_ScorePosting_read_record },
        { "read_raw", XS_Lucy_Index_Posting_ScorePosting_read_raw },
        { "add_inversion_to_pool", XS_Lucy_Index_Posting_ScorePosting_add_inversion_to_pool },
        { "reset", XS_Lucy_Index_Posting_ScorePosting_reset },
        { "make_matcher", XS_Lucy_Index_Posting_ScorePosting_make_matcher },
        { "new", XS_Lucy_Index_Posting_RichPosting_new },
        { "DESTROY", XS_Lucy_Index_Posting_RichPosting_DESTROY },
        { "read_record", XS_Lucy_Index_Posting_RichPosting_read_record },
        { "read_raw", XS_Lucy_Index_Posting_RichPosting_read_raw },
        { "add_inversion_to_pool", XS_Lucy_Index_Posting_RichPosting_add_inversion_to_pool },
        { "make_matcher", XS_Lucy_Index_Posting_RichPosting_make_matcher },
        { "read_record", XS_Lucy_Index_SkipStepper_read_record },
        { "write_record", XS_Lucy_Index_SkipStepper_write_record },
        { "set_id_and_filepos", XS_Lucy_Index_SkipStepper_set_id_and_filepos },
        { "to_string", XS_Lucy_Index_SkipStepper_to_string },
        { "new", XS_Lucy_Util_PriorityQueue_new },
        { "less_than", XS_Lucy_Util_PriorityQueue_less_than },
        { "insert", XS_Lucy_Util_PriorityQueue_insert },
        { "jostle", XS_Lucy_Util_PriorityQueue_jostle },
        { "pop", XS_Lucy_Util_PriorityQueue_pop },
        { "pop_all", XS_Lucy_Util_PriorityQueue_pop_all },
        { "peek", XS_Lucy_Util_PriorityQueue_peek },
        { "get_size", XS_Lucy_Util_PriorityQueue_get_size },
        { "DESTROY", XS_Lucy_Util_PriorityQueue_DESTROY },
        { "new", XS_Lucy_Search_HitQueue_new },
        { "DESTROY", XS_Lucy_Search_HitQueue_DESTROY },
        { "jostle", XS_Lucy_Search_HitQueue_jostle },
        { "less_than", XS_Lucy_Search_HitQueue_less_than },
        { "less_than", XS_Lucy_Index_SegLexQueue_less_than },
        { "new", XS_Lucy_Highlight_Highlighter_new },
        { "create_excerpt", XS_Lucy_Highlight_Highlighter_create_excerpt },
        { "encode", XS_Lucy_Highlight_Highlighter_encode },
        { "highlight", XS_Lucy_Highlight_Highlighter_highlight },
        { "set_pre_tag", XS_Lucy_Highlight_Highlighter_set_pre_tag },
        { "set_post_tag", XS_Lucy_Highlight_Highlighter_set_post_tag },
        { "get_pre_tag", XS_Lucy_Highlight_Highlighter_get_pre_tag },
        { "get_post_tag", XS_Lucy_Highlight_Highlighter_get_post_tag },
        { "get_field", XS_Lucy_Highlight_Highlighter_get_field },
        { "get_excerpt_length", XS_Lucy_Highlight_Highlighter_get_excerpt_length },
        { "get_searcher", XS_Lucy_Highlight_Highlighter_get_searcher },
        { "get_query", XS_Lucy_Highlight_Highlighter_get_query },
        { "get_compiler", XS_Lucy_Highlight_Highlighter_get_compiler },
        { "_highlight_excerpt", XS_Lucy_Highlight_Highlighter__highlight_excerpt },
        { "DESTROY", XS_Lucy_Highlight_Highlighter_DESTROY },
        { "new", XS_Lucy_Highlight_HeatMap_new },
        { "flatten_spans", XS_Lucy_Highlight_HeatMap_flatten_spans },
        { "calc_proximity_boost", XS_Lucy_Highlight_HeatMap_calc_proximity_boost },
        { "generate_proximity_boosts", XS_Lucy_Highlight_HeatMap_generate_proximity_boosts },
        { "get_spans", XS_Lucy_Highlight_HeatMap_get_spans },
        { "DESTROY", XS_Lucy_Highlight_HeatMap_DESTROY },
        { "new", XS_Lucy_Plan_FieldType_new },
        { "set_boost", XS_Lucy_Plan_FieldType_set_boost },
        { "get_boost", XS_Lucy_Plan_FieldType_get_boost },
        { "set_indexed", XS_Lucy_Plan_FieldType_set_indexed },
        { "indexed", XS_Lucy_Plan_FieldType_indexed },
        { "set_stored", XS_Lucy_Plan_FieldType_set_stored },
        { "stored", XS_Lucy_Plan_FieldType_stored },
        { "set_sortable", XS_Lucy_Plan_FieldType_set_sortable },
        { "sortable", XS_Lucy_Plan_FieldType_sortable },
        { "binary", XS_Lucy_Plan_FieldType_binary },
        { "compare_values", XS_Lucy_Plan_FieldType_compare_values },
        { "make_term_stepper", XS_Lucy_Plan_FieldType_make_term_stepper },
        { "primitive_id", XS_Lucy_Plan_FieldType_primitive_id },
        { "dump_for_schema", XS_Lucy_Plan_FieldType_dump_for_schema },
        { "dump", XS_Lucy_Plan_FieldType_dump },
        { "load", XS_Lucy_Plan_FieldType_load },
        { "equals", XS_Lucy_Plan_FieldType_equals },
        { "new", XS_Lucy_Plan_NumericType_new },
        { "binary", XS_Lucy_Plan_NumericType_binary },
        { "specifier", XS_Lucy_Plan_NumericType_specifier },
        { "dump_for_schema", XS_Lucy_Plan_NumericType_dump_for_schema },
        { "dump", XS_Lucy_Plan_NumericType_dump },
        { "load", XS_Lucy_Plan_NumericType_load },
        { "new", XS_Lucy_Plan_Float64Type_new },
        { "primitive_id", XS_Lucy_Plan_Float64Type_primitive_id },
        { "specifier", XS_Lucy_Plan_Float64Type_specifier },
        { "equals", XS_Lucy_Plan_Float64Type_equals },
        { "new", XS_Lucy_Plan_Float32Type_new },
        { "primitive_id", XS_Lucy_Plan_Float32Type_primitive_id },
        { "specifier", XS_Lucy_Plan_Float32Type_specifier },
        { "equals", XS_Lucy_Plan_Float32Type_equals },
        { "new", XS_Lucy_Plan_Int32Type_new },
        { "primitive_id", XS_Lucy_Plan_Int32Type_primitive_id },
        { "specifier", XS_Lucy_Plan_Int32Type_specifier },
        { "equals", XS_Lucy_Plan_Int32Type_equals },
        { "new", XS_Lucy_Plan_Int64Type_new },
        { "primitive_id", XS_Lucy_Plan_Int64Type_primitive_id },
        { "specifier", XS_Lucy_Plan_Int64Type_specifier },
        { "equals", XS_Lucy_Plan_Int64Type_equals },
        { "new", XS_Lucy_Plan_BlobType_new },
        { "binary", XS_Lucy_Plan_BlobType_binary },
        { "set_sortable", XS_Lucy_Plan_BlobType_set_sortable },
        { "primitive_id", XS_Lucy_Plan_BlobType_primitive_id },
        { "dump_for_schema", XS_Lucy_Plan_BlobType_dump_for_schema },
        { "dump", XS_Lucy_Plan_BlobType_dump },
        { "load", XS_Lucy_Plan_BlobType_load },
        { "equals", XS_Lucy_Plan_BlobType_equals },
        { "make_term_stepper", XS_Lucy_Plan_TextType_make_term_stepper },
        { "primitive_id", XS_Lucy_Plan_TextType_primitive_id },
        { "new", XS_Lucy_Plan_FullTextType_new },
        { "set_highlightable", XS_Lucy_Plan_FullTextType_set_highlightable },
        { "highlightable", XS_Lucy_Plan_FullTextType_highlightable },
        { "get_analyzer", XS_Lucy_Plan_FullTextType_get_analyzer },
        { "make_similarity", XS_Lucy_Plan_FullTextType_make_similarity },
        { "dump_for_schema", XS_Lucy_Plan_FullTextType_dump_for_schema },
        { "dump", XS_Lucy_Plan_FullTextType_dump },
        { "load", XS_Lucy_Plan_FullTextType_load },
        { "equals", XS_Lucy_Plan_FullTextType_equals },
        { "DESTROY", XS_Lucy_Plan_FullTextType_DESTROY },
        { "new", XS_Lucy_Plan_StringType_new },
        { "make_similarity", XS_Lucy_Plan_StringType_make_similarity },
        { "dump_for_schema", XS_Lucy_Plan_StringType_dump_for_schema },
        { "dump", XS_Lucy_Plan_StringType_dump },
        { "load", XS_Lucy_Plan_StringType_load },
        { "equals", XS_Lucy_Plan_StringType_equals },
        { "new", XS_Lucy_Plan_Schema_new },
        { "architecture", XS_Lucy_Plan_Schema_architecture },
        { "spec_field", XS_Lucy_Plan_Schema_spec_field },
        { "fetch_type", XS_Lucy_Plan_Schema_fetch_type },
        { "fetch_analyzer", XS_Lucy_Plan_Schema_fetch_analyzer },
        { "fetch_sim", XS_Lucy_Plan_Schema_fetch_sim },
        { "num_fields", XS_Lucy_Plan_Schema_num_fields },
        { "all_fields", XS_Lucy_Plan_Schema_all_fields },
        { "get_architecture", XS_Lucy_Plan_Schema_get_architecture },
        { "get_similarity", XS_Lucy_Plan_Schema_get_similarity },
        { "dump", XS_Lucy_Plan_Schema_dump },
        { "load", XS_Lucy_Plan_Schema_load },
        { "eat", XS_Lucy_Plan_Schema_eat },
        { "write", XS_Lucy_Plan_Schema_write },
        { "DESTROY", XS_Lucy_Plan_Schema_DESTROY },
        { "new", XS_Lucy_Plan_Architecture_new },
        { "init_seg_writer", XS_Lucy_Plan_Architecture_init_seg_writer },
        { "register_lexicon_writer", XS_Lucy_Plan_Architecture_register_lexicon_writer },
        { "register_posting_list_writer", XS_Lucy_Plan_Architecture_register_posting_list_writer },
        { "register_doc_writer", XS_Lucy_Plan_Architecture_register_doc_writer },
        { "register_sort_writer", XS_Lucy_Plan_Architecture_register_sort_writer },
        { "register_highlight_writer", XS_Lucy_Plan_Architecture_register_highlight_writer },
        { "register_deletions_writer", XS_Lucy_Plan_Architecture_register_deletions_writer },
        { "init_seg_reader", XS_Lucy_Plan_Architecture_init_seg_reader },
        { "register_doc_reader", XS_Lucy_Plan_Architecture_register_doc_reader },
        { "register_posting_list_reader", XS_Lucy_Plan_Architecture_register_posting_list_reader },
        { "register_sort_reader", XS_Lucy_Plan_Architecture_register_sort_reader },
        { "register_highlight_reader", XS_Lucy_Plan_Architecture_register_highlight_reader },
        { "register_lexicon_reader", XS_Lucy_Plan_Architecture_register_lexicon_reader },
        { "register_deletions_reader", XS_Lucy_Plan_Architecture_register_deletions_reader },
        { "make_similarity", XS_Lucy_Plan_Architecture_make_similarity },
        { "index_interval", XS_Lucy_Plan_Architecture_index_interval },
        { "skip_interval", XS_Lucy_Plan_Architecture_skip_interval },
        { "equals", XS_Lucy_Plan_Architecture_equals },
        { "set_doc_id", XS_Lucy_Document_Doc_set_doc_id },
        { "get_doc_id", XS_Lucy_Document_Doc_get_doc_id },
        { "get_size", XS_Lucy_Document_Doc_get_size },
        { "extract", XS_Lucy_Document_Doc_extract },
        { "field_names", XS_Lucy_Document_Doc_field_names },
        { "equals", XS_Lucy_Document_Doc_equals },
        { "serialize", XS_Lucy_Document_Doc_serialize },
        { "deserialize", XS_Lucy_Document_Doc_deserialize },
        { "dump", XS_Lucy_Document_Doc_dump },
        { "load", XS_Lucy_Document_Doc_load },
        { "DESTROY", XS_Lucy_Document_Doc_DESTROY },
        { "set_score", XS_Lucy_Document_HitDoc_set_score },
        { "get_score", XS_Lucy_Document_HitDoc_get_score },
        { "equals", XS_Lucy_Document_HitDoc_equals },
        { "dump", XS_Lucy_Document_HitDoc_dump },
        { "load", XS_Lucy_Document_HitDoc_load },
        { "serialize", XS_Lucy_Document_HitDoc_serialize },
        { "deserialize", XS_Lucy_Document_HitDoc_deserialize },
        { "new", XS_Lucy_Search_Searcher_new },
        { "DESTROY", XS_Lucy_Search_Searcher_DESTROY },
        { "doc_max", XS_Lucy_Search_Searcher_doc_max },
        { "doc_freq", XS_Lucy_Search_Searcher_doc_freq },
        { "glean_query", XS_Lucy_Search_Searcher_glean_query },
        { "hits", XS_Lucy_Search_Searcher_hits },
        { "collect", XS_Lucy_Search_Searcher_collect },
        { "top_docs", XS_Lucy_Search_Searcher_top_docs },
        { "fetch_doc", XS_Lucy_Search_Searcher_fetch_doc },
        { "fetch_doc_vec", XS_Lucy_Search_Searcher_fetch_doc_vec },
        { "get_schema", XS_Lucy_Search_Searcher_get_schema },
        { "close", XS_Lucy_Search_Searcher_close },
        { "new", XS_Lucy_Search_PolySearcher_new },
        { "DESTROY", XS_Lucy_Search_PolySearcher_DESTROY },
        { "doc_max", XS_Lucy_Search_PolySearcher_doc_max },
        { "doc_freq", XS_Lucy_Search_PolySearcher_doc_freq },
        { "collect", XS_Lucy_Search_PolySearcher_collect },
        { "top_docs", XS_Lucy_Search_PolySearcher_top_docs },
        { "fetch_doc", XS_Lucy_Search_PolySearcher_fetch_doc },
        { "fetch_doc_vec", XS_Lucy_Search_PolySearcher_fetch_doc_vec },
        { "new", XS_Lucy_Search_IndexSearcher_new },
        { "DESTROY", XS_Lucy_Search_IndexSearcher_DESTROY },
        { "doc_max", XS_Lucy_Search_IndexSearcher_doc_max },
        { "doc_freq", XS_Lucy_Search_IndexSearcher_doc_freq },
        { "collect", XS_Lucy_Search_IndexSearcher_collect },
        { "top_docs", XS_Lucy_Search_IndexSearcher_top_docs },
        { "fetch_doc", XS_Lucy_Search_IndexSearcher_fetch_doc },
        { "fetch_doc_vec", XS_Lucy_Search_IndexSearcher_fetch_doc_vec },
        { "get_reader", XS_Lucy_Search_IndexSearcher_get_reader },
        { "close", XS_Lucy_Search_IndexSearcher_close },
        { "new", XS_Lucy_Search_MatchDoc_new },
        { "serialize", XS_Lucy_Search_MatchDoc_serialize },
        { "deserialize", XS_Lucy_Search_MatchDoc_deserialize },
        { "get_doc_id", XS_Lucy_Search_MatchDoc_get_doc_id },
        { "set_doc_id", XS_Lucy_Search_MatchDoc_set_doc_id },
        { "get_score", XS_Lucy_Search_MatchDoc_get_score },
        { "set_score", XS_Lucy_Search_MatchDoc_set_score },
        { "get_values", XS_Lucy_Search_MatchDoc_get_values },
        { "set_values", XS_Lucy_Search_MatchDoc_set_values },
        { "DESTROY", XS_Lucy_Search_MatchDoc_DESTROY },
        { "DESTROY", XS_Lucy_Search_QueryParser_ParserElem_DESTROY },
        { "set_value", XS_Lucy_Search_QueryParser_ParserElem_set_value },
        { "as", XS_Lucy_Search_QueryParser_ParserElem_as },
        { "get_type", XS_Lucy_Search_QueryParser_ParserElem_get_type },
        { "negate", XS_Lucy_Search_QueryParser_ParserElem_negate },
        { "require", XS_Lucy_Search_QueryParser_ParserElem_require },
        { "unrequire", XS_Lucy_Search_QueryParser_ParserElem_unrequire },
        { "required", XS_Lucy_Search_QueryParser_ParserElem_required },
        { "optional", XS_Lucy_Search_QueryParser_ParserElem_optional },
        { "negated", XS_Lucy_Search_QueryParser_ParserElem_negated },
        { "new", XS_Lucy_Search_QueryParser_QueryLexer_new },
        { "tokenize", XS_Lucy_Search_QueryParser_QueryLexer_tokenize },
        { "heed_colons", XS_Lucy_Search_QueryParser_QueryLexer_heed_colons },
        { "set_heed_colons", XS_Lucy_Search_QueryParser_QueryLexer_set_heed_colons },
        { "new", XS_Lucy_Search_Span_new },
        { "get_offset", XS_Lucy_Search_Span_get_offset },
        { "set_offset", XS_Lucy_Search_Span_set_offset },
        { "get_length", XS_Lucy_Search_Span_get_length },
        { "set_length", XS_Lucy_Search_Span_set_length },
        { "get_weight", XS_Lucy_Search_Span_get_weight },
        { "set_weight", XS_Lucy_Search_Span_set_weight },
        { "equals", XS_Lucy_Search_Span_equals },
        { "compare_to", XS_Lucy_Search_Span_compare_to },
        { "new", XS_Lucy_Search_TopDocs_new },
        { "get_match_docs", XS_Lucy_Search_TopDocs_get_match_docs },
        { "set_match_docs", XS_Lucy_Search_TopDocs_set_match_docs },
        { "get_total_hits", XS_Lucy_Search_TopDocs_get_total_hits },
        { "set_total_hits", XS_Lucy_Search_TopDocs_set_total_hits },
        { "serialize", XS_Lucy_Search_TopDocs_serialize },
        { "deserialize", XS_Lucy_Search_TopDocs_deserialize },
        { "DESTROY", XS_Lucy_Search_TopDocs_DESTROY },
        { "new", XS_Lucy_Search_Hits_new },
        { "next", XS_Lucy_Search_Hits_next },
        { "total_hits", XS_Lucy_Search_Hits_total_hits },
        { "DESTROY", XS_Lucy_Search_Hits_DESTROY },
        { "new", XS_Lucy_Search_Collector_new },
        { "DESTROY", XS_Lucy_Search_Collector_DESTROY },
        { "collect", XS_Lucy_Search_Collector_collect },
        { "set_reader", XS_Lucy_Search_Collector_set_reader },
        { "set_base", XS_Lucy_Search_Collector_set_base },
        { "need_score", XS_Lucy_Search_Collector_need_score },
        { "set_matcher", XS_Lucy_Search_Collector_set_matcher },
        { "new", XS_Lucy_Search_Collector_BitCollector_new },
        { "DESTROY", XS_Lucy_Search_Collector_BitCollector_DESTROY },
        { "collect", XS_Lucy_Search_Collector_BitCollector_collect },
        { "need_score", XS_Lucy_Search_Collector_BitCollector_need_score },
        { "new", XS_Lucy_Search_Collector_OffsetCollector_new },
        { "DESTROY", XS_Lucy_Search_Collector_OffsetCollector_DESTROY },
        { "collect", XS_Lucy_Search_Collector_OffsetCollector_collect },
        { "need_score", XS_Lucy_Search_Collector_OffsetCollector_need_score },
        { "set_reader", XS_Lucy_Search_Collector_OffsetCollector_set_reader },
        { "set_base", XS_Lucy_Search_Collector_OffsetCollector_set_base },
        { "set_matcher", XS_Lucy_Search_Collector_OffsetCollector_set_matcher },
        { "new", XS_Lucy_Search_Collector_SortCollector_new },
        { "collect", XS_Lucy_Search_Collector_SortCollector_collect },
        { "pop_match_docs", XS_Lucy_Search_Collector_SortCollector_pop_match_docs },
        { "get_total_hits", XS_Lucy_Search_Collector_SortCollector_get_total_hits },
        { "set_reader", XS_Lucy_Search_Collector_SortCollector_set_reader },
        { "need_score", XS_Lucy_Search_Collector_SortCollector_need_score },
        { "DESTROY", XS_Lucy_Search_Collector_SortCollector_DESTROY },
        { "new", XS_Lucy_Search_QueryParser_new },
        { "parse", XS_Lucy_Search_QueryParser_parse },
        { "tree", XS_Lucy_Search_QueryParser_tree },
        { "expand", XS_Lucy_Search_QueryParser_expand },
        { "expand_leaf", XS_Lucy_Search_QueryParser_expand_leaf },
        { "prune", XS_Lucy_Search_QueryParser_prune },
        { "make_term_query", XS_Lucy_Search_QueryParser_make_term_query },
        { "make_phrase_query", XS_Lucy_Search_QueryParser_make_phrase_query },
        { "make_or_query", XS_Lucy_Search_QueryParser_make_or_query },
        { "make_and_query", XS_Lucy_Search_QueryParser_make_and_query },
        { "make_not_query", XS_Lucy_Search_QueryParser_make_not_query },
        { "make_req_opt_query", XS_Lucy_Search_QueryParser_make_req_opt_query },
        { "get_analyzer", XS_Lucy_Search_QueryParser_get_analyzer },
        { "get_schema", XS_Lucy_Search_QueryParser_get_schema },
        { "get_default_boolop", XS_Lucy_Search_QueryParser_get_default_boolop },
        { "get_fields", XS_Lucy_Search_QueryParser_get_fields },
        { "heed_colons", XS_Lucy_Search_QueryParser_heed_colons },
        { "set_heed_colons", XS_Lucy_Search_QueryParser_set_heed_colons },
        { "DESTROY", XS_Lucy_Search_QueryParser_DESTROY },
        { "new", XS_Lucy_Search_Matcher_new },
        { "next", XS_Lucy_Search_Matcher_next },
        { "advance", XS_Lucy_Search_Matcher_advance },
        { "get_doc_id", XS_Lucy_Search_Matcher_get_doc_id },
        { "score", XS_Lucy_Search_Matcher_score },
        { "collect", XS_Lucy_Search_Matcher_collect },
        { "_new", XS_LucyX_Search_MockMatcher__new },
        { "DESTROY", XS_LucyX_Search_MockMatcher_DESTROY },
        { "next", XS_LucyX_Search_MockMatcher_next },
        { "score", XS_LucyX_Search_MockMatcher_score },
        { "get_doc_id", XS_LucyX_Search_MockMatcher_get_doc_id },
        { "new", XS_LucyX_Search_ProximityMatcher_new },
        { "DESTROY", XS_LucyX_Search_ProximityMatcher_DESTROY },
        { "next", XS_LucyX_Search_ProximityMatcher_next },
        { "advance", XS_LucyX_Search_ProximityMatcher_advance },
        { "get_doc_id", XS_LucyX_Search_ProximityMatcher_get_doc_id },
        { "score", XS_LucyX_Search_ProximityMatcher_score },
        { "calc_proximity_freq", XS_LucyX_Search_ProximityMatcher_calc_proximity_freq },
        { "new", XS_LucyX_Search_FilterMatcher_new },
        { "DESTROY", XS_LucyX_Search_FilterMatcher_DESTROY },
        { "next", XS_LucyX_Search_FilterMatcher_next },
        { "skip_to", XS_LucyX_Search_FilterMatcher_skip_to },
        { "score", XS_LucyX_Search_FilterMatcher_score },
        { "get_doc_id", XS_LucyX_Search_FilterMatcher_get_doc_id },
        { "new", XS_Lucy_Search_PhraseMatcher_new },
        { "DESTROY", XS_Lucy_Search_PhraseMatcher_DESTROY },
        { "next", XS_Lucy_Search_PhraseMatcher_next },
        { "advance", XS_Lucy_Search_PhraseMatcher_advance },
        { "get_doc_id", XS_Lucy_Search_PhraseMatcher_get_doc_id },
        { "score", XS_Lucy_Search_PhraseMatcher_score },
        { "calc_phrase_freq", XS_Lucy_Search_PhraseMatcher_calc_phrase_freq },
        { "new", XS_Lucy_Search_MatchAllMatcher_new },
        { "next", XS_Lucy_Search_MatchAllMatcher_next },
        { "advance", XS_Lucy_Search_MatchAllMatcher_advance },
        { "score", XS_Lucy_Search_MatchAllMatcher_score },
        { "get_doc_id", XS_Lucy_Search_MatchAllMatcher_get_doc_id },
        { "new", XS_Lucy_Search_SeriesMatcher_new },
        { "next", XS_Lucy_Search_SeriesMatcher_next },
        { "advance", XS_Lucy_Search_SeriesMatcher_advance },
        { "get_doc_id", XS_Lucy_Search_SeriesMatcher_get_doc_id },
        { "DESTROY", XS_Lucy_Search_SeriesMatcher_DESTROY },
        { "new", XS_Lucy_Search_TermMatcher_new },
        { "DESTROY", XS_Lucy_Search_TermMatcher_DESTROY },
        { "next", XS_Lucy_Search_TermMatcher_next },
        { "advance", XS_Lucy_Search_TermMatcher_advance },
        { "get_doc_id", XS_Lucy_Search_TermMatcher_get_doc_id },
        { "new", XS_Lucy_Index_Posting_MatchPostingMatcher_new },
        { "score", XS_Lucy_Index_Posting_MatchPostingMatcher_score },
        { "new", XS_Lucy_Index_Posting_ScorePostingMatcher_new },
        { "score", XS_Lucy_Index_Posting_ScorePostingMatcher_score },
        { "DESTROY", XS_Lucy_Index_Posting_ScorePostingMatcher_DESTROY },
        { "new", XS_Lucy_Index_Posting_RichPostingMatcher_new },
        { "new", XS_Lucy_Search_BitVecMatcher_new },
        { "next", XS_Lucy_Search_BitVecMatcher_next },
        { "advance", XS_Lucy_Search_BitVecMatcher_advance },
        { "get_doc_id", XS_Lucy_Search_BitVecMatcher_get_doc_id },
        { "DESTROY", XS_Lucy_Search_BitVecMatcher_DESTROY },
        { "new", XS_Lucy_Search_NoMatchMatcher_new },
        { "next", XS_Lucy_Search_NoMatchMatcher_next },
        { "advance", XS_Lucy_Search_NoMatchMatcher_advance },
        { "new", XS_Lucy_Search_PolyMatcher_new },
        { "DESTROY", XS_Lucy_Search_PolyMatcher_DESTROY },
        { "new", XS_Lucy_Search_ANDMatcher_new },
        { "DESTROY", XS_Lucy_Search_ANDMatcher_DESTROY },
        { "next", XS_Lucy_Search_ANDMatcher_next },
        { "advance", XS_Lucy_Search_ANDMatcher_advance },
        { "score", XS_Lucy_Search_ANDMatcher_score },
        { "get_doc_id", XS_Lucy_Search_ANDMatcher_get_doc_id },
        { "new", XS_Lucy_Search_ORMatcher_new },
        { "DESTROY", XS_Lucy_Search_ORMatcher_DESTROY },
        { "next", XS_Lucy_Search_ORMatcher_next },
        { "advance", XS_Lucy_Search_ORMatcher_advance },
        { "get_doc_id", XS_Lucy_Search_ORMatcher_get_doc_id },
        { "new", XS_Lucy_Search_ORScorer_new },
        { "DESTROY", XS_Lucy_Search_ORScorer_DESTROY },
        { "next", XS_Lucy_Search_ORScorer_next },
        { "advance", XS_Lucy_Search_ORScorer_advance },
        { "score", XS_Lucy_Search_ORScorer_score },
        { "get_doc_id", XS_Lucy_Search_ORScorer_get_doc_id },
        { "new", XS_Lucy_Search_RequiredOptionalMatcher_new },
        { "DESTROY", XS_Lucy_Search_RequiredOptionalMatcher_DESTROY },
        { "next", XS_Lucy_Search_RequiredOptionalMatcher_next },
        { "advance", XS_Lucy_Search_RequiredOptionalMatcher_advance },
        { "score", XS_Lucy_Search_RequiredOptionalMatcher_score },
        { "get_doc_id", XS_Lucy_Search_RequiredOptionalMatcher_get_doc_id },
        { "new", XS_Lucy_Search_NOTMatcher_new },
        { "DESTROY", XS_Lucy_Search_NOTMatcher_DESTROY },
        { "next", XS_Lucy_Search_NOTMatcher_next },
        { "advance", XS_Lucy_Search_NOTMatcher_advance },
        { "score", XS_Lucy_Search_NOTMatcher_score },
        { "get_doc_id", XS_Lucy_Search_NOTMatcher_get_doc_id },
        { "new", XS_Lucy_Search_RangeMatcher_new },
        { "next", XS_Lucy_Search_RangeMatcher_next },
        { "advance", XS_Lucy_Search_RangeMatcher_advance },
        { "score", XS_Lucy_Search_RangeMatcher_score },
        { "get_doc_id", XS_Lucy_Search_RangeMatcher_get_doc_id },
        { "DESTROY", XS_Lucy_Search_RangeMatcher_DESTROY },
        { "new", XS_Lucy_Index_PostingList_new },
        { "get_posting", XS_Lucy_Index_PostingList_get_posting },
        { "get_doc_freq", XS_Lucy_Index_PostingList_get_doc_freq },
        { "seek", XS_Lucy_Index_PostingList_seek },
        { "seek_lex", XS_Lucy_Index_PostingList_seek_lex },
        { "make_matcher", XS_Lucy_Index_PostingList_make_matcher },
        { "read_raw", XS_Lucy_Index_PostingList_read_raw },
        { "new", XS_Lucy_Index_RawPostingList_new },
        { "DESTROY", XS_Lucy_Index_RawPostingList_DESTROY },
        { "read_raw", XS_Lucy_Index_RawPostingList_read_raw },
        { "get_posting", XS_Lucy_Index_RawPostingList_get_posting },
        { "new", XS_Lucy_Index_SegPostingList_new },
        { "get_post_stream", XS_Lucy_Index_SegPostingList_get_post_stream },
        { "get_count", XS_Lucy_Index_SegPostingList_get_count },
        { "DESTROY", XS_Lucy_Index_SegPostingList_DESTROY },
        { "get_doc_freq", XS_Lucy_Index_SegPostingList_get_doc_freq },
        { "get_doc_id", XS_Lucy_Index_SegPostingList_get_doc_id },
        { "get_posting", XS_Lucy_Index_SegPostingList_get_posting },
        { "next", XS_Lucy_Index_SegPostingList_next },
        { "advance", XS_Lucy_Index_SegPostingList_advance },
        { "seek", XS_Lucy_Index_SegPostingList_seek },
        { "seek_lex", XS_Lucy_Index_SegPostingList_seek_lex },
        { "make_matcher", XS_Lucy_Index_SegPostingList_make_matcher },
        { "read_raw", XS_Lucy_Index_SegPostingList_read_raw },
        { "new", XS_Lucy_Search_SortSpec_new },
        { "serialize", XS_Lucy_Search_SortSpec_serialize },
        { "deserialize", XS_Lucy_Search_SortSpec_deserialize },
        { "get_rules", XS_Lucy_Search_SortSpec_get_rules },
        { "DESTROY", XS_Lucy_Search_SortSpec_DESTROY },
        { "new", XS_Lucy_Search_Query_new },
        { "make_compiler", XS_Lucy_Search_Query_make_compiler },
        { "set_boost", XS_Lucy_Search_Query_set_boost },
        { "get_boost", XS_Lucy_Search_Query_get_boost },
        { "serialize", XS_Lucy_Search_Query_serialize },
        { "deserialize", XS_Lucy_Search_Query_deserialize },
        { "dump", XS_Lucy_Search_Query_dump },
        { "load", XS_Lucy_Search_Query_load },
        { "new", XS_LucyX_Search_ProximityQuery_new },
        { "get_field", XS_LucyX_Search_ProximityQuery_get_field },
        { "get_terms", XS_LucyX_Search_ProximityQuery_get_terms },
        { "get_within", XS_LucyX_Search_ProximityQuery_get_within },
        { "make_compiler", XS_LucyX_Search_ProximityQuery_make_compiler },
        { "equals", XS_LucyX_Search_ProximityQuery_equals },
        { "to_string", XS_LucyX_Search_ProximityQuery_to_string },
        { "serialize", XS_LucyX_Search_ProximityQuery_serialize },
        { "deserialize", XS_LucyX_Search_ProximityQuery_deserialize },
        { "dump", XS_LucyX_Search_ProximityQuery_dump },
        { "load", XS_LucyX_Search_ProximityQuery_load },
        { "DESTROY", XS_LucyX_Search_ProximityQuery_DESTROY },
        { "new", XS_Lucy_Search_PhraseQuery_new },
        { "get_field", XS_Lucy_Search_PhraseQuery_get_field },
        { "get_terms", XS_Lucy_Search_PhraseQuery_get_terms },
        { "make_compiler", XS_Lucy_Search_PhraseQuery_make_compiler },
        { "equals", XS_Lucy_Search_PhraseQuery_equals },
        { "to_string", XS_Lucy_Search_PhraseQuery_to_string },
        { "serialize", XS_Lucy_Search_PhraseQuery_serialize },
        { "deserialize", XS_Lucy_Search_PhraseQuery_deserialize },
        { "dump", XS_Lucy_Search_PhraseQuery_dump },
        { "load", XS_Lucy_Search_PhraseQuery_load },
        { "DESTROY", XS_Lucy_Search_PhraseQuery_DESTROY },
        { "new", XS_Lucy_Search_TermQuery_new },
        { "get_field", XS_Lucy_Search_TermQuery_get_field },
        { "get_term", XS_Lucy_Search_TermQuery_get_term },
        { "make_compiler", XS_Lucy_Search_TermQuery_make_compiler },
        { "to_string", XS_Lucy_Search_TermQuery_to_string },
        { "serialize", XS_Lucy_Search_TermQuery_serialize },
        { "deserialize", XS_Lucy_Search_TermQuery_deserialize },
        { "dump", XS_Lucy_Search_TermQuery_dump },
        { "load", XS_Lucy_Search_TermQuery_load },
        { "equals", XS_Lucy_Search_TermQuery_equals },
        { "DESTROY", XS_Lucy_Search_TermQuery_DESTROY },
        { "new", XS_Lucy_Search_MatchAllQuery_new },
        { "equals", XS_Lucy_Search_MatchAllQuery_equals },
        { "to_string", XS_Lucy_Search_MatchAllQuery_to_string },
        { "make_compiler", XS_Lucy_Search_MatchAllQuery_make_compiler },
        { "new", XS_Lucy_Search_RangeQuery_new },
        { "equals", XS_Lucy_Search_RangeQuery_equals },
        { "to_string", XS_Lucy_Search_RangeQuery_to_string },
        { "make_compiler", XS_Lucy_Search_RangeQuery_make_compiler },
        { "serialize", XS_Lucy_Search_RangeQuery_serialize },
        { "deserialize", XS_Lucy_Search_RangeQuery_deserialize },
        { "dump", XS_Lucy_Search_RangeQuery_dump },
        { "load", XS_Lucy_Search_RangeQuery_load },
        { "DESTROY", XS_Lucy_Search_RangeQuery_DESTROY },
        { "new", XS_Lucy_Search_NoMatchQuery_new },
        { "set_fails_to_match", XS_Lucy_Search_NoMatchQuery_set_fails_to_match },
        { "get_fails_to_match", XS_Lucy_Search_NoMatchQuery_get_fails_to_match },
        { "dump", XS_Lucy_Search_NoMatchQuery_dump },
        { "load", XS_Lucy_Search_NoMatchQuery_load },
        { "serialize", XS_Lucy_Search_NoMatchQuery_serialize },
        { "deserialize", XS_Lucy_Search_NoMatchQuery_deserialize },
        { "equals", XS_Lucy_Search_NoMatchQuery_equals },
        { "to_string", XS_Lucy_Search_NoMatchQuery_to_string },
        { "make_compiler", XS_Lucy_Search_NoMatchQuery_make_compiler },
        { "new", XS_Lucy_Search_PolyQuery_new },
        { "add_child", XS_Lucy_Search_PolyQuery_add_child },
        { "set_children", XS_Lucy_Search_PolyQuery_set_children },
        { "get_children", XS_Lucy_Search_PolyQuery_get_children },
        { "serialize", XS_Lucy_Search_PolyQuery_serialize },
        { "deserialize", XS_Lucy_Search_PolyQuery_deserialize },
        { "dump", XS_Lucy_Search_PolyQuery_dump },
        { "load", XS_Lucy_Search_PolyQuery_load },
        { "equals", XS_Lucy_Search_PolyQuery_equals },
        { "DESTROY", XS_Lucy_Search_PolyQuery_DESTROY },
        { "new", XS_Lucy_Search_ORQuery_new },
        { "make_compiler", XS_Lucy_Search_ORQuery_make_compiler },
        { "to_string", XS_Lucy_Search_ORQuery_to_string },
        { "equals", XS_Lucy_Search_ORQuery_equals },
        { "new", XS_Lucy_Search_NOTQuery_new },
        { "get_negated_query", XS_Lucy_Search_NOTQuery_get_negated_query },
        { "set_negated_query", XS_Lucy_Search_NOTQuery_set_negated_query },
        { "make_compiler", XS_Lucy_Search_NOTQuery_make_compiler },
        { "to_string", XS_Lucy_Search_NOTQuery_to_string },
        { "equals", XS_Lucy_Search_NOTQuery_equals },
        { "new", XS_Lucy_Search_RequiredOptionalQuery_new },
        { "get_required_query", XS_Lucy_Search_RequiredOptionalQuery_get_required_query },
        { "set_required_query", XS_Lucy_Search_RequiredOptionalQuery_set_required_query },
        { "get_optional_query", XS_Lucy_Search_RequiredOptionalQuery_get_optional_query },
        { "set_optional_query", XS_Lucy_Search_RequiredOptionalQuery_set_optional_query },
        { "make_compiler", XS_Lucy_Search_RequiredOptionalQuery_make_compiler },
        { "to_string", XS_Lucy_Search_RequiredOptionalQuery_to_string },
        { "equals", XS_Lucy_Search_RequiredOptionalQuery_equals },
        { "new", XS_Lucy_Search_ANDQuery_new },
        { "make_compiler", XS_Lucy_Search_ANDQuery_make_compiler },
        { "to_string", XS_Lucy_Search_ANDQuery_to_string },
        { "equals", XS_Lucy_Search_ANDQuery_equals },
        { "new", XS_Lucy_Search_LeafQuery_new },
        { "get_field", XS_Lucy_Search_LeafQuery_get_field },
        { "get_text", XS_Lucy_Search_LeafQuery_get_text },
        { "equals", XS_Lucy_Search_LeafQuery_equals },
        { "to_string", XS_Lucy_Search_LeafQuery_to_string },
        { "serialize", XS_Lucy_Search_LeafQuery_serialize },
        { "deserialize", XS_Lucy_Search_LeafQuery_deserialize },
        { "dump", XS_Lucy_Search_LeafQuery_dump },
        { "load", XS_Lucy_Search_LeafQuery_load },
        { "make_compiler", XS_Lucy_Search_LeafQuery_make_compiler },
        { "DESTROY", XS_Lucy_Search_LeafQuery_DESTROY },
        { "do_new", XS_Lucy_Search_Compiler_do_new },
        { "make_matcher", XS_Lucy_Search_Compiler_make_matcher },
        { "get_weight", XS_Lucy_Search_Compiler_get_weight },
        { "get_similarity", XS_Lucy_Search_Compiler_get_similarity },
        { "get_parent", XS_Lucy_Search_Compiler_get_parent },
        { "sum_of_squared_weights", XS_Lucy_Search_Compiler_sum_of_squared_weights },
        { "apply_norm_factor", XS_Lucy_Search_Compiler_apply_norm_factor },
        { "normalize", XS_Lucy_Search_Compiler_normalize },
        { "highlight_spans", XS_Lucy_Search_Compiler_highlight_spans },
        { "serialize", XS_Lucy_Search_Compiler_serialize },
        { "deserialize", XS_Lucy_Search_Compiler_deserialize },
        { "equals", XS_Lucy_Search_Compiler_equals },
        { "to_string", XS_Lucy_Search_Compiler_to_string },
        { "DESTROY", XS_Lucy_Search_Compiler_DESTROY },
        { "do_new", XS_LucyX_Search_ProximityCompiler_do_new },
        { "make_matcher", XS_LucyX_Search_ProximityCompiler_make_matcher },
        { "get_weight", XS_LucyX_Search_ProximityCompiler_get_weight },
        { "sum_of_squared_weights", XS_LucyX_Search_ProximityCompiler_sum_of_squared_weights },
        { "apply_norm_factor", XS_LucyX_Search_ProximityCompiler_apply_norm_factor },
        { "highlight_spans", XS_LucyX_Search_ProximityCompiler_highlight_spans },
        { "equals", XS_LucyX_Search_ProximityCompiler_equals },
        { "serialize", XS_LucyX_Search_ProximityCompiler_serialize },
        { "deserialize", XS_LucyX_Search_ProximityCompiler_deserialize },
        { "do_new", XS_Lucy_Search_PhraseCompiler_do_new },
        { "make_matcher", XS_Lucy_Search_PhraseCompiler_make_matcher },
        { "get_weight", XS_Lucy_Search_PhraseCompiler_get_weight },
        { "sum_of_squared_weights", XS_Lucy_Search_PhraseCompiler_sum_of_squared_weights },
        { "apply_norm_factor", XS_Lucy_Search_PhraseCompiler_apply_norm_factor },
        { "highlight_spans", XS_Lucy_Search_PhraseCompiler_highlight_spans },
        { "equals", XS_Lucy_Search_PhraseCompiler_equals },
        { "serialize", XS_Lucy_Search_PhraseCompiler_serialize },
        { "deserialize", XS_Lucy_Search_PhraseCompiler_deserialize },
        { "do_new", XS_Lucy_Search_TermCompiler_do_new },
        { "make_matcher", XS_Lucy_Search_TermCompiler_make_matcher },
        { "get_weight", XS_Lucy_Search_TermCompiler_get_weight },
        { "sum_of_squared_weights", XS_Lucy_Search_TermCompiler_sum_of_squared_weights },
        { "apply_norm_factor", XS_Lucy_Search_TermCompiler_apply_norm_factor },
        { "highlight_spans", XS_Lucy_Search_TermCompiler_highlight_spans },
        { "equals", XS_Lucy_Search_TermCompiler_equals },
        { "serialize", XS_Lucy_Search_TermCompiler_serialize },
        { "deserialize", XS_Lucy_Search_TermCompiler_deserialize },
        { "new", XS_Lucy_Search_MatchAllCompiler_new },
        { "make_matcher", XS_Lucy_Search_MatchAllCompiler_make_matcher },
        { "new", XS_Lucy_Search_RangeCompiler_new },
        { "make_matcher", XS_Lucy_Search_RangeCompiler_make_matcher },
        { "new", XS_Lucy_Search_NoMatchCompiler_new },
        { "make_matcher", XS_Lucy_Search_NoMatchCompiler_make_matcher },
        { "new", XS_Lucy_Search_PolyCompiler_new },
        { "sum_of_squared_weights", XS_Lucy_Search_PolyCompiler_sum_of_squared_weights },
        { "apply_norm_factor", XS_Lucy_Search_PolyCompiler_apply_norm_factor },
        { "highlight_spans", XS_Lucy_Search_PolyCompiler_highlight_spans },
        { "DESTROY", XS_Lucy_Search_PolyCompiler_DESTROY },
        { "serialize", XS_Lucy_Search_PolyCompiler_serialize },
        { "deserialize", XS_Lucy_Search_PolyCompiler_deserialize },
        { "new", XS_Lucy_Search_ORCompiler_new },
        { "make_matcher", XS_Lucy_Search_ORCompiler_make_matcher },
        { "new", XS_Lucy_Search_NOTCompiler_new },
        { "make_matcher", XS_Lucy_Search_NOTCompiler_make_matcher },
        { "sum_of_squared_weights", XS_Lucy_Search_NOTCompiler_sum_of_squared_weights },
        { "highlight_spans", XS_Lucy_Search_NOTCompiler_highlight_spans },
        { "new", XS_Lucy_Search_RequiredOptionalCompiler_new },
        { "make_matcher", XS_Lucy_Search_RequiredOptionalCompiler_make_matcher },
        { "new", XS_Lucy_Search_ANDCompiler_new },
        { "make_matcher", XS_Lucy_Search_ANDCompiler_make_matcher },
        { "_new", XS_Lucy_Search_SortRule__new },
        { "get_field", XS_Lucy_Search_SortRule_get_field },
        { "get_type", XS_Lucy_Search_SortRule_get_type },
        { "get_reverse", XS_Lucy_Search_SortRule_get_reverse },
        { "serialize", XS_Lucy_Search_SortRule_serialize },
        { "deserialize", XS_Lucy_Search_SortRule_deserialize },
        { "DESTROY", XS_Lucy_Search_SortRule_DESTROY },
        { "new", XS_Lucy_Simple_new },
        { "search", XS_Lucy_Simple_search },
        { "next", XS_Lucy_Simple_next },
        { "get_indexer", XS_Lucy_Simple_get_indexer },
        { "get_hits", XS_Lucy_Simple_get_hits },
        { "finish_indexing", XS_Lucy_Simple_finish_indexing },
        { "DESTROY", XS_Lucy_Simple_DESTROY },
        { "new", XS_Lucy_Object_BitVector_new },
        { "get", XS_Lucy_Object_BitVector_get },
        { "set", XS_Lucy_Object_BitVector_set },
        { "get_capacity", XS_Lucy_Object_BitVector_get_capacity },
        { "next_hit", XS_Lucy_Object_BitVector_next_hit },
        { "clear", XS_Lucy_Object_BitVector_clear },
        { "clear_all", XS_Lucy_Object_BitVector_clear_all },
        { "grow", XS_Lucy_Object_BitVector_grow },
        { "mimic", XS_Lucy_Object_BitVector_mimic },
        { "and", XS_Lucy_Object_BitVector_and },
        { "or", XS_Lucy_Object_BitVector_or },
        { "xor", XS_Lucy_Object_BitVector_xor },
        { "and_not", XS_Lucy_Object_BitVector_and_not },
        { "flip", XS_Lucy_Object_BitVector_flip },
        { "flip_block", XS_Lucy_Object_BitVector_flip_block },
        { "count", XS_Lucy_Object_BitVector_count },
        { "to_array", XS_Lucy_Object_BitVector_to_array },
        { "DESTROY", XS_Lucy_Object_BitVector_DESTROY },
        { "clone", XS_Lucy_Object_BitVector_clone },
        { "new", XS_Lucy_Index_BitVecDelDocs_new },
        { "DESTROY", XS_Lucy_Index_BitVecDelDocs_DESTROY },
        { "set", XS_Lucy_Object_I32Array_set },
        { "get", XS_Lucy_Object_I32Array_get },
        { "get_size", XS_Lucy_Object_I32Array_get_size },
        { "DESTROY", XS_Lucy_Object_I32Array_DESTROY },
        { "new", XS_Lucy_Index_Segment_new },
        { "add_field", XS_Lucy_Index_Segment_add_field },
        { "store_metadata", XS_Lucy_Index_Segment_store_metadata },
        { "fetch_metadata", XS_Lucy_Index_Segment_fetch_metadata },
        { "field_num", XS_Lucy_Index_Segment_field_num },
        { "field_name", XS_Lucy_Index_Segment_field_name },
        { "get_name", XS_Lucy_Index_Segment_get_name },
        { "get_number", XS_Lucy_Index_Segment_get_number },
        { "set_count", XS_Lucy_Index_Segment_set_count },
        { "get_count", XS_Lucy_Index_Segment_get_count },
        { "increment_count", XS_Lucy_Index_Segment_increment_count },
        { "get_metadata", XS_Lucy_Index_Segment_get_metadata },
        { "write_file", XS_Lucy_Index_Segment_write_file },
        { "read_file", XS_Lucy_Index_Segment_read_file },
        { "compare_to", XS_Lucy_Index_Segment_compare_to },
        { "DESTROY", XS_Lucy_Index_Segment_DESTROY },
        { "new", XS_Lucy_Index_Similarity_new },
        { "make_posting", XS_Lucy_Index_Similarity_make_posting },
        { "make_posting_writer", XS_Lucy_Index_Similarity_make_posting_writer },
        { "tf", XS_Lucy_Index_Similarity_tf },
        { "idf", XS_Lucy_Index_Similarity_idf },
        { "coord", XS_Lucy_Index_Similarity_coord },
        { "length_norm", XS_Lucy_Index_Similarity_length_norm },
        { "query_norm", XS_Lucy_Index_Similarity_query_norm },
        { "encode_norm", XS_Lucy_Index_Similarity_encode_norm },
        { "decode_norm", XS_Lucy_Index_Similarity_decode_norm },
        { "DESTROY", XS_Lucy_Index_Similarity_DESTROY },
        { "dump", XS_Lucy_Index_Similarity_dump },
        { "load", XS_Lucy_Index_Similarity_load },
        { "equals", XS_Lucy_Index_Similarity_equals },
        { "serialize", XS_Lucy_Index_Similarity_serialize },
        { "deserialize", XS_Lucy_Index_Similarity_deserialize },
        { "new", XS_Lucy_Index_TermInfo_new },
        { "get_doc_freq", XS_Lucy_Index_TermInfo_get_doc_freq },
        { "get_lex_filepos", XS_Lucy_Index_TermInfo_get_lex_filepos },
        { "get_post_filepos", XS_Lucy_Index_TermInfo_get_post_filepos },
        { "get_skip_filepos", XS_Lucy_Index_TermInfo_get_skip_filepos },
        { "set_doc_freq", XS_Lucy_Index_TermInfo_set_doc_freq },
        { "set_lex_filepos", XS_Lucy_Index_TermInfo_set_lex_filepos },
        { "set_post_filepos", XS_Lucy_Index_TermInfo_set_post_filepos },
        { "set_skip_filepos", XS_Lucy_Index_TermInfo_set_skip_filepos },
        { "reset", XS_Lucy_Index_TermInfo_reset },
        { "mimic", XS_Lucy_Index_TermInfo_mimic },
        { "clone", XS_Lucy_Index_TermInfo_clone },
        { "to_string", XS_Lucy_Index_TermInfo_to_string },
        { "new", XS_Lucy_Index_DataWriter_new },
        { "add_inverted_doc", XS_Lucy_Index_DataWriter_add_inverted_doc },
        { "add_segment", XS_Lucy_Index_DataWriter_add_segment },
        { "delete_segment", XS_Lucy_Index_DataWriter_delete_segment },
        { "merge_segment", XS_Lucy_Index_DataWriter_merge_segment },
        { "finish", XS_Lucy_Index_DataWriter_finish },
        { "metadata", XS_Lucy_Index_DataWriter_metadata },
        { "format", XS_Lucy_Index_DataWriter_format },
        { "get_snapshot", XS_Lucy_Index_DataWriter_get_snapshot },
        { "get_segment", XS_Lucy_Index_DataWriter_get_segment },
        { "get_polyreader", XS_Lucy_Index_DataWriter_get_polyreader },
        { "get_schema", XS_Lucy_Index_DataWriter_get_schema },
        { "get_folder", XS_Lucy_Index_DataWriter_get_folder },
        { "DESTROY", XS_Lucy_Index_DataWriter_DESTROY },
        { "new", XS_Lucy_Index_LexiconWriter_new },
        { "start_field", XS_Lucy_Index_LexiconWriter_start_field },
        { "finish_field", XS_Lucy_Index_LexiconWriter_finish_field },
        { "enter_temp_mode", XS_Lucy_Index_LexiconWriter_enter_temp_mode },
        { "leave_temp_mode", XS_Lucy_Index_LexiconWriter_leave_temp_mode },
        { "add_term", XS_Lucy_Index_LexiconWriter_add_term },
        { "add_segment", XS_Lucy_Index_LexiconWriter_add_segment },
        { "metadata", XS_Lucy_Index_LexiconWriter_metadata },
        { "format", XS_Lucy_Index_LexiconWriter_format },
        { "finish", XS_Lucy_Index_LexiconWriter_finish },
        { "DESTROY", XS_Lucy_Index_LexiconWriter_DESTROY },
        { "new", XS_Lucy_Index_HighlightWriter_new },
        { "tv_buf", XS_Lucy_Index_HighlightWriter_tv_buf },
        { "add_inverted_doc", XS_Lucy_Index_HighlightWriter_add_inverted_doc },
        { "add_segment", XS_Lucy_Index_HighlightWriter_add_segment },
        { "finish", XS_Lucy_Index_HighlightWriter_finish },
        { "format", XS_Lucy_Index_HighlightWriter_format },
        { "DESTROY", XS_Lucy_Index_HighlightWriter_DESTROY },
        { "new", XS_Lucy_Index_SortWriter_new },
        { "add_inverted_doc", XS_Lucy_Index_SortWriter_add_inverted_doc },
        { "add_segment", XS_Lucy_Index_SortWriter_add_segment },
        { "metadata", XS_Lucy_Index_SortWriter_metadata },
        { "format", XS_Lucy_Index_SortWriter_format },
        { "finish", XS_Lucy_Index_SortWriter_finish },
        { "DESTROY", XS_Lucy_Index_SortWriter_DESTROY },
        { "new", XS_Lucy_Index_DeletionsWriter_new },
        { "delete_by_term", XS_Lucy_Index_DeletionsWriter_delete_by_term },
        { "delete_by_query", XS_Lucy_Index_DeletionsWriter_delete_by_query },
        { "delete_by_doc_id", XS_Lucy_Index_DeletionsWriter_delete_by_doc_id },
        { "updated", XS_Lucy_Index_DeletionsWriter_updated },
        { "generate_doc_map", XS_Lucy_Index_DeletionsWriter_generate_doc_map },
        { "seg_deletions", XS_Lucy_Index_DeletionsWriter_seg_deletions },
        { "seg_del_count", XS_Lucy_Index_DeletionsWriter_seg_del_count },
        { "new", XS_Lucy_Index_DefaultDeletionsWriter_new },
        { "delete_by_term", XS_Lucy_Index_DefaultDeletionsWriter_delete_by_term },
        { "delete_by_query", XS_Lucy_Index_DefaultDeletionsWriter_delete_by_query },
        { "delete_by_doc_id", XS_Lucy_Index_DefaultDeletionsWriter_delete_by_doc_id },
        { "updated", XS_Lucy_Index_DefaultDeletionsWriter_updated },
        { "seg_deletions", XS_Lucy_Index_DefaultDeletionsWriter_seg_deletions },
        { "seg_del_count", XS_Lucy_Index_DefaultDeletionsWriter_seg_del_count },
        { "add_segment", XS_Lucy_Index_DefaultDeletionsWriter_add_segment },
        { "merge_segment", XS_Lucy_Index_DefaultDeletionsWriter_merge_segment },
        { "finish", XS_Lucy_Index_DefaultDeletionsWriter_finish },
        { "format", XS_Lucy_Index_DefaultDeletionsWriter_format },
        { "metadata", XS_Lucy_Index_DefaultDeletionsWriter_metadata },
        { "DESTROY", XS_Lucy_Index_DefaultDeletionsWriter_DESTROY },
        { "new", XS_Lucy_Index_DocWriter_new },
        { "add_inverted_doc", XS_Lucy_Index_DocWriter_add_inverted_doc },
        { "add_segment", XS_Lucy_Index_DocWriter_add_segment },
        { "finish", XS_Lucy_Index_DocWriter_finish },
        { "format", XS_Lucy_Index_DocWriter_format },
        { "DESTROY", XS_Lucy_Index_DocWriter_DESTROY },
        { "new", XS_Lucy_Index_Posting_PostingWriter_new },
        { "write_posting", XS_Lucy_Index_Posting_PostingWriter_write_posting },
        { "start_term", XS_Lucy_Index_Posting_PostingWriter_start_term },
        { "update_skip_info", XS_Lucy_Index_Posting_PostingWriter_update_skip_info },
        { "new", XS_Lucy_Index_Posting_RawPostingWriter_new },
        { "DESTROY", XS_Lucy_Index_Posting_RawPostingWriter_DESTROY },
        { "start_term", XS_Lucy_Index_Posting_RawPostingWriter_start_term },
        { "update_skip_info", XS_Lucy_Index_Posting_RawPostingWriter_update_skip_info },
        { "write_posting", XS_Lucy_Index_Posting_RawPostingWriter_write_posting },
        { "new", XS_Lucy_Index_Posting_MatchPostingWriter_new },
        { "DESTROY", XS_Lucy_Index_Posting_MatchPostingWriter_DESTROY },
        { "write_posting", XS_Lucy_Index_Posting_MatchPostingWriter_write_posting },
        { "start_term", XS_Lucy_Index_Posting_MatchPostingWriter_start_term },
        { "update_skip_info", XS_Lucy_Index_Posting_MatchPostingWriter_update_skip_info },
        { "new", XS_Lucy_Index_SegWriter_new },
        { "register", XS_Lucy_Index_SegWriter_register },
        { "fetch", XS_Lucy_Index_SegWriter_fetch },
        { "add_writer", XS_Lucy_Index_SegWriter_add_writer },
        { "prep_seg_dir", XS_Lucy_Index_SegWriter_prep_seg_dir },
        { "add_doc", XS_Lucy_Index_SegWriter_add_doc },
        { "set_del_writer", XS_Lucy_Index_SegWriter_set_del_writer },
        { "get_del_writer", XS_Lucy_Index_SegWriter_get_del_writer },
        { "add_inverted_doc", XS_Lucy_Index_SegWriter_add_inverted_doc },
        { "add_segment", XS_Lucy_Index_SegWriter_add_segment },
        { "merge_segment", XS_Lucy_Index_SegWriter_merge_segment },
        { "delete_segment", XS_Lucy_Index_SegWriter_delete_segment },
        { "finish", XS_Lucy_Index_SegWriter_finish },
        { "DESTROY", XS_Lucy_Index_SegWriter_DESTROY },
        { "new", XS_Lucy_Index_PostingListWriter_new },
        { "add_inverted_doc", XS_Lucy_Index_PostingListWriter_add_inverted_doc },
        { "add_segment", XS_Lucy_Index_PostingListWriter_add_segment },
        { "finish", XS_Lucy_Index_PostingListWriter_finish },
        { "format", XS_Lucy_Index_PostingListWriter_format },
        { "DESTROY", XS_Lucy_Index_PostingListWriter_DESTROY },
        { "new", XS_Lucy_Index_Snapshot_new },
        { "list", XS_Lucy_Index_Snapshot_list },
        { "num_entries", XS_Lucy_Index_Snapshot_num_entries },
        { "add_entry", XS_Lucy_Index_Snapshot_add_entry },
        { "delete_entry", XS_Lucy_Index_Snapshot_delete_entry },
        { "read_file", XS_Lucy_Index_Snapshot_read_file },
        { "write_file", XS_Lucy_Index_Snapshot_write_file },
        { "set_path", XS_Lucy_Index_Snapshot_set_path },
        { "get_path", XS_Lucy_Index_Snapshot_get_path },
        { "DESTROY", XS_Lucy_Index_Snapshot_DESTROY },
        { "get_cardinality", XS_Lucy_Index_SortCache_get_cardinality },
        { "get_ord_width", XS_Lucy_Index_SortCache_get_ord_width },
        { "get_null_ord", XS_Lucy_Index_SortCache_get_null_ord },
        { "ordinal", XS_Lucy_Index_SortCache_ordinal },
        { "find", XS_Lucy_Index_SortCache_find },
        { "set_native_ords", XS_Lucy_Index_SortCache_set_native_ords },
        { "get_native_ords", XS_Lucy_Index_SortCache_get_native_ords },
        { "DESTROY", XS_Lucy_Index_SortCache_DESTROY },
        { "new", XS_Lucy_Index_SortCache_TextSortCache_new },
        { "DESTROY", XS_Lucy_Index_SortCache_TextSortCache_DESTROY },
        { "new", XS_Lucy_Index_SortCache_NumericSortCache_new },
        { "DESTROY", XS_Lucy_Index_SortCache_NumericSortCache_DESTROY },
        { "new", XS_Lucy_Index_SortCache_Float64SortCache_new },
        { "new", XS_Lucy_Index_SortCache_Float32SortCache_new },
        { "new", XS_Lucy_Index_SortCache_Int32SortCache_new },
        { "new", XS_Lucy_Index_SortCache_Int64SortCache_new },
        { "new", XS_Lucy_Index_DataReader_new },
        { "aggregator", XS_Lucy_Index_DataReader_aggregator },
        { "get_schema", XS_Lucy_Index_DataReader_get_schema },
        { "get_folder", XS_Lucy_Index_DataReader_get_folder },
        { "get_snapshot", XS_Lucy_Index_DataReader_get_snapshot },
        { "get_segments", XS_Lucy_Index_DataReader_get_segments },
        { "get_segment", XS_Lucy_Index_DataReader_get_segment },
        { "get_seg_tick", XS_Lucy_Index_DataReader_get_seg_tick },
        { "close", XS_Lucy_Index_DataReader_close },
        { "DESTROY", XS_Lucy_Index_DataReader_DESTROY },
        { "new", XS_Lucy_Index_LexiconReader_new },
        { "lexicon", XS_Lucy_Index_LexiconReader_lexicon },
        { "doc_freq", XS_Lucy_Index_LexiconReader_doc_freq },
        { "fetch_term_info", XS_Lucy_Index_LexiconReader_fetch_term_info },
        { "aggregator", XS_Lucy_Index_LexiconReader_aggregator },
        { "new", XS_Lucy_Index_PolyLexiconReader_new },
        { "lexicon", XS_Lucy_Index_PolyLexiconReader_lexicon },
        { "doc_freq", XS_Lucy_Index_PolyLexiconReader_doc_freq },
        { "close", XS_Lucy_Index_PolyLexiconReader_close },
        { "DESTROY", XS_Lucy_Index_PolyLexiconReader_DESTROY },
        { "new", XS_Lucy_Index_DefaultLexiconReader_new },
        { "lexicon", XS_Lucy_Index_DefaultLexiconReader_lexicon },
        { "doc_freq", XS_Lucy_Index_DefaultLexiconReader_doc_freq },
        { "fetch_term_info", XS_Lucy_Index_DefaultLexiconReader_fetch_term_info },
        { "close", XS_Lucy_Index_DefaultLexiconReader_close },
        { "DESTROY", XS_Lucy_Index_DefaultLexiconReader_DESTROY },
        { "new", XS_Lucy_Index_HighlightReader_new },
        { "fetch_doc_vec", XS_Lucy_Index_HighlightReader_fetch_doc_vec },
        { "aggregator", XS_Lucy_Index_HighlightReader_aggregator },
        { "new", XS_Lucy_Index_PolyHighlightReader_new },
        { "fetch_doc_vec", XS_Lucy_Index_PolyHighlightReader_fetch_doc_vec },
        { "close", XS_Lucy_Index_PolyHighlightReader_close },
        { "DESTROY", XS_Lucy_Index_PolyHighlightReader_DESTROY },
        { "new", XS_Lucy_Index_DefaultHighlightReader_new },
        { "fetch_doc_vec", XS_Lucy_Index_DefaultHighlightReader_fetch_doc_vec },
        { "read_record", XS_Lucy_Index_DefaultHighlightReader_read_record },
        { "close", XS_Lucy_Index_DefaultHighlightReader_close },
        { "DESTROY", XS_Lucy_Index_DefaultHighlightReader_DESTROY },
        { "new", XS_Lucy_Index_PostingListReader_new },
        { "posting_list", XS_Lucy_Index_PostingListReader_posting_list },
        { "get_lex_reader", XS_Lucy_Index_PostingListReader_get_lex_reader },
        { "aggregator", XS_Lucy_Index_PostingListReader_aggregator },
        { "new", XS_Lucy_Index_DefaultPostingListReader_new },
        { "posting_list", XS_Lucy_Index_DefaultPostingListReader_posting_list },
        { "get_lex_reader", XS_Lucy_Index_DefaultPostingListReader_get_lex_reader },
        { "close", XS_Lucy_Index_DefaultPostingListReader_close },
        { "DESTROY", XS_Lucy_Index_DefaultPostingListReader_DESTROY },
        { "new", XS_Lucy_Index_SortReader_new },
        { "fetch_sort_cache", XS_Lucy_Index_SortReader_fetch_sort_cache },
        { "aggregator", XS_Lucy_Index_SortReader_aggregator },
        { "new", XS_Lucy_Index_DefaultSortReader_new },
        { "fetch_sort_cache", XS_Lucy_Index_DefaultSortReader_fetch_sort_cache },
        { "close", XS_Lucy_Index_DefaultSortReader_close },
        { "DESTROY", XS_Lucy_Index_DefaultSortReader_DESTROY },
        { "open", XS_Lucy_Index_IndexReader_open },
        { "doc_max", XS_Lucy_Index_IndexReader_doc_max },
        { "doc_count", XS_Lucy_Index_IndexReader_doc_count },
        { "del_count", XS_Lucy_Index_IndexReader_del_count },
        { "_offsets", XS_Lucy_Index_IndexReader__offsets },
        { "seg_readers", XS_Lucy_Index_IndexReader_seg_readers },
        { "obtain", XS_Lucy_Index_IndexReader_obtain },
        { "fetch", XS_Lucy_Index_IndexReader_fetch },
        { "close", XS_Lucy_Index_IndexReader_close },
        { "get_components", XS_Lucy_Index_IndexReader_get_components },
        { "DESTROY", XS_Lucy_Index_IndexReader_DESTROY },
        { "open", XS_Lucy_Index_PolyReader_open },
        { "new", XS_Lucy_Index_PolyReader_new },
        { "doc_max", XS_Lucy_Index_PolyReader_doc_max },
        { "doc_count", XS_Lucy_Index_PolyReader_doc_count },
        { "del_count", XS_Lucy_Index_PolyReader_del_count },
        { "_offsets", XS_Lucy_Index_PolyReader__offsets },
        { "seg_readers", XS_Lucy_Index_PolyReader_seg_readers },
        { "get_seg_readers", XS_Lucy_Index_PolyReader_get_seg_readers },
        { "close", XS_Lucy_Index_PolyReader_close },
        { "DESTROY", XS_Lucy_Index_PolyReader_DESTROY },
        { "new", XS_Lucy_Index_SegReader_new },
        { "DESTROY", XS_Lucy_Index_SegReader_DESTROY },
        { "register", XS_Lucy_Index_SegReader_register },
        { "get_seg_name", XS_Lucy_Index_SegReader_get_seg_name },
        { "get_seg_num", XS_Lucy_Index_SegReader_get_seg_num },
        { "del_count", XS_Lucy_Index_SegReader_del_count },
        { "doc_max", XS_Lucy_Index_SegReader_doc_max },
        { "doc_count", XS_Lucy_Index_SegReader_doc_count },
        { "_offsets", XS_Lucy_Index_SegReader__offsets },
        { "seg_readers", XS_Lucy_Index_SegReader_seg_readers },
        { "new", XS_Lucy_Index_DeletionsReader_new },
        { "del_count", XS_Lucy_Index_DeletionsReader_del_count },
        { "iterator", XS_Lucy_Index_DeletionsReader_iterator },
        { "aggregator", XS_Lucy_Index_DeletionsReader_aggregator },
        { "new", XS_Lucy_Index_PolyDeletionsReader_new },
        { "del_count", XS_Lucy_Index_PolyDeletionsReader_del_count },
        { "iterator", XS_Lucy_Index_PolyDeletionsReader_iterator },
        { "close", XS_Lucy_Index_PolyDeletionsReader_close },
        { "DESTROY", XS_Lucy_Index_PolyDeletionsReader_DESTROY },
        { "new", XS_Lucy_Index_DefaultDeletionsReader_new },
        { "del_count", XS_Lucy_Index_DefaultDeletionsReader_del_count },
        { "iterator", XS_Lucy_Index_DefaultDeletionsReader_iterator },
        { "read_deletions", XS_Lucy_Index_DefaultDeletionsReader_read_deletions },
        { "close", XS_Lucy_Index_DefaultDeletionsReader_close },
        { "DESTROY", XS_Lucy_Index_DefaultDeletionsReader_DESTROY },
        { "new", XS_Lucy_Index_DocReader_new },
        { "fetch_doc", XS_Lucy_Index_DocReader_fetch_doc },
        { "aggregator", XS_Lucy_Index_DocReader_aggregator },
        { "new", XS_Lucy_Index_PolyDocReader_new },
        { "fetch_doc", XS_Lucy_Index_PolyDocReader_fetch_doc },
        { "close", XS_Lucy_Index_PolyDocReader_close },
        { "DESTROY", XS_Lucy_Index_PolyDocReader_DESTROY },
        { "new", XS_Lucy_Index_DefaultDocReader_new },
        { "fetch_doc", XS_Lucy_Index_DefaultDocReader_fetch_doc },
        { "read_record", XS_Lucy_Index_DefaultDocReader_read_record },
        { "close", XS_Lucy_Index_DefaultDocReader_close },
        { "DESTROY", XS_Lucy_Index_DefaultDocReader_DESTROY },
        { "new", XS_Lucy_Index_Counter_new },
        { "add", XS_Lucy_Index_Counter_add },
        { "get_value", XS_Lucy_Index_Counter_get_value },
        { "reset", XS_Lucy_Index_Counter_reset },
        { "DESTROY", XS_Lucy_Index_SortFieldWriter_SFWriterElem_DESTROY },
        { "new", XS_Lucy_Index_FilePurger_new },
        { "purge", XS_Lucy_Index_FilePurger_purge },
        { "DESTROY", XS_Lucy_Index_FilePurger_DESTROY },
        { "new", XS_Lucy_Index_BackgroundMerger_new },
        { "optimize", XS_Lucy_Index_BackgroundMerger_optimize },
        { "commit", XS_Lucy_Index_BackgroundMerger_commit },
        { "prepare_commit", XS_Lucy_Index_BackgroundMerger_prepare_commit },
        { "DESTROY", XS_Lucy_Index_BackgroundMerger_DESTROY },
        { "new", XS_Lucy_Index_Lexicon_new },
        { "DESTROY", XS_Lucy_Index_Lexicon_DESTROY },
        { "seek", XS_Lucy_Index_Lexicon_seek },
        { "next", XS_Lucy_Index_Lexicon_next },
        { "reset", XS_Lucy_Index_Lexicon_reset },
        { "doc_freq", XS_Lucy_Index_Lexicon_doc_freq },
        { "get_term", XS_Lucy_Index_Lexicon_get_term },
        { "get_field", XS_Lucy_Index_Lexicon_get_field },
        { "new", XS_Lucy_Index_RawLexicon_new },
        { "DESTROY", XS_Lucy_Index_RawLexicon_DESTROY },
        { "next", XS_Lucy_Index_RawLexicon_next },
        { "get_term", XS_Lucy_Index_RawLexicon_get_term },
        { "doc_freq", XS_Lucy_Index_RawLexicon_doc_freq },
        { "new", XS_Lucy_Index_SegLexicon_new },
        { "get_term_info", XS_Lucy_Index_SegLexicon_get_term_info },
        { "get_field_num", XS_Lucy_Index_SegLexicon_get_field_num },
        { "get_segment", XS_Lucy_Index_SegLexicon_get_segment },
        { "DESTROY", XS_Lucy_Index_SegLexicon_DESTROY },
        { "seek", XS_Lucy_Index_SegLexicon_seek },
        { "reset", XS_Lucy_Index_SegLexicon_reset },
        { "get_term", XS_Lucy_Index_SegLexicon_get_term },
        { "doc_freq", XS_Lucy_Index_SegLexicon_doc_freq },
        { "next", XS_Lucy_Index_SegLexicon_next },
        { "new", XS_Lucy_Index_LexIndex_new },
        { "seek", XS_Lucy_Index_LexIndex_seek },
        { "get_term_num", XS_Lucy_Index_LexIndex_get_term_num },
        { "get_term_info", XS_Lucy_Index_LexIndex_get_term_info },
        { "get_term", XS_Lucy_Index_LexIndex_get_term },
        { "DESTROY", XS_Lucy_Index_LexIndex_DESTROY },
        { "new", XS_Lucy_Index_PolyLexicon_new },
        { "seek", XS_Lucy_Index_PolyLexicon_seek },
        { "next", XS_Lucy_Index_PolyLexicon_next },
        { "reset", XS_Lucy_Index_PolyLexicon_reset },
        { "get_term", XS_Lucy_Index_PolyLexicon_get_term },
        { "get_num_seg_lexicons", XS_Lucy_Index_PolyLexicon_get_num_seg_lexicons },
        { "DESTROY", XS_Lucy_Index_PolyLexicon_DESTROY },
        { "_new", XS_Lucy_Index_Indexer__new },
        { "add_index", XS_Lucy_Index_Indexer_add_index },
        { "delete_by_term", XS_Lucy_Index_Indexer_delete_by_term },
        { "delete_by_query", XS_Lucy_Index_Indexer_delete_by_query },
        { "delete_by_doc_id", XS_Lucy_Index_Indexer_delete_by_doc_id },
        { "optimize", XS_Lucy_Index_Indexer_optimize },
        { "commit", XS_Lucy_Index_Indexer_commit },
        { "prepare_commit", XS_Lucy_Index_Indexer_prepare_commit },
        { "get_schema", XS_Lucy_Index_Indexer_get_schema },
        { "get_seg_writer", XS_Lucy_Index_Indexer_get_seg_writer },
        { "get_stock_doc", XS_Lucy_Index_Indexer_get_stock_doc },
        { "DESTROY", XS_Lucy_Index_Indexer_DESTROY },
        { "new", XS_Lucy_Index_TermVector_new },
        { "get_positions", XS_Lucy_Index_TermVector_get_positions },
        { "get_start_offsets", XS_Lucy_Index_TermVector_get_start_offsets },
        { "get_end_offsets", XS_Lucy_Index_TermVector_get_end_offsets },
        { "serialize", XS_Lucy_Index_TermVector_serialize },
        { "deserialize", XS_Lucy_Index_TermVector_deserialize },
        { "equals", XS_Lucy_Index_TermVector_equals },
        { "DESTROY", XS_Lucy_Index_TermVector_DESTROY },
        { "new", XS_Lucy_Index_DocVector_new },
        { "term_vector", XS_Lucy_Index_DocVector_term_vector },
        { "add_field_buf", XS_Lucy_Index_DocVector_add_field_buf },
        { "field_buf", XS_Lucy_Index_DocVector_field_buf },
        { "serialize", XS_Lucy_Index_DocVector_serialize },
        { "deserialize", XS_Lucy_Index_DocVector_deserialize },
        { "DESTROY", XS_Lucy_Index_DocVector_DESTROY },
        { "new", XS_Lucy_Index_Inverter_new },
        { "invert_doc", XS_Lucy_Index_Inverter_invert_doc },
        { "set_doc", XS_Lucy_Index_Inverter_set_doc },
        { "set_boost", XS_Lucy_Index_Inverter_set_boost },
        { "add_field", XS_Lucy_Index_Inverter_add_field },
        { "clear", XS_Lucy_Index_Inverter_clear },
        { "iterate", XS_Lucy_Index_Inverter_iterate },
        { "next", XS_Lucy_Index_Inverter_next },
        { "get_doc", XS_Lucy_Index_Inverter_get_doc },
        { "get_boost", XS_Lucy_Index_Inverter_get_boost },
        { "get_field_name", XS_Lucy_Index_Inverter_get_field_name },
        { "get_value", XS_Lucy_Index_Inverter_get_value },
        { "get_type", XS_Lucy_Index_Inverter_get_type },
        { "get_analyzer", XS_Lucy_Index_Inverter_get_analyzer },
        { "get_similarity", XS_Lucy_Index_Inverter_get_similarity },
        { "get_inversion", XS_Lucy_Index_Inverter_get_inversion },
        { "DESTROY", XS_Lucy_Index_Inverter_DESTROY },
        { "new", XS_Lucy_Index_Inverter_InverterEntry_new },
        { "compare_to", XS_Lucy_Index_Inverter_InverterEntry_compare_to },
        { "clear", XS_Lucy_Index_Inverter_InverterEntry_clear },
        { "DESTROY", XS_Lucy_Index_Inverter_InverterEntry_DESTROY },
        { "new", XS_Lucy_Index_IndexManager_new },
        { "DESTROY", XS_Lucy_Index_IndexManager_DESTROY },
        { "set_folder", XS_Lucy_Index_IndexManager_set_folder },
        { "get_folder", XS_Lucy_Index_IndexManager_get_folder },
        { "get_host", XS_Lucy_Index_IndexManager_get_host },
        { "recycle", XS_Lucy_Index_IndexManager_recycle },
        { "choose_sparse", XS_Lucy_Index_IndexManager_choose_sparse },
        { "make_write_lock", XS_Lucy_Index_IndexManager_make_write_lock },
        { "make_deletion_lock", XS_Lucy_Index_IndexManager_make_deletion_lock },
        { "make_merge_lock", XS_Lucy_Index_IndexManager_make_merge_lock },
        { "write_merge_data", XS_Lucy_Index_IndexManager_write_merge_data },
        { "read_merge_data", XS_Lucy_Index_IndexManager_read_merge_data },
        { "remove_merge_data", XS_Lucy_Index_IndexManager_remove_merge_data },
        { "make_snapshot_read_lock", XS_Lucy_Index_IndexManager_make_snapshot_read_lock },
        { "highest_seg_num", XS_Lucy_Index_IndexManager_highest_seg_num },
        { "make_snapshot_filename", XS_Lucy_Index_IndexManager_make_snapshot_filename },
        { "set_write_lock_timeout", XS_Lucy_Index_IndexManager_set_write_lock_timeout },
        { "get_write_lock_timeout", XS_Lucy_Index_IndexManager_get_write_lock_timeout },
        { "set_write_lock_interval", XS_Lucy_Index_IndexManager_set_write_lock_interval },
        { "get_write_lock_interval", XS_Lucy_Index_IndexManager_get_write_lock_interval },
        { "set_merge_lock_timeout", XS_Lucy_Index_IndexManager_set_merge_lock_timeout },
        { "get_merge_lock_timeout", XS_Lucy_Index_IndexManager_get_merge_lock_timeout },
        { "set_merge_lock_interval", XS_Lucy_Index_IndexManager_set_merge_lock_interval },
        { "get_merge_lock_interval", XS_Lucy_Index_IndexManager_get_merge_lock_interval },
        { "set_deletion_lock_timeout", XS_Lucy_Index_IndexManager_set_deletion_lock_timeout },
        { "get_deletion_lock_timeout", XS_Lucy_Index_IndexManager_get_deletion_lock_timeout },
        { "set_deletion_lock_interval", XS_Lucy_Index_IndexManager_set_deletion_lock_interval },
        { "get_deletion_lock_interval", XS_Lucy_Index_IndexManager_get_deletion_lock_interval },
        { "new", XS_Lucy_Store_RAMFile_new },
        { "get_contents", XS_Lucy_Store_RAMFile_get_contents },
        { "read_only", XS_Lucy_Store_RAMFile_read_only },
        { "set_read_only", XS_Lucy_Store_RAMFile_set_read_only },
        { "DESTROY", XS_Lucy_Store_RAMFile_DESTROY },
        { "new", XS_Lucy_Store_Lock_new },
        { "shared", XS_Lucy_Store_Lock_shared },
        { "obtain", XS_Lucy_Store_Lock_obtain },
        { "request", XS_Lucy_Store_Lock_request },
        { "release", XS_Lucy_Store_Lock_release },
        { "is_locked", XS_Lucy_Store_Lock_is_locked },
        { "clear_stale", XS_Lucy_Store_Lock_clear_stale },
        { "get_name", XS_Lucy_Store_Lock_get_name },
        { "get_host", XS_Lucy_Store_Lock_get_host },
        { "get_lock_path", XS_Lucy_Store_Lock_get_lock_path },
        { "DESTROY", XS_Lucy_Store_Lock_DESTROY },
        { "new", XS_Lucy_Store_LockFileLock_new },
        { "shared", XS_Lucy_Store_LockFileLock_shared },
        { "request", XS_Lucy_Store_LockFileLock_request },
        { "release", XS_Lucy_Store_LockFileLock_release },
        { "is_locked", XS_Lucy_Store_LockFileLock_is_locked },
        { "clear_stale", XS_Lucy_Store_LockFileLock_clear_stale },
        { "maybe_delete_file", XS_Lucy_Store_LockFileLock_maybe_delete_file },
        { "DESTROY", XS_Lucy_Store_LockFileLock_DESTROY },
        { "new", XS_Lucy_Store_SharedLock_new },
        { "shared", XS_Lucy_Store_SharedLock_shared },
        { "request", XS_Lucy_Store_SharedLock_request },
        { "release", XS_Lucy_Store_SharedLock_release },
        { "is_locked", XS_Lucy_Store_SharedLock_is_locked },
        { "clear_stale", XS_Lucy_Store_SharedLock_clear_stale },
        { "open", XS_Lucy_Store_OutStream_open },
        { "get_path", XS_Lucy_Store_OutStream_get_path },
        { "tell", XS_Lucy_Store_OutStream_tell },
        { "align", XS_Lucy_Store_OutStream_align },
        { "flush", XS_Lucy_Store_OutStream_flush },
        { "length", XS_Lucy_Store_OutStream_length },
        { "grow", XS_Lucy_Store_OutStream_grow },
        { "write_i8", XS_Lucy_Store_OutStream_write_i8 },
        { "write_u8", XS_Lucy_Store_OutStream_write_u8 },
        { "write_i32", XS_Lucy_Store_OutStream_write_i32 },
        { "write_u32", XS_Lucy_Store_OutStream_write_u32 },
        { "write_i64", XS_Lucy_Store_OutStream_write_i64 },
        { "write_u64", XS_Lucy_Store_OutStream_write_u64 },
        { "write_ci32", XS_Lucy_Store_OutStream_write_ci32 },
        { "write_cu32", XS_Lucy_Store_OutStream_write_cu32 },
        { "write_ci64", XS_Lucy_Store_OutStream_write_ci64 },
        { "write_cu64", XS_Lucy_Store_OutStream_write_cu64 },
        { "write_f32", XS_Lucy_Store_OutStream_write_f32 },
        { "write_f64", XS_Lucy_Store_OutStream_write_f64 },
        { "absorb", XS_Lucy_Store_OutStream_absorb },
        { "close", XS_Lucy_Store_OutStream_close },
        { "DESTROY", XS_Lucy_Store_OutStream_DESTROY },
        { "open", XS_Lucy_Store_InStream_open },
        { "reopen", XS_Lucy_Store_InStream_reopen },
        { "clone", XS_Lucy_Store_InStream_clone },
        { "close", XS_Lucy_Store_InStream_close },
        { "DESTROY", XS_Lucy_Store_InStream_DESTROY },
        { "seek", XS_Lucy_Store_InStream_seek },
        { "tell", XS_Lucy_Store_InStream_tell },
        { "length", XS_Lucy_Store_InStream_length },
        { "refill", XS_Lucy_Store_InStream_refill },
        { "fill", XS_Lucy_Store_InStream_fill },
        { "read_i8", XS_Lucy_Store_InStream_read_i8 },
        { "read_u8", XS_Lucy_Store_InStream_read_u8 },
        { "read_i32", XS_Lucy_Store_InStream_read_i32 },
        { "read_u32", XS_Lucy_Store_InStream_read_u32 },
        { "read_i64", XS_Lucy_Store_InStream_read_i64 },
        { "read_u64", XS_Lucy_Store_InStream_read_u64 },
        { "read_f32", XS_Lucy_Store_InStream_read_f32 },
        { "read_f64", XS_Lucy_Store_InStream_read_f64 },
        { "read_ci32", XS_Lucy_Store_InStream_read_ci32 },
        { "read_cu32", XS_Lucy_Store_InStream_read_cu32 },
        { "read_ci64", XS_Lucy_Store_InStream_read_ci64 },
        { "read_cu64", XS_Lucy_Store_InStream_read_cu64 },
        { "get_filename", XS_Lucy_Store_InStream_get_filename },
        { "get_window", XS_Lucy_Store_InStream_get_window },
        { "get_handle", XS_Lucy_Store_InStream_get_handle },
        { "bytes_in_buf", XS_Lucy_Store_InStream_bytes_in_buf },
        { "_open", XS_Lucy_Store_FileHandle__open },
        { "window", XS_Lucy_Store_FileHandle_window },
        { "release_window", XS_Lucy_Store_FileHandle_release_window },
        { "length", XS_Lucy_Store_FileHandle_length },
        { "grow", XS_Lucy_Store_FileHandle_grow },
        { "close", XS_Lucy_Store_FileHandle_close },
        { "set_path", XS_Lucy_Store_FileHandle_set_path },
        { "get_path", XS_Lucy_Store_FileHandle_get_path },
        { "DESTROY", XS_Lucy_Store_FileHandle_DESTROY },
        { "_open", XS_Lucy_Store_FSFileHandle__open },
        { "window", XS_Lucy_Store_FSFileHandle_window },
        { "release_window", XS_Lucy_Store_FSFileHandle_release_window },
        { "length", XS_Lucy_Store_FSFileHandle_length },
        { "close", XS_Lucy_Store_FSFileHandle_close },
        { "set_fd", XS_Lucy_Store_FSFileHandle_set_fd },
        { "_open", XS_Lucy_Store_RAMFileHandle__open },
        { "get_file", XS_Lucy_Store_RAMFileHandle_get_file },
        { "grow", XS_Lucy_Store_RAMFileHandle_grow },
        { "DESTROY", XS_Lucy_Store_RAMFileHandle_DESTROY },
        { "window", XS_Lucy_Store_RAMFileHandle_window },
        { "release_window", XS_Lucy_Store_RAMFileHandle_release_window },
        { "length", XS_Lucy_Store_RAMFileHandle_length },
        { "close", XS_Lucy_Store_RAMFileHandle_close },
        { "new", XS_Lucy_Store_Folder_new },
        { "DESTROY", XS_Lucy_Store_Folder_DESTROY },
        { "get_path", XS_Lucy_Store_Folder_get_path },
        { "set_path", XS_Lucy_Store_Folder_set_path },
        { "open_out", XS_Lucy_Store_Folder_open_out },
        { "open_in", XS_Lucy_Store_Folder_open_in },
        { "open_filehandle", XS_Lucy_Store_Folder_open_filehandle },
        { "open_dir", XS_Lucy_Store_Folder_open_dir },
        { "mkdir", XS_Lucy_Store_Folder_mkdir },
        { "list", XS_Lucy_Store_Folder_list },
        { "list_r", XS_Lucy_Store_Folder_list_r },
        { "exists", XS_Lucy_Store_Folder_exists },
        { "is_directory", XS_Lucy_Store_Folder_is_directory },
        { "delete", XS_Lucy_Store_Folder_delete },
        { "delete_tree", XS_Lucy_Store_Folder_delete_tree },
        { "rename", XS_Lucy_Store_Folder_rename },
        { "hard_link", XS_Lucy_Store_Folder_hard_link },
        { "slurp_file", XS_Lucy_Store_Folder_slurp_file },
        { "consolidate", XS_Lucy_Store_Folder_consolidate },
        { "enclosing_folder", XS_Lucy_Store_Folder_enclosing_folder },
        { "find_folder", XS_Lucy_Store_Folder_find_folder },
        { "initialize", XS_Lucy_Store_Folder_initialize },
        { "check", XS_Lucy_Store_Folder_check },
        { "close", XS_Lucy_Store_Folder_close },
        { "local_open_filehandle", XS_Lucy_Store_Folder_local_open_filehandle },
        { "local_open_in", XS_Lucy_Store_Folder_local_open_in },
        { "local_open_dir", XS_Lucy_Store_Folder_local_open_dir },
        { "local_mkdir", XS_Lucy_Store_Folder_local_mkdir },
        { "local_exists", XS_Lucy_Store_Folder_local_exists },
        { "local_is_directory", XS_Lucy_Store_Folder_local_is_directory },
        { "local_find_folder", XS_Lucy_Store_Folder_local_find_folder },
        { "local_delete", XS_Lucy_Store_Folder_local_delete },
        { "new", XS_Lucy_Store_FSFolder_new },
        { "initialize", XS_Lucy_Store_FSFolder_initialize },
        { "check", XS_Lucy_Store_FSFolder_check },
        { "close", XS_Lucy_Store_FSFolder_close },
        { "local_open_filehandle", XS_Lucy_Store_FSFolder_local_open_filehandle },
        { "local_open_dir", XS_Lucy_Store_FSFolder_local_open_dir },
        { "local_mkdir", XS_Lucy_Store_FSFolder_local_mkdir },
        { "local_exists", XS_Lucy_Store_FSFolder_local_exists },
        { "local_is_directory", XS_Lucy_Store_FSFolder_local_is_directory },
        { "local_find_folder", XS_Lucy_Store_FSFolder_local_find_folder },
        { "local_delete", XS_Lucy_Store_FSFolder_local_delete },
        { "rename", XS_Lucy_Store_FSFolder_rename },
        { "hard_link", XS_Lucy_Store_FSFolder_hard_link },
        { "new", XS_Lucy_Store_RAMFolder_new },
        { "initialize", XS_Lucy_Store_RAMFolder_initialize },
        { "check", XS_Lucy_Store_RAMFolder_check },
        { "close", XS_Lucy_Store_RAMFolder_close },
        { "local_open_filehandle", XS_Lucy_Store_RAMFolder_local_open_filehandle },
        { "local_open_dir", XS_Lucy_Store_RAMFolder_local_open_dir },
        { "local_mkdir", XS_Lucy_Store_RAMFolder_local_mkdir },
        { "local_exists", XS_Lucy_Store_RAMFolder_local_exists },
        { "local_is_directory", XS_Lucy_Store_RAMFolder_local_is_directory },
        { "local_find_folder", XS_Lucy_Store_RAMFolder_local_find_folder },
        { "local_delete", XS_Lucy_Store_RAMFolder_local_delete },
        { "rename", XS_Lucy_Store_RAMFolder_rename },
        { "hard_link", XS_Lucy_Store_RAMFolder_hard_link },
        { "get_real_folder", XS_Lucy_Store_CompoundFileReader_get_real_folder },
        { "set_path", XS_Lucy_Store_CompoundFileReader_set_path },
        { "close", XS_Lucy_Store_CompoundFileReader_close },
        { "DESTROY", XS_Lucy_Store_CompoundFileReader_DESTROY },
        { "local_delete", XS_Lucy_Store_CompoundFileReader_local_delete },
        { "local_exists", XS_Lucy_Store_CompoundFileReader_local_exists },
        { "local_is_directory", XS_Lucy_Store_CompoundFileReader_local_is_directory },
        { "local_open_filehandle", XS_Lucy_Store_CompoundFileReader_local_open_filehandle },
        { "local_open_in", XS_Lucy_Store_CompoundFileReader_local_open_in },
        { "local_mkdir", XS_Lucy_Store_CompoundFileReader_local_mkdir },
        { "local_find_folder", XS_Lucy_Store_CompoundFileReader_local_find_folder },
        { "local_open_dir", XS_Lucy_Store_CompoundFileReader_local_open_dir },
        { "new", XS_Lucy_Store_DirHandle_new },
        { "next", XS_Lucy_Store_DirHandle_next },
        { "close", XS_Lucy_Store_DirHandle_close },
        { "get_dir", XS_Lucy_Store_DirHandle_get_dir },
        { "get_entry", XS_Lucy_Store_DirHandle_get_entry },
        { "entry_is_dir", XS_Lucy_Store_DirHandle_entry_is_dir },
        { "entry_is_symlink", XS_Lucy_Store_DirHandle_entry_is_symlink },
        { "DESTROY", XS_Lucy_Store_DirHandle_DESTROY },
        { "next", XS_Lucy_Store_FSDirHandle_next },
        { "entry_is_dir", XS_Lucy_Store_FSDirHandle_entry_is_dir },
        { "entry_is_symlink", XS_Lucy_Store_FSDirHandle_entry_is_symlink },
        { "close", XS_Lucy_Store_FSDirHandle_close },
        { "DESTROY", XS_Lucy_Store_FSDirHandle_DESTROY },
        { "new", XS_Lucy_Store_CFReaderDirHandle_new },
        { "next", XS_Lucy_Store_CFReaderDirHandle_next },
        { "entry_is_dir", XS_Lucy_Store_CFReaderDirHandle_entry_is_dir },
        { "close", XS_Lucy_Store_CFReaderDirHandle_close },
        { "new", XS_Lucy_Store_RAMDirHandle_new },
        { "next", XS_Lucy_Store_RAMDirHandle_next },
        { "entry_is_dir", XS_Lucy_Store_RAMDirHandle_entry_is_dir },
        { "entry_is_symlink", XS_Lucy_Store_RAMDirHandle_entry_is_symlink },
        { "close", XS_Lucy_Store_RAMDirHandle_close },
        { "new", XS_Lucy_Store_CompoundFileWriter_new },
        { "consolidate", XS_Lucy_Store_CompoundFileWriter_consolidate },
        { "DESTROY", XS_Lucy_Store_CompoundFileWriter_DESTROY },
        { "new", XS_Lucy_Store_FileWindow_new },
        { "set_offset", XS_Lucy_Store_FileWindow_set_offset },
        { "get_offset", XS_Lucy_Store_FileWindow_get_offset },
        { "get_len", XS_Lucy_Store_FileWindow_get_len },
        { "new", XS_Lucy_Store_LockFactory_new },
        { "make_lock", XS_Lucy_Store_LockFactory_make_lock },
        { "make_shared_lock", XS_Lucy_Store_LockFactory_make_shared_lock },
        { "DESTROY", XS_Lucy_Store_LockFactory_DESTROY },
        { "new", XS_Lucy_Store_LockErr_new }
    };
    size_t num_classes
        = sizeof(class_specs) / sizeof(class_specs[0]);
    const char* file = __FILE__;

    lucy_bootstrap_perl();

    cfish_XSBind_bootstrap(aTHX_ num_classes, class_specs,
                           xsub_specs, file);
}

#line 43509 "lib/Lucy.c"

    /* End of Initialisation Section */

#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

