Database Low Level Configuration

This module manages the Bbuuzzb database engine configuration details and has the file name dbengcfg.c. Any mention of QNX in this document refers to the QNX 4.x OS. This API can be compiled for all stated platforms. This API is used in all single user database applications as well as the database server.

All configuration data elements are contained in this module. The configuration data elements are contained in a structure called dbeng_config. Here is the current definition of the configuration structure:

struct
   {
   char *tmp_path;
   char *log;
   int log_flag;
   char *catalog;
   int catalog_flag;
#ifdef MULTIUSER
   char *session_table;
   int session_flag;
   int replicate_flag;
   } dbeng_config = {(char *)NULL, (char *)NULL, FALSE, (char *)NULL, FALSE,
                     (char *)NULL, FALSE, FALSE};
#else
   } dbeng_config = {(char *)NULL, (char *)NULL, FALSE, (char *)NULL, FALSE};
#endif

As you can see from the definition of the configuration data structure, not all data elements are present all the time. The single user version contains the temporary path, the log file name and log flag along with the catalog file name and the catalog flag.

Applications should not call the functions in this module. Functions in this module should only be called by other low level Bbuuzzb engine functions.

Here is a list of functions in this module:

Module Dependencies

This module is part of single user and server database access and needs to be linked with the following modules:

In the Linux/Unix/QNX platforms, this module is compiled along with the other database modules as part of the script cdbeng. A good example of a shell script for a client application that uses this low level configuration module is mkdb or mkdbsrv. There are a number of good example applications that use this engine including:

Module Header Files

This module depends on the following header files:

Module Functions

dbeng_config_read

Prototype   : int dbeng_config_read(char *fname)
Parameters  :
      Name  : fname
Description : configuration file name

Returns     : dbeng code

This function will open, read and parse the configuration file name. Any configuration values encountered that are valid will be applied.

dbeng_config_get_tmp_path

Prototype   : int dbeng_config_get_tmp_path(char *path)
Parameters  :
      Name  : path
Description : returned path

Returns     : dbeng code

This function will get and return the current temporary files path.

dbeng_config_get_log

Prototype   : int dbeng_config_get_log(char *slog)
Parameters  :
      Name  : slog
Description : returned log destination

Returns     : dbeng code

This function will get and return the current log destination.

dbeng_config_is_session

Prototype   : int dbeng_config_is_session(char *fname)
Parameters  :
      Name  : fname
Description : table path/file name

Returns     : TRUE if session table, FALSE otherwise

This function will determine whether the table path/file name is the session table. Note that this function does not exist in single user applications.

dbeng_config_is_catalog

Prototype   : int dbeng_config_is_catalog(char *fname)
Parameters  :
      Name  : fname
Description : table path/file name

Returns     : TRUE if catalog, FALSE otherwise

This function will determine whether the table path/file name is the catalog.

dbeng_config_get_session

Prototype   : int dbeng_config_get_session(char *ses_table)
Parameters  :
      Name  : ses_table
Description : returned session table name

Returns     : dbeng code

This function will get and return the name of the current session table. Note that this function does not exist in single user applications.

dbeng_config_get_catalog

Prototype   : int dbeng_config_get_catalog(char *cat)
Parameters  :
      Name  : cat
Description : returned catalog table name

Returns     : dbeng code

This function will get and return the name of the current catalog.

dbeng_config_get_log_flag

Prototype   : int dbeng_config_get_log_flag(int *flag)
Parameters  :
      Name  : flag
Description : returned log flag value

Returns     : dbeng code

This function will get and return the current log flag value.

dbeng_config_get_session_flag

Prototype   : int dbeng_config_get_session_flag(int *flag)
Parameters  :
      Name  : flag
Description : returned session table flag value

Returns     : dbeng code

This function will get and return the current session table flag value. Note that this function does not exist in single user applications.

dbeng_config_get_catalog_flag

Prototype   : int dbeng_config_get_catalog_flag(int *flag)
Parameters  :
      Name  : flag
Description : returned catalog flag value

Returns     : dbeng code

