Call a user-supplied function when DB-Library is finished reading from the server.
void dbsetidle(dbproc, idlefunc) DBPROCESS *dbproc; void (*idlefunc)();
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
The user-supplied function that will be called by DB-Library whenever the server has finished sending data to the host. DB-Library calls idlefunc() with two parameters—the return value from busyfunc() (a pointer to a function that returns an integer) and a pointer to the DBPROCESS from the dbsetidle call.
idlefunc() returns void.
None.
This routine associates a user-supplied function with the specified dbproc. The user-supplied function will be automatically called when DB-Library is finished reading or waiting to read a packet of output from the server. For example, an application may want to print a message whenever the server has finished sending data to the host. dbsetidle will cause the user-supplied function idlefunc() to be called in this case.
Similarly, dbsetbusy may also be used to associate a user-supplied function, busyfunc(), with a dbproc. busyfunc() will be automatically called whenever DB-Library is reading or waiting to read a packet of output from the server.
The server sends result data to the application in packets of 512 bytes. (The final packet in a set of results may be less than 512 bytes.) DB-Library calls busyfunc() at the beginning of each packet and idlefunc() at the end of each packet. If the output from the server spans multiple packets, busyfunc() and idlefunc() will be called multiple times.
See the dbsetbusy reference page for an example of defining and installing busyfunc() and idlefunc().