pike.git / src / modules / _WhiteFish / whitefish.c

version» Context lines:

pike.git/src/modules/_WhiteFish/whitefish.c:1:   #include <math.h>      #include "global.h"   #include "stralloc.h"   #include "global.h" - RCSID("$Id: whitefish.c,v 1.29 2001/05/31 17:15:26 norlin Exp $"); + RCSID("$Id: whitefish.c,v 1.30 2001/06/15 02:12:28 per Exp $");   #include "pike_macros.h"   #include "interpret.h"   #include "program.h"   #include "program_id.h"   #include "object.h"   #include "operators.h"   #include "array.h"   #include "module_support.h"      #include "config.h"
pike.git/src/modules/_WhiteFish/whitefish.c:417:    &_words, &_field, &cb);       if( _field->size != 66 )    Pike_error("Illegal size of field_coefficients array (expected 66)\n" );       numblobs = _words->size;    if( !numblobs )    {    struct object *o = wf_resultset_new( );    pop_n_elems( args ); -  push_object( o ); +  wf_resultset_push( o );    return;    }       blobs = malloc( sizeof(Blob *) * numblobs );       for( i = 0; i<numblobs; i++ )    blobs[i] = wf_blob_new( cb, _words->item[i].u.integer );       for( i = 0; i<66; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_phrase(blobs,numblobs, field_coefficients );    pop_n_elems( args ); -  push_object( res ); +  wf_resultset_push( res );   }      static void f_do_query_and( INT32 args )   /*! @decl ResultSet do_query_and( array(int) words, @    *! array(int) field_coefficients, @    *! array(int) proximity_coefficients, @    *! function(int:string) blobfeeder)    *! @[words]    *!    *! Arrays of word ids. Note that the order is significant
pike.git/src/modules/_WhiteFish/whitefish.c:504:    if( _field->size != 66 )    Pike_error("Illegal size of field_coefficients array (expected 66)\n" );    if( _prox->size != 8 )    Pike_error("Illegal size of proximity_coefficients array (expected 8)\n" );       numblobs = _words->size;    if( !numblobs )    {    struct object *o = wf_resultset_new( );    pop_n_elems( args ); -  push_object( o ); +  wf_resultset_push( o );    return;    }       blobs = malloc( sizeof(Blob *) * numblobs );       for( i = 0; i<numblobs; i++ )    blobs[i] = wf_blob_new( cb, _words->item[i].u.integer );       for( i = 0; i<8; i++ )    proximity_coefficients[i] = (double)_prox->item[i].u.integer;       for( i = 0; i<66; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_and(blobs,numblobs,    field_coefficients,    proximity_coefficients,    cutoff );    pop_n_elems( args ); -  push_object( res ); +  wf_resultset_push( res );   }      static void f_do_query_or( INT32 args )   /*! @decl ResultSet do_query_or( array(int) words, @    *! array(int) field_coefficients, @    *! array(int) proximity_coefficients, @    *! function(int:string) blobfeeder)    *! @[words]    *!    *! Arrays of word ids. Note that the order is significant
pike.git/src/modules/_WhiteFish/whitefish.c:597:    if( _field->size != 66 )    Pike_error("Illegal size of field_coefficients array (expected 66)\n" );    if( _prox->size != 8 )    Pike_error("Illegal size of proximity_coefficients array (expected 8)\n" );       numblobs = _words->size;    if( !numblobs )    {    struct object *o = wf_resultset_new( );    pop_n_elems( args ); -  push_object( o ); +  wf_resultset_push( o );    return;    }       blobs = malloc( sizeof(Blob *) * numblobs );       for( i = 0; i<numblobs; i++ )    blobs[i] = wf_blob_new( cb, _words->item[i].u.integer );       for( i = 0; i<8; i++ )    proximity_coefficients[i] = (double)_prox->item[i].u.integer;       for( i = 0; i<66; i++ )    field_coefficients[i] = (double)_field->item[i].u.integer;       res = low_do_query_or(blobs,numblobs,    field_coefficients,    proximity_coefficients,    cutoff );    pop_n_elems( args ); -  push_object( res ); +  wf_resultset_push( res );   }         void pike_module_init(void)   {    init_resultset_program();    init_blob_program();    init_blobs_program();    init_linkfarm_program();