Previous Topic

Next Topic

SystemConfiguration

Describes the configuration of the c-tree Plus system.

Short Name

SYSCFG()

Type

Low-level function

Declaration

COUNT SystemConfiguration(pVOID bufptr)  

Description

SystemConfiguration returns an array of LONGs describing the c-tree Plus system configuration, as well as some of the important dynamic aspects of the system, such as the memory usage and the number of files in use. The number of elements in the array is given by ctCFGLMT, which defaults to 256.

To determine if a particular system configuration option is active, check to see if its corresponding array element is non-zero. For example, to determine if TRANPROC was turned on during system compilation, check element cfgTRANPROC of the configuration array to determine if it is non-zero.

The following configuration array subscripts correspond to dynamic system resources and are interpreted as noted:

cfgMEMORY_USAGE

Current system memory usage.

cfgMEMORY_HIGH

Highest system memory use.

cfgNET_ALLOCS

Current system net allocations.

cfgOPEN_FILES

c-tree Plus files opened by system.

cfgPHYSICAL_FILES

Physical c-tree Plus files open. Includes superfile members omitted from cfgOPEN_FILES count.

cfgOPEN_FCBS

c-tree Plus file control blocks in use by system.

cfgLOGIDX

Is file mode ctLOGIDX supported?

The following array subscripts only apply to server implementations:

cfgDNODE_QLENGTH

Messages in delete node queue.

cfgCHKPNT_QLENGTH

Messages in checkpoint queue.

cfgSYSMON_QLENGTH

Messages in system monitor queue.

cfgLOGONS

Current number of logons.

cfgNET_LOCKS

Current number of pending locks (system wide).

cfgUSERS

Maximum number of logons.

cfgMAX_CONNECT

The limit for the maximum number of logons.

cfgUSER_FILES

Number of c-tree Plus files opened by calling user.

cfgUSER_MEMORY

Current user memory usage.

cfgPATH_SEPARATOR

ASCII value for the file name path separator.

cfgMAX_CLIENT_NODES

The maximum number of client nodes that can be connected at a time (a value of zero indicates no limit)

cfgMAX_CONN_PER_NODE

The maximum number of concurrent connections per client node (a value of zero indicates no limit)

cfgLOCAL_CONN_ONLY

Whether or not connections from remote systems are allowed (a value of zero indicates that remote connections are allowed)

 The following array subscripts are static compile time values:

cfgFILES

Maximum number of c-tree Plus file control blocks available system wide.

cfgMAX_DAT_KEY

Maximum number of indices per data file.

cfgMAX_KEY_SEG

Maximum number of key segments per index.

The subscripts displayed in this section and the pre-initialization resources section below have client and c-tree Server versions, except for the following three subscripts:

cfgINIT_CTREEapp

Determine whether c-tree Plus has been initialized.

cfgSERIALNBR

The c-tree Server serial number.

cfgTHREADapp

Indicates if threading has been enabled.

Subscripts ending with ‘app’ are specific to the client side of a client/server application. To check the same system setting for the c-tree Server, use the same subscript without the app extension. For example, to determine if Conditional Index support is active on the c-tree Server, use cfgCONDIDX as the subscript and cfgCONDIDXapp for the client side. On the client side, it is assumed the argument to SystemConfiguration is an array of properly aligned LONGs.

If SystemConfiguration is called for a non-client library, use the ‘app’ versions, i.e., cfgCONDIDXapp.

cfgBOUNDapp

Indicates if the application is bound to a database library. See the discussion on the different FairCom I/O models in these notes.

cfgDISKIO_MODELapp

A non-zero value indicates a stand-alone multi-user I/O model i.e. FPUTFGET.

cfgLOCLIBapp

A non-zero value indicates Local Library support.

cfgNOGLOBALSapp

A non-zero value indicates no globals are supported i.e. indicating all globals are stored in an allocated structure. This is the default setting.

cfgUNIFRMATapp

A non-zero value indicates FairCom’s automatic byte flipping (UNIFRMAT) is active.

The pre-initialization resource subscripts below may be specified prior to a c-tree Plus initialization call, i.e., InitISAM, InitCTree, in addition to having both a client and c-tree Server version, as discussed above.

cfgANSIapp

Specifies whether to use ANSI. A non-zero value indicates ANSI.

cfgCONDIDXapp

A non-zero value indicates the application supports FairCom’s Conditional Index Logic.

cfgCTBATCHapp

A non-zero value indicates the application supports Batch Operations.

cfgCTSUPERapp

A non-zero value indicates the application supports Superfiles.

cfgCTS_ISAMapp

A non-zero value indicates the application supports FairCom’s ISAM API.

cfgHISTORYapp

A non-zero value indicates the application supports FairCom’s History Logic.

cfgINIT_CTREEapp

A non-zero value indicates c-tree Plus has been initialized.

cfgLOGIDXapp

A non-zero value indicates the application supports the ctLOGIDX Logic.

cfgPARMFILEapp

A non-zero value indicates parameter files are supported.

cfgPASCAL24app

A non-zero value indicates 2-byte/4-byte length delimited strings are using the traditional pascal length convention.

cfgPASCALstapp

A non-zero value indicates byte length delimited strings are using the traditional pascal length convention.

cfgPATH_SEPARATORapp

Return the ASCII value for the file name path separator.

cfgPROTOTypeapp

A non-zero value indicates the application supports Prototypes.

cfgRESOURCEapp

A non-zero value indicates the application supports Resource Records.

cfgRTREEapp

A non-zero value indicates the application supports r-tree.

cfgSERIALNBR

Return c-tree Server serial number. You must display and use the returned number as a hex value.

cfgTHREADapp

A non-zero value indicates the application supports FairCom’s threading API.

cfgTRANPROCapp

A non-zero value indicates the application supports Transaction Processing.

cfgVARLDATAapp

A non-zero value indicates the application supports Variable Length Records.

cfgVARLKEYSapp

A non-zero value indicates the application supports Variable Length Keys i.e. Key compression.

cfgWORD_ORDERapp

Indicates the client data order: Low_High or High_Low. A non-zero value indicates Low_High.

Pascal length byte - c-tree Plus supports two different methods for specifying the length byte in a pascal data type. The original and non-traditional approach does not include the length byte in the byte count. For example, with a 1-byte data type, CT_FPSTRING, the smallest valid length byte would be 0. The new method follows the more traditional pascal convention of including the length byte in the byte count. For example, with the traditional approach, the smallest valid length for a 1-byte data type would be 1. Therefore, if cfgPASCALstapp or cfgPASCAL24app return a non-zero value, the new traditional approach is active.

To receive a valid return value from cfgPATH_SEPARATOR, ctPATH_SEP must be defined. The default definition found in ctopt2.h is:

#define ctPATH_SEP   '?'

This definition specifies that the system default path separator will be used. To use the same separator for all platforms, you might want to choose one of the following:

#define ctPATH_SEP   '\\'
/* define for Windows, DOS and OS/2 */
#define ctPATH_SEP   '/' 
/* define for most Unix systems */
#define ctPATH_SEP   ':' 
/* define for Apple System 7 and PowerMac */

The following feature bitmaps are used with the cfgFEACHK element of the SystemConfiguration output array. When the bit is on, the corresponding feature is available. This is useful for client applications where the availability of a feature is not known at compile/link time. The current feature bit mask definitions are:

cfgFEACHKplusName

+index name support for PermIIndex.

cfgFEACHKCLOSEInTran

Close or delete of an updated file inside an active transaction does not abort the transaction: either an error is returned, or the close or delete is deferred until transaction commit or abort.

cfgFEACHKencryption

Encryption is supported.

cfgFEACHKflexFile

Flexible file limits are supported.

cfgFEACHKdiskFull

Support disk full checks.

cfgFEACHKuniqFile

Support auto reassignment of duplicated file IDs.

Note: An initial c-tree Plus call (InitCTree, InitCtreeXtd, InitISAM, etc.) must be made before SystemConfiguration can check on the cfgFEACHK element. The cfgINIT_CTREEapp element can be evaluated to determine the status of the c-tree Plus initialization.

For example:

  LONG       ca[ctCFGLMT];

SystemConfiguration(ca);

if (ca[cfgINIT_CTREEapp] == YES)
    printf("c-tree Plus Initialized");
else
    printf("c-tree Plus Uninitialized: %ld",
           ca(cfgINIT_CTREEapp));

/* where the Uninitialized value is NINT_ERR for a client or FINT_ERR for a bound application */

SystemConfiguration returns nine values referenced with the following constants used as subscripts in the output array of LONG values an application can use to capture system-wide cache and buffer statistics, (cache pages hold data record images and buffers hold index nodes), allowing an application to track the use of these resources.

cfgCACHE_PAGES

Available cache pages

cfgCACHE_PAGES_INUSE

Cache pages in use

cfgCACHE_PAGES_MXUSE

Maximum cache pages used

cfgCACHE_PAGES_DED

Available dedicated cache pages

cfgCACHE_PAGES_DEDINUSE

Dedicated cache pages in use

cfgCACHE_PAGES_DEDMXUSE

Maximum dedicated cache pages used

cfgBUFFER_PAGES

Available index buffers

cfgBUFFER_PAGES_INUSE

Index buffers in use

cfgBUFFER_PAGES_MXUSE

Maximum index buffers used

Note: The dedicated cache pages are a subset of the regular cache pages.

Please see the following example for the use of this feature.

  LONG      ctcfg[ctCFGLMT];
SystemConfiguration(ctcfg);
printf(“\nAvailable Dedicated Cache Pages - %ld“,
       ctcfg[cfgCACHE_PAGES_DED]);

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful configuration return.

47

FINT_ERR

c-tree Plus not initialized.

See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.

Example

  LONG      ctcfg[ctCFGLMT];       /* array of 256 longs */

SystemConfiguration(ctcfg);

printf("\nMemory Use is %ld\n", ctcfg[cfgMEMORY_USAGE]);
printf("Memory Highest is %ld\n", ctcfg[cfgMEMORY_HIGH]);
printf("Net allocation is %ld\n", ctcfg[cfgNET_ALLOCS]);
printf("Open Files level is %ld\n", ctcfg[cfgOPEN_FILES]);
printf("Physical Files is %ld\n", ctcfg[cfgPHYSICAL_FILES]);
printf("Open FCB's is %ld\n", ctcfg[cfgOPEN_FCBS]);
printf("ctLOGIDX support is %ld\n", ctcfg[cfgLOGIDX]);

See also

Functions InitISAM(), InitCTree(), InitCtreeXtd() and ctport.h utility.