SETLOGPATH
Set transaction processing control file paths for single-user applications.
Short Name
SETLOGPATH()
Type
Low-Level function
Declaration
COUNT SETLOGPATH(pTEXT path, NINT mode)
Description
SETLOGPATH() sets the path for the transaction processing log files, start files and temporary support files for single-user transaction processing applications.
SETLOGPATH() must be called BEFORE the initialization of c-tree (i.e., before InitCTree(), InitISAM(), etc.). Therefore, it does not set uerr_cod. It returns the error code or zero if successful. If c-tree is shutdown and restarted within an application, SETLOGPATH() must be repeated just prior to each c-tree initialization.
If ctNOGLOBALS is used with instance control functions, the instance must be registered by calling RegisterCtree() before SETLOGPATH() is called. Each SETLOGPATH() call applies to only one instance of c-tree.
ctlogALL |
Set path for all log related files. |
ctlogLOG |
Set path for transaction log files. |
ctlogSTART |
Set path for start files and all other related files except the log files. |
ctlogLOG_EVEN |
Set path for even transaction log file. |
ctlogLOG_ODD |
Set path for odd transaction log file. |
ctlogSTART_EVEN |
Set path for even transaction start file. |
ctlogSTART_ODD |
Set path for odd transaction start file, and all other related files except the log files. |
ctlogSTATUS |
Sets only the path of the status log. |
These modes apply only to the optional mirrored log files and start files:
The simplest approach is to call SETLOGPATH() with the mode ctlogALL. Unless mirrored logs are desired, this is the only call required. If mirror files are desired then a second call with mode ctlogALL_MIRROR will handle all the mirrored files. The other modes are provided for unusual situations in which individual files must be placed in different locations.
If the ctlogALL mode is not used, typically more than one call to SETLOGPATH() is required.
A call made by a FairCom Server client to SETLOGPATH() returns zero, but has no effect. The FairCom Server configuration file specifies the modified names for the log and related files. However, a LOCLIB call to SETLOGPATH() sets the names for the local log files.
Return
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO_ERROR |
Successful path change. |
10 |
SPAC_ERR |
Could not allocate space for file names. |
47 |
FINT_ERR |
ctNOGLOBALS instance not allocated yet. |
116 |
IMOD_ERR |
Bad mode parameter. |
454 |
NSUP_ERR |
Transaction processing not supported. |
See c-tree Error Codes for a complete listing of valid c-tree error values.
Example
NINT rc;
if (rc = SETLOGPATH("/usr/logarea/",ctlogALL))
printf("Could not setup log file names (%d)\n",rc);