n_texis() - SQL interface


int n_texis(SERVER *se,char *queryformat,...);

This function comprises the real work that is to be performed by the network Texis server. To initiate the actual search the program makes a call to the n_texis() function. The server will begin to call the client's callback routine that was set in the n_regtexiscb() call. The n_texis() function will return 0 on error or true if all goes well. NOTE: It is not considered an error for there to be zero hits located by a search. A client's callback routine will never be invoked in this instance.

The queryformat argument is a printf() style format string that will be filled in by any subsequent arguments and then executed.


#include <sys/types.h>
#include "tstone.h"
int argc;
char **argv;
 SERVER *se;
 char buf[80];
 USERDATA mydata;

 n_regtexiscb(se,mydata,hit_handler);         /* setup hit callback */
 n_setdatabase(se,argv[1]);               /* set database to search */
 while(gets(buf)!=(char *)NULL)                 /* crude user input */
    if(!n_texis(se,"%s;",buf))     /* add required ';' for the user */
         puts("ERROR in n_texis");

Your system's printf() man page for the format string % codes.


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.