This function will get and return the current catalog flag value.

dbeng_config_get_replicate_flag

Prototype   : int dbeng_config_get_replicate_flag(int *flag)
Parameters  :
      Name  : flag
Description : returned replicate flag value

Returns     : dbeng code

This function will get and return the current replicate flag value. Note that this function does not exist in single user applications.

dbeng_config_get_version

Prototype   : int dbeng_config_get_version(char *ver)
Parameters  :
      Name  : ver
Description : returned version string

Returns     : dbeng code

This function will get and return the current Bbuuzzb version string. Note that this version applies only to the Bbuuzzb database engine. In addition, each Future Lab GPL application has its own version string.

dbeng_config_set_tmp_path

Prototype   : int dbeng_config_set_tmp_path(char *path)
Parameters  :
      Name  : path
Description : temporary files path

Returns     : dbeng code

This function will set the current temporary files path. Note that the path supplied must be a valid directory that files can be written to (this will be checked).

dbeng_config_set_log

Prototype   : int dbeng_config_set_log(char *slog)
Parameters  :
      Name  : slog
Description : log destination

Returns     : dbeng code

This function will set the Bbuuzzb engine log to the log destination.

dbeng_config_set_session

Prototype   : int dbeng_config_set_session(char *ses_table)
Parameters  :
      Name  : ses_table
Description : session table path/file name

Returns     : dbeng code

This function will set the current session table to the session table path/file name which must point to a valid directory and file name that can be written to (this will be checked). If the session table does not already exist, it will be created. If the session table is changed while the session table is active, the contents of the previous session table will be lost. Note that this function does not exist in single user applications.

dbeng_config_set_catalog

Prototype   : int dbeng_config_set_catalog(char *cat)
Parameters  :
      Name  : cat
Description : catalog path/file name

Returns     : dbeng code

This function will set the catalog table to the catalog path/file name which must point to an existing file in a valid directory that can be read and written to (this will be checked). The catalog table must already exist and will not be automatically created by the Bbuuzzb engine.

dbeng_config_set_log_flag

Prototype   : int dbeng_config_set_log_flag(int flag)
Parameters  :
      Name  : flag
Description : log flag value

Returns     : dbeng code

This function will set the log flag to the log flag value which must be either zero or one.

dbeng_config_set_session_flag

Prototype   : int dbeng_config_set_session_flag(int flag)
Parameters  :
      Name  : flag
Description : session table flag value

Returns     : dbeng code

This function will set the session table flag to the session table flag value which must be either zero or one. Note that this function does not exist in single user applications.

dbeng_config_set_catalog_flag

Prototype   : int dbeng_config_set_catalog_flag(int flag)
Parameters  :
      Name  : flag
Description : catalog flag value

Returns     : dbeng code

This function will set the catalog flag to the catalog flag value which must be zero or one.

dbeng_config_set_replicate_flag

Prototype   : int dbeng_config_set_replicate_flag(int flag)
Parameters  :
      Name  : flag
Description : replicate flag value

Returns     : dbeng code

This function will set the replicate flag to the replicate flag value which must be zero or one. Note that this function does not exist in single user applications.

dbeng_config_valid_tmp_path

Prototype   : int dbeng_config_valid_tmp_path(char *path)
Parameters  :
      Name  : path
Description : validation path

Returns     : dbeng code

This function will attempt to verify the validation path by opening a file for write.

dbeng_config_valid_session

Prototype   : int dbeng_config_valid_session(char *ses_table)
Parameters  :
      Name  : ses_table
Description : validation session table name

Returns     : dbeng code

This function will attempt to verify the validation session table name by opening the table. The table must already exist. Note that this function does not exist in single user applications.

dbeng_config_valid_catalog

Prototype   : int dbeng_config_valid_catalog(char *cat)
Parameters  :
      Name  : cat
Description : validation catalog table name

Returns     : dbeng code

This function will attempt to verify the validation catalog table name by opening the table. The table must already exist.

Goto Top | Future Lab Home | Contact Webmaster | Feedback

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