RQL C-API Function Reference


Public Methods

int RQL_connectdb (int argc, char **argv)
char * RQL_exec (int sockfd, char *query)
void RQL_finish (int sockfd)

Member Function Documentation

int RQL_connectdb (  int    argc,
char **    argv
) 
 

RQL_connectdb: sends information from a client to the server to connect him to a DB named dbname and open a session where transactions will take place with the database. For the intercommunication with the server functions sendstr and recvstr are used so that the data exchanging are in XDR format for interoperability.

Parameters:
argc  is an integer that displays the number of strings that the next argument (char**) contains.
argv  is a char** that contains argc strings. The three first strings must be in order; host,port,dbname. Host is the name of the host that the server is running. port is the port that the server listens. dbname is the name of the database.
Returns:
Upon succesfull completion RQL_connevtdb returns an int that is the socket address were the communicatoin will take place. the communication will take place. This will be used by the functions that will communicate with the database. If an error occurs within the execution of this function -1 will be returned to the caller.

char* RQL_exec (  int    sockfd,
char *    query
) 
 

RQL_exec is a function that is used by the client's program to send a query to the server where the database is running and receive the answer of it. It is called after a connection is established with the RQL_connectdb function. It uses XDR representation for the data so there is interoperability.

Parameters:
sockfd  This is a int the displays the socket were the communication will take place. It is the integer that is returned by the RQL_connectdb upon succesfull completion.
query  It is the query string to be sent to the database.
Returns:
If the execution of this function is succesful there will be returned a char* that will point to the string that is the answer to the query sent to the database. If the query is wrong the answer also will be the string representation of the error that the database returns. If there is a problem with the execution then NULL is returned to the caller.

void RQL_finish (  int    sockfd ) 
 

RQL_finish is the function used by the client to terminate a session. this function informs the server that that there will be no more transactions held in the same socket.

Parameters:
sockfd  It is the integer that displays the socket that is no longer needed and will be freed by the server.


The documentation for this class was generated from the following file:
Generated on Sat Nov 17 22:15:44 2001 for RQL Interpreter by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001