KinoSearch1
view release on metacpan or search on metacpan
lib/KinoSearch1/Index/TermInfo.pm view on Meta::CPAN
package KinoSearch1::Index::TermInfo;
use strict;
use warnings;
use KinoSearch1::Util::ToolSet;
use base qw( KinoSearch1::Util::CClass );
1;
__END__
__XS__
MODULE = KinoSearch1 PACKAGE = KinoSearch1::Index::TermInfo
TermInfo*
new( class_sv, doc_freq, frq_fileptr, prx_fileptr, skip_offset, index_fileptr )
SV *class_sv;
I32 doc_freq;
double frq_fileptr;
double prx_fileptr;
I32 skip_offset;
double index_fileptr;
PREINIT:
TermInfo *tinfo;
CODE:
class_sv = NULL; /* suppress "unused variable" warning */
Kino1_New(0, tinfo, 1, TermInfo);
tinfo->doc_freq = doc_freq;
tinfo->frq_fileptr = frq_fileptr;
tinfo->prx_fileptr = prx_fileptr;
tinfo->skip_offset = skip_offset;
tinfo->index_fileptr = index_fileptr;
RETVAL = tinfo;
OUTPUT: RETVAL
=begin comment
Duplicate a TermInfo object.
=end comment
=cut
TermInfo*
clone(tinfo)
TermInfo *tinfo;
CODE:
RETVAL = Kino1_TInfo_dupe(tinfo);
OUTPUT: RETVAL
=for comment
Zero out the TermInfo object.
=cut
void
reset(tinfo)
TermInfo *tinfo;
PPCODE:
Kino1_TInfo_reset(tinfo);
=begin comment
Setters and getters.
=end comment
=cut
SV*
_set_or_get(tinfo, ...)
TermInfo *tinfo;
ALIAS:
set_doc_freq = 1
get_doc_freq = 2
set_frq_fileptr = 3
get_frq_fileptr = 4
set_prx_fileptr = 5
get_prx_fileptr = 6
set_skip_offset = 7
get_skip_offset = 8
set_index_fileptr = 9
get_index_fileptr = 10
CODE:
{
KINO_START_SET_OR_GET_SWITCH
case 1: tinfo->doc_freq = SvIV(ST(1));
/* fall through */
case 2: RETVAL = newSViv(tinfo->doc_freq);
break;
case 3: tinfo->frq_fileptr = SvNV(ST(1));
/* fall through */
case 4: RETVAL = newSVnv(tinfo->frq_fileptr);
break;
case 5: tinfo->prx_fileptr = SvNV(ST(1));
/* fall through */
case 6: RETVAL = newSVnv(tinfo->prx_fileptr);
break;
case 7: tinfo->skip_offset = SvIV(ST(1));
/* fall through */
case 8: RETVAL = newSViv(tinfo->skip_offset);
break;
case 9: tinfo->index_fileptr = SvNV(ST(1));
/* fall through */
case 10: RETVAL = newSVnv(tinfo->index_fileptr);
break;
KINO_END_SET_OR_GET_SWITCH
}
OUTPUT: RETVAL
void
DESTROY(tinfo)
TermInfo* tinfo;
( run in 1.028 second using v1.01-cache-2.11-cpan-5511b514fd6 )