RouteX Document Router Toolkit
Main Functions Types & Errors Query Language Demo Home


Adds a new query to the RouteX database. The query will be added to the database you specified in rxOpenRouterDatabase. You pass rxAddQuery a structure of null terminated strings that tell RouteX the title, reference, action and search query of the query you are adding.

See the function index for more information about the query database and adding elements to it.

After completing rxAddQuery will store the query number in the variable pointed to by QueryNum. The query number is a unique number that RouteX uses to keep track of query records. Be aware, however, that if you optomize the database that each query may have it's query number renumbered. Thus do not depend upon query number between RouteX sessions.

The query is passed in as a pointer to a struct of four null terminated strings, each 1024 characters long. This enables languages which do not handle C structs easily to still create a buffer which can be passed to RouteX.

typedef struct rxQueryData {

   UCharT Query[1024];

   UCharT Title[1024];

   UCharT Reference[1024];

   UCharT Action[1024];


Remember that the search Query must first be converted to hexadecimal form before being passed to rxAddQuery. RouteX eases this conversion by providing the function rxConvertQuery to convert ASCII queries to hexadecimal ones.


void rxAddQuery( RouteX Router, ULongT *QueryNum, rxQueryData *Query, StatusCodeT *Status )


Router The RouteX object you are deleting
QueryNum Returns the number of the query.
Query A pointer to a struct of type rxQueryData holding the query information.
Status A pointer to a value of type StatusCodeT. If an error occurs during the execution of the function a value representing the error will be stored in *Status. You should check *Status after every function call.



Related Functions



rxQueryData   aQuery;

unsigned long querynum;

// Set up the query I'm creating

// We store the user name in the referenc and the 

// email address to forward the news to in the action.

strcpy( aQuery.Title, "Forward news on Lextek");

strcpy( aQuery.Reference, "Someone");

strcpy( aQuery.Action, "");

// we have to convert the query to hexadecimal form

rxConvertQuery( aQuery.Query, "(lextek | onix | routex)" );

rxAddQuery( Router, &querynum, &aQuery, Status);

if( *Status < 0 )



Previous Main Next Home

Copyright 2000 Lextek International