URL: http://www.firstbasesoftware.com/man/man3/setup.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]


NAME

setup, setup_argv - initialize FirstBase environment

SYNOPSIS

#include <firstbase/fb.h>

fb_setup()

fb_setup_argv(argc, argv)
int argc;
char *argv[];

fb_set_loadfail(flag)
int flag;

DESCRIPTION

The basic fb_setup mechanism processes the initialization file .firstbase-init (.fb-init on some machines) as described in setup(5). Normally, fb_setup will be called from opendb(3), but there are times when fb_opendb is not used at all.

NOTE: Due to the structure of the FirstBase engine, setup contains the data space for many global variables, and therefore must be called. In other words, if you don't use opendb, you must use setup.

Setup will initialize global variables and process any site and user dependent setup options.

To pass command line variables to FirstBase at run time, use the fb_setup_argv call and pass in the argc and argv parameters. This is the same as a call to fb_setup, but the command line (argument vector) is parsed as well as initialization files.

The fb_set_loadfail routine will set a global variable which controls the loading of the failure point of a getxrec(3) call. Use a flag of 1 (one) to turn this feature on or 0 (zero) to turn it off.

VARIABLES

Many of the setup variables are tunable from a C program. Unless otherwise indicated, these are short int variables and will need to be externally defined in each C module as needed. Common ones are:

cdb_batchmode
set to 1 to disable screen conditioning and displays

cdb_datestyle
set to 1 for American date style (MMDDYY) and to 2 for European style (DDMMYY).

cdb_datedisplay
set to 8 for display as MM/DD/YY, to 10 for MM/DD/YYYY and to 11 for

cdb_fixedwidth
set to 1 to cause the FirstBase engine to store all records as fixed width records.

cdb_locklevel
set to desired locking level. See setup(5).

cdb_locktime
set to number of seconds before a blocking lock request will time out.

cdb_lockmessage
set to 0, 1, or 2 to control whether lock error messages will be ignored, printed and skipped, or fully interactive in asking for a retry.

cdb_returnerror
set to 1 causes some functions to return on errors, rather than exit. Sets cdb_error.

cdb_rpc_retries
represents the number of times a server connection is attempted before failure occurs. The default is 10.

cdb_use_rpc
set to 1 to cause many FirstBase routines to use the client/server mechanism instead of the normal mechanism.

FIRSTBASE SYMBOLS

The FirstBase libraries uses a canonical set of prefixes. The following set of symbol prefixes are used throughout FirstBase:

FB_
FirstBase macro definitions.

fb_
FirstBase functions.

cdb_
FirstBase global variables.

CHAR_
FirstBase character constants.

S_
FirstBase system error message macro constants.

CLIENT/SERVER

The fb_setup and fb_setup_argv routines will transparently initialize a FirstBase client server connection using fb_clnt_create(3) when the global FirstBase variable cdb_use_rpc is set to one. This means a process only needs to set the short int cdb_use_rpc to one before calling fb_setup to begin a client server connection. See fb_clnt_create(3) for more details.

In addition, the fb_set_loadfail mechanism will properly notify the FirstBase database server of the flag value when cdb_use_rpc is set to one.

SEE ALSO

opendb(3), free_globals(3), fb_exit(3).


URL: http://www.firstbasesoftware.com/man/man3/setup.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]