Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic


Return the session parameter based on the parameter type.


NINT ctdbGetSessionParams(CTHANDLE Handle, CTSESSION_PARAM ParamType)


ctdbGetSessionParams() returns the session parameter based on the parameter type. The application must log on to the server with ctdbLogon() before getting the session parameter type.

  • Handle [in] the session handle.
  • ParamType [in] the parameter type. Valid values for ParamTypes are:
    • CT_BUFS: the number of index file buffers, minimum 3
    • CT_FILS: initial block of file structures.
    • CT_SECT: the number of node sectors. Minimum of one required. sect multiplied by 128 equals the index node size.
    • CT_DBUFS: the number of buffers for data files I/O
    • CT_USERPROF: is the user profile mask, and accepts the following values:
      • USERPRF_CLRCHK - instructs single-user TRANPROC applications to remove S*.FCS and L*.FCS files upon a successful application shutdown. The c-tree Plus checkpoint code determines at the time of a final checkpoint if there are no pending transactions or file opens, and if this user profile bit has been turned on. If so, the S*.FCS and L*.FCS files are deleted. However, if the application is causing log files to be saved (very unusual for a single-user application), then the files are not cleared. The USERPRF_CLRCHK option is off by default. See 13.3 "Single-User Transaction Processing" in the c-tree Plus Programmer's Reference Guide for additional information.
      • USERPRF_LOCLIB - specifies this instance of c-tree Plus is to be directed to a local database. Applicable only to client/server when using "Local Library Support".
      • USERPRF_NDATA - enable the manual mode of UNIFRMAT support. Enabling the manual record transformation mode would only be desirable when performing custom record level byte flipping or when record structures contain no numeric data (i.e., LONG, FLOAT, . . .). A side benefit of enabling this manual mode is the virtual elimination of Server DODA requests, thereby reducing network traffic by one function call per file open.
      • USERPRF_NTKEY - disables the automatic TransformKey() feature. See "TransformKey" in the c-tree Plus Programmer's Reference Guide for more information.
      • USERPRF_PTHTMP - changes GetCtTempFileName() from its default operation of returning a temporary file name to specifying a directory name where temporary files are to reside.
      • USERPRF_SAVENV - enable the automatic SAVENV feature. See the Begin() function description for more information.

To use more than one value, OR the values together. Leave CT_USERPROF set to zero to accept the defaults.


Returns the parameter value. If an invalid handle or parameter type is passed, ctdbGetSessionParams() returns 0.



CTHANDLE hSession = ctdbAllocSession(ctdbsess);


NINT ret, newbuf;

err = ctdbLogon(hSession, "FAIRCOMS", "ADMIN", "ADMIN");

ret = ctdbGetSessionParams(hSession, CT_BUFS);

newbuf = ret + 2;

err = ctdbSetSessionParams(hSession, CT_BUFS, newbuf);

See also

ctdbGetServerName(), ctdbGetUserLogonName(), ctdbAllocSession(), ctdbSetSessionParams()