The datbase code API module has the file name diocode.c. This module provides a database code API to convert all Bbuuzzb database return codes to an English phrase.
Here is a list of functions in this module:
Note that both low and high level functions are contained in this module which means that you must link this module into all applications that make use of the Bbuuzzb database. This includes both stand-alone and client/server.
This module depends on the following header files:
Prototype : void db_io_code_string(const int io_stat, char *out_str) Parameters : Name : io_stat Description : valid dbeng code Name : out_str Description : output string
This function is the high level entry point for the function dbeng_io_code_string. Get in the habit of using this high level interface rather than call the low (dbeng) level.
Prototype : void db_io_code_log(char *mname, char *desc, int io_code) Parameters : Name : mname Description : module name string Name : desc Description : error description Name: : io_code Description : valid dbeng code
This function is the high level entry point for the function dbeng_io_code_log. Get in the habit of using this high level interface rather than call the low (dbeng) level.
Prototype : void dbeng_io_code_string(const int io_stat, char *out_str) Parameters : Name : io_stat Description : valid dbeng code Name : out_str Description : output string
This function will interpret the dbeng code and load an English explaination of the code into the output string which must have already been allocated to sufficient size.
Prototype : void dbeng_io_code_log(char *mname, char *desc, int io_code) Parameters : Name : mname Description : module name string Name : desc Description : error description Name: : io_code Description : valid dbeng code
This function will interpret the dbeng code, format and send a message to the system logger. The sys_log API will be used to send the message. The format of the message is:
mname:desc,rc=io_code(string)
This function will allow you to send application database related messages to the system logger.
Almost all database engine functions return a database code called a dbeng code which is a zero or positive integer. Dbeng codes are defined in the header dbmess.h. Notice that all dbeng code definitions start with:
DBENG_
Your application must check the return code of each database function call. If the result is not:
DBENG_OK
you must take some action.