Database Codes API

The database 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. This module can be compiled for all stated platforms.

Here is a list of functions in this module:

- db_io_code_string
- db_io_code_log
- dbeng_io_code_string
- dbeng_io_code_log

# Module Dependencies

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 single user and client/server.

# Module Header Files

This module depends on the following header files:

- stdhead.h
- dbmess.h
- dbiocode.h

# Module Functions

## db_io_code_string

    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 level (dbeng).

## db_io_code_log

    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 level (dbeng).

## dbeng_io_code_string

    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 explanation of the code into the output string which must have already been allocated to sufficient size.

## dbeng_io_code_log

    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 log manager. The format of the message is:

          mname:desc,rc=io_code(string)

# Dbeng Codes

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.

Goto Top | Future Lab Home | Contact Webmaster | Feedback

Copyright © 1999-2006 Future Lab, Last Updated Jun 30, 2006