Tcl Database Configuration Single User API

The Tcl single user configuration database API module has the file name dengcfg.tcl. This module provides a programmer with a callable API that will access the Bbuuzzb database configuration details. This API is part of single user database access as well as the

This module contains two types of procedures:

- db_ - procedures prefixed with db_ are user callable
- dbeng_ - procedures prefixed with dbeng_ are internal

The internal procedures contained in this module should only be called by other procedures in this module. When writing applications that use this API, make your calls to db_ procedures only.

database server.

Here is a list of procedures in this module:

- dbeng_config_read
- db_config_get_tmp_path
- db_config_get_log
- db_config_is_session
- db_config_is_catalog
- db_config_get_session
- db_config_get_catalog
- db_config_get_log_flag
- db_config_get_session_flag
- db_config_get_catalog_flag
- db_config_get_replicate_flag
- db_config_get_version
- db_config_set_tmp_path
- db_config_set_log
- db_config_set_catalog
- db_config_set_session
- db_config_set_log_flag
- db_config_set_session_flag
- db_config_set_catalog_flag
- db_config_set_replicate_flag
- dbeng_config_valid_tmp_path
- dbeng_config_valid_catalog
- dbeng_config_valid_session

# Module Dependencies

This module is part of the single user and server database API and requires the following modules:

- fio.tcl
- parse.tcl
- logger.tcl
- dbeng.tcl
- dbiocode.tcl
- dbengcat.tcl
- dbengsrt.tcl

# Module Definition Files

The following definition modules are required along with this module:

- stdhead.tcl
- dbmess.tcl

# Module Procedures

## dbeng_config_read

    Declaration   : proc dbeng_config_read {fname}
    Parameters    :
          Name    : fname
          Type    : string
    Description   : configuration file name

    Returns       : dbeng code

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

## db_config_get_tmp_path

    Declaration   : proc db_config_get_tmp_path {path}
    Parameters    :
          Name    : path
          Type    : string
    Description   : returned path

    Returns       : dbeng code

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

## db_config_get_log

    Declaration   : proc db_config_get_log {slog}
    Parameters    :
          Name    : slog
          Type    : string
    Description   : returned log destination

    Returns       : dbeng code

This procedure will get and return the current log destination.

## db_config_is_session

    Declaration   : proc db_config_is_session {fname}
    Parameters    :
          Name    : fname
          Type    : string
    Description   : table path/file name

    Returns       : 1 if session table, 0 otherwise

This procedure will determine whether the table path/file name is the session table. Note that the session table is active only in client/server mode.

## db_config_is_catalog

    Declaration   : proc db_config_is_catalog {fname}
    Parameters    :
          Name    : fname
          Type    : string
    Description   : table path/file name

    Returns       : 1 if catalog, 0 otherwise

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

## db_config_get_session

    Declaration   : proc db_config_get_session {ses_table}
    Parameters    :
          Name    : ses_table
          Type    : string
    Description   : returned session table name

    Returns       : dbeng code

This procedure will get and return the name of the current session table. Note that the session table is active only in client/server mode.

## db_config_get_catalog

    Declaration   : proc db_config_get_catalog {cat}
    Parameters    :
          Name    : cat
          Type    : string
    Description   : returned catalog table name

    Returns       : dbeng code

This procedure will get and return the path/file name of the current catalog.

## db_config_get_log_flag

    Declaration   : proc db_config_get_log_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : returned log flag value

    Returns       : dbeng code

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

## db_config_get_session_flag

    Declaration   : proc db_config_get_session_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : returned session table flag value

    Returns       : dbeng code

This procedure will get and return the current session table flag value. Note that the session table flag is active only in client/server mode.

## db_config_get_catalog_flag

    Declaration   : proc db_config_get_catalog_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : returned catalog flag value

    Returns       : dbeng code

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

## db_config_get_replicate_flag

    Declaration   : proc db_config_get_replicate_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : returned replicate flag value

    Returns       : dbeng code

This procedure will get and return the current replicate flag value. Note that the replicate flag is active only in client/server mode.

## db_config_get_version

    Declaration   : proc db_config_get_version {ver}
    Parameters    :
          Name    : ver
          Type    : string
    Description   : returned version string

    Returns       : dbeng code

This procedure 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.

## db_config_set_tmp_path

    Declaration   : proc db_config_set_tmp_path {path}
    Parameters    :
          Name    : path
          Type    : string
    Description   : temporary files path

    Returns       : dbeng code

This procedure 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).

## db_config_set_log

    Declaration   : proc db_config_set_log {slog}
    Parameters    :
          Name    : slog
          Type    : string
    Description   : log destination

    Returns       : dbeng code

This procedure will set the Bbuuzzb engine log to the log destination. The log destination may be a path/file name or the system log server.

## db_config_set_catalog

    Declaration   : proc db_config_set_catalog {cat}
    Parameters    :
          Name    : cat
          Type    : string
    Description   : catalog path/file name

    Returns       : dbeng code

This procedure 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.

## db_config_set_session

    Declaration   : proc db_config_set_session {ses_table}
    Parameters    :
          Name    : ses_table
          Type    : string
    Description   : session table path/file name

    Returns       : dbeng code

This procedure 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 the session table is active only in client/server mode.

## db_config_set_log_flag

    Declaration   : proc db_config_set_log_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : log flag value

    Returns       : dbeng code

This procedure will set the log flag to the log flag value which must be either zero or one. This function will also turn logging on or off.

## db_config_set_session_flag

    Declaration   : proc db_config_set_session_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : session table flag value

    Returns       : dbeng code

This procedure will set the session table flag to the session table flag value which must be either zero or one. Note that the session table is active only in client/server mode.

## db_config_set_catalog_flag

    Declaration   : proc db_config_set_catalog_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : catalog flag value

    Returns       : dbeng code

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

## db_config_set_replicate_flag

    Declaration   : proc db_config_set_replicate_flag {flag}
    Parameters    :
          Name    : flag
          Type    : boolean flag
    Description   : replicate flag value

    Returns       : dbeng code

This procedure will set the replicate flag to the replicate flag value which must be zero or one. Note that replication is active only in client/server mode.

## dbeng_config_valid_tmp_path

    Declaration   : proc dbeng_config_valid_tmp_path {path}
    Parameters    :
          Name    : path
          Type    : string
    Description   : validation path

    Returns       : dbeng code

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

## dbeng_config_valid_catalog

    Declaration   : proc dbeng_config_valid_catalog {cat}
    Parameters    :
          Name    : cat
          Type    : string
    Description   : validation catalog table name

    Returns       : dbeng code

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

## dbeng_config_valid_session

    Declaration   : proc dbeng_config_valid_session {ses_table}
    Parameters    :
          Name    : ses_table
          Type    : string
    Description   : validation session table name

    Returns       : dbeng code

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

Goto Top | Tcl Database Engine and API's | Tcl Applications | Tcl Software Overview | Tcl Library Overview
| Future Lab Home | Contact Webmaster | Feedback

Copyright © 2006 Future Lab, Last Updated Jul 01, 2006