TRIPsystem Kernel API 8.3
|
Information request commands. More...
Functions | |
int | TdbBaffitMode (void) |
Return the mode in which the current record is being processed. | |
int | TdbCurrentDate (char *date, int *length) |
Retrieve the current date. | |
int | TdbCurrentTime (char *timestr, int *length) |
Retrieve the current time. | |
int | TdbFieldInfo (TdbHandle cursor, int mode, char *cvalue, int *ivalue) |
Returns various data about a field in a database. | |
int | TdbGetQueuedMessage (char *message, int *length, char *logfile) |
Retrieve a job status message from the TRIPdaemon message queue. | |
int | TdbLanguage (char *language) |
Retrieve current language code. | |
int | TdbLicenseInfo (int mode, const char *strarg, char *stringValue, size_t strvalsz, int *intValue) |
Returns information about the the TRIP license. | |
int | TdbSessionInfo (int mode, char *stringValue, int *intValue) |
Returns information about the current session. | |
int | TdbShellSymbol (char *symbol, int *symbol_length) |
Check or retrieve CCL keywords. | |
int | TdbUserInfo (int mode, char *stringValue, int *intValue) |
This routine returns information about the currently logged on user. | |
int | TdbVersion (char *version, int *version_length) |
Return the current TRIP version. | |
Information request commands.
The information commands are functions that offer functionality for obtaining miscellaneous information of various kind, such as about the active session, the logged on user, command symbols, etc.
int TdbBaffitMode | ( | void | ) |
Return the mode in which the current record is being processed.
The TdbBaffitMode() function returns the type of operation performed on the record as is it being processed by the BAFFIT utility program. It is consequently only useful when called from within a LOAD or INDEX ASE.
Symbol | Constant Value | Description |
---|---|---|
ADD_MODE | 1 | A record is being added to the database |
MODIFY_MODE | 2 | An existing record is being modified |
DELETE_MODE | 3 | An existing record is being deleted |
int TdbCurrentDate | ( | char * | date, |
int * | length | ||
) |
Retrieve the current date.
date | Date string |
length | Length of date string |
This function TdbCurrentDate() returns the current date as provided by the system clock. Format of the return date will be according to the format set in the user's profile. A TRIPapi based application can override user profile settings by calling the TdbShellDefDateForm() function.
The date
parameter is passed a character string that will receive the current date (as provided by the operating system). This is a write-only parameter.
The length
parameter is passed a pointer to an int
variable that will receive the number of characters in the date string returned in the date
parameter.
This function always succeeds.
int TdbCurrentTime | ( | char * | timestr, |
int * | length | ||
) |
Retrieve the current time.
timestr | Time string |
length | Length of time string |
The function TdbCurrentTime() returns the current time, derived from the system clock. Results are always in the format {HH:MM:SS} .
The timestr
parameter is passed a character string to receive the current time derived from the operating system.
The server-side version of the length
parameter is passed a pointer to an integer that receives a count of the number of data characters in the timestr
parameter.
This function always succeeds.
int TdbFieldInfo | ( | TdbHandle | cursor, |
int | mode, | ||
char * | cvalue, | ||
int * | ivalue | ||
) |
Returns various data about a field in a database.
cursor | Cursor pointing at field to retrieve info about |
mode | Mode of operation |
cvalue | Information as character string |
ivalue | Information as integer |
Returns various data about a field in a database.
The cursor
parameter is a cursor that has been set to refer to the field which to retrieve information about.
The mode
parameter is a flag used to request information about the field specified by the cursor
parameter. Valid values are:
Symbolic Name | Constant Value | Purpose | Returned In |
---|---|---|---|
FIELDINFO_SIZE | 1 | Size of field in characters | ivalue |
FIELDINFO_TYPE | 2 | Type of field. | ivalue |
FIELDINFO_MAX_SUBFIELDS | 3 | Max allowed subfield count | ivalue |
FIELDINFO_IS_PARTFIELD | 4 | Indicates if field is a partfield | ivalue |
The cvalue
is passed a character string to receive the requested information in character format.
The ivalue
is passed a pointer to an int that receives the requested information in integer format.
This function was introduced in TRIP version 3.4-0.
Code | Description | Explanation |
---|---|---|
0 | Requested information is not available. | |
1 | Operation completed successfully | The function completed its operations without error. |
14658 | Undefined cursor. | |
18464 | Unrecognized option: mode | The option value specified in the mode parameter is not valid. |
21634 | {1} is not a blob field. |
int TdbGetQueuedMessage | ( | char * | message, |
int * | length, | ||
char * | logfile | ||
) |
Retrieve a job status message from the TRIPdaemon message queue.
message | Retrieved message |
length | Length of message |
logfile | Name of log file for batch job |
The function TdbGetQueuedMessage() retrieves a status message from the TRIPdaemon when a batch job has finished executing. An application that submits batch jobs (such as print, load, index, load/index, or global update) should call this function at regular intervals to prevent the message queue from eventually overflowing.
If the logfile
argument is non-null, the routine will also retrieve the name of the log file that was created for the batch job.
The message
parameter is passed a character string to contain the message retrieved from the message queue.
The length
parameter is passed a pointer to an int
variable that will receive the length of the returned message, in number of bytes.
The logfile
parameter is passed a character string, which the call of this function, will contain the name of the log file created for the batch job.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | A queued message was retrieved. |
0 | Operation failed | There are no messages on queue. |
int TdbLanguage | ( | char * | language | ) |
Retrieve current language code.
language | Buffer to receieve current language code. |
The function TdbLanguage() returns the three character language code that is currently being used by the CCL parser. This code is initially derived from the configuration setting TDBS_LANG as specified in the configuration file (tdbs.conf) or in the current process' environment.
To modify the language used by the CCL parser, use the TdbShellModifyCcl() function.
The language
parameter is passed a character string to receive the code for the currently selected dialect of the CCL language.
This function always succeeds.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
int TdbLicenseInfo | ( | int | mode, |
const char * | strarg, | ||
char * | stringValue, | ||
size_t | strvalsz, | ||
int * | intValue | ||
) |
Returns information about the the TRIP license.
mode | Type of information to retrieve. |
strarg | Mode-specific extra input parameter |
stringValue | Output parameter for information of string type. |
strvalsz | Allocated size of the stringValue buffer. |
intValue | Output parameter for information of integer type. |
The TdbLicenseInfo() function provides a way to obtain various information about a TRIP session.
The mode
parameter is used to tell the function what information to return and must be set to one of the following values:
Value | Output Parameter | Description |
---|---|---|
LICINFO_PRODUCT | intValue | Returns a boolean value (0/1) indicating if the installed license includes the product specified by the strarg parameter. |
LICINFO_PRODUCT_SYSTEM | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPsystem product. |
LICINFO_PRODUCT_HIGHWAY | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPhighway product. |
LICINFO_PRODUCT_NXP | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPnxp product. |
LICINFO_PRODUCT_COF | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPcof product. |
LICINFO_PRODUCT_XML | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPxml product. |
LICINFO_PRODUCT_JXP | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPjxp product. |
LICINFO_PRODUCT_SQL | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPsql product. |
LICINFO_PRODUCT_CLIENT | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPclient product. |
LICINFO_PRODUCT_JTK | intValue | Returns a boolean value (0/1) indicating if the installed license includes the TRIPjtk product. |
LICINFO_EXPIRATION_DATE | intValue and/or stringValue | Returns the expiration date as string in YYYY-MM-DD format, and/or as an integer in YYYYMMDD format. |
LICINFO_MAX_CONCURRENT_USERS | intValue | Returns the maxium concurrent users limit. |
LICINFO_MAX_REGISTERED_USERS | intValue | Returns the maxium registered users limit. |
LICINFO_MAX_OPEN_DATABASES | intValue | Returns the maxium open databases limit. |
LICINFO_MAX_CLUSTER_SIZE | intValue | Returns the maxium cluster size limit. |
LICINFO_MAX_SEARCH_SETS | intValue | Returns the maxium search set size limit. |
LICINFO_MAX_DBRECORDS | intValue | Returns the maxium allowed number of records in a database. |
LICINFO_INCLUDES_GRAPH_SEARCH | intValue | Returns a boolean value (0/1) indicating if graph search is enabled. |
LICINFO_INCLUDES_XPATH_SEARCH | intValue | Returns a boolean value (0/1) indicating if XPath search is enabled. |
This function was introduced in TRIP version 8.0-0.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
8866 | Missing argument | A required argument was not supplied to the function. |
18466 | Unrecognised option: value. | This error occurs when the mode parameter has an unsupported value. |
int TdbSessionInfo | ( | int | mode, |
char * | stringValue, | ||
int * | intValue | ||
) |
Returns information about the current session.
mode | Type of information to retrieve. |
stringValue | Output parameter for information of string type. |
intValue | Output parameter for information of integer type. |
The TdbSessionInfo() function provides a way to obtain various information about a TRIP session.
The mode
parameter is used to tell the function what information to return and must be set to one of the following values:
Value | Output Parameter | Description |
---|---|---|
SESSIONINFO_RUNTIME | intValue | Returns a boolean value (0/1) indicating if the installed license is a runtime license. |
SESSIONINFO_DATEFORM | intValue | Return the number of the current TRIP date form. |
SESSIONINFO_DATEFORM | stringValue | The date separator characters used with the current TRIP date form. |
SESSIONINFO_OPENBASES | intValue | Return a count of the present number of open databases. |
SESSIONINFO_CURRENTBASE | stringValue | Returns the name of the current database.. |
SESSIONINFO_CLUSTER | stringValue | Returns a list of cluster members. Requirement: the current open database must be a cluster. |
SESSIONINFO_DBS_IN_SEARCH | stringValue | Returns a comma-separated list of databases in a specified search set. The search number is specified in the intValue parameter. NOTE: this mode is only supported in the server-side version of this API. |
SESSIONINFO_SIF_NAME | stringValue | Returns the name of SIF file currently in use. |
SESSIONINFO_CHARSET | intValue | Returns the number of the character set in use by the session. This can be one of the values: CHSET_LA1CHSET_LA2CHSET_LA3CHSET_UTF8CHSET_CHICHSET_GBKCHSET_EUCCHSET_SJIS |
SESSIONINFO_SESSION_STATUS | intValue | Return one of the following values: 0 - session is not started, 1 - kernel is initialized, but user is not logged in, 2 - session is active and user is logged in, 3 - session is inactive, user has logged out, 4 - user has been temporarily logged out w/o any saved session state ( see TdbChangeUser() ), 5 - user has been temporarily logged out with session state intact ( see TdbChangeUser() ). |
SESSIONINFO_CJK_MODE | intValue | Return the pictogram character set in use: 0 - not in use, 1 - GB 2312 80, 2 - Apple Chinese, 3 - EUC, 4 - Shift/JIS, 5 = GBK |
SESSIONINFO_SUPERMAN | intValue | Non-zero if the current user is SYSTEM and has SUPERMAN rights. |
SESSIONINFO_COMMERCIAL | intValue | Non-zero if a commercial license is installed. |
SESSIONINFO_DBS_INITIATED | intValue | Returns the number of databases opened during the current session. |
SESSIONINFO_DB_IN_SEARCH | stringValue | Returns the name of the database or cluster assosicated with a particular search set. Specify the search set number in the intValue parameter as input. |
SESSIONINFO_HIGHEST_SEARCH | intValue | Returns the highest search set number in use in the session. |
SESSIONINFO_VERSION | stringValue | Returns the version information as a string in the format MAJOR.MINOR-SERVICE[:PATCH] |
SESSIONINFO_VERSION_MAJOR | intValue | Returns the major version number. |
SESSIONINFO_VERSION_MINOR | intValue | Returns the minor version number. |
SESSIONINFO_VERSION_SERVICE | intValue | Returns the service release number. |
SESSIONINFO_VERSION_PATCH | intValue | Returns the patch number. |
SESSIONINFO_CURRENTTHES | stringValue | Returns the name of the currently defined thesaurus. |
SESSIONINFO_THESDEF | stringValue | Returns the definition used to declare the current thesaurus. |
SESSIONINFO_AUTOLIC | intValue | One or more licenses have been automatically installed. Specific to container deployments. |
This function was introduced in TRIP version 3.4-0.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
18466 | Unrecognised option: value. | This error occurs when the mode parameter has an unsupported value. |
int TdbShellSymbol | ( | char * | symbol, |
int * | symbol_length | ||
) |
Check or retrieve CCL keywords.
symbol | Symbol string |
symbol_length | Length of symbol |
The function TdbShellSymbol() can be used to either check the validity, or to retrieve the correct form of a CCL command/modifier in the current language.
To get the correct CCL form of a DAO symbol, put the DAO symbol for the command in the symbol
argument and pad the rest of the string with blank space up to 16 bytes. On return from the function, the argument will contain the corresponding CCL symbol. The actual CCL and DAO symbols can be found in the file ENGLISH.CCL (for English language) on the directory referred to by the environment variable or configuration setting TDBS_SYS.
The DAO symbol can be entered in different ways in order to get different forms of the CCL symbol. The case of the three DAO characters determine how the CCL symbol will be returned. Assuming the current language to be English, the following forms of the DAO symbol for Find would yield these forms of the CCL command:
fin
[rarr ]f
(the shortest possible form of the CCL command in lower case)fiN
[rarr ]F
(the shortest form in upper case)fIn
or fIN
[rarr ]find
(the full command in lower case)Fin
or FiN
[rarr ]Find
(the full command with the shortest form capitalized)FIn
or >FIN
[rarr ]FIND
(the full command in upper case).To check a CCL symbol, put the three character long DAO form first in the symbol string, a blank space in position four, and then the CCL symbol. The return code from the function indicates success or failure, and for a success, the CCL symbol will also be returned in the string as described above.
The routine can also be used to access the current definition of the mask characters or the comma separator. To check all mask characters, put the string '#:![amp ]' in the symbol argument. To check one single mask character, put that mask character in the first position of the string.
The 16-character wide symbol string must always be padded with blank space.
The symbol
parameter is passed a character string as the CCL symbol to verify. The symbol buffer must be at least 16 characters long, not including any terminating null character.
The symbol_length
parameter is passed an integer as the length of the symbol string.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
0 | Operation failed | The specified symbol does not exist or is not valid. |
int TdbUserInfo | ( | int | mode, |
char * | stringValue, | ||
int * | intValue | ||
) |
This routine returns information about the currently logged on user.
mode | Type of information to retrieve. |
stringValue | Output parameter for information of string type. |
intValue | Output parameter for information of integer type. |
The TdbUserInfo() function provides a way to obtain various information about the currently logged on user.
The mode
parameter is used to tell the function what information to return and must be set to one of the following values:
Value | Output Parameter | Description |
---|---|---|
USERINFO_FM | intValue | Returns 1 if the user has file manager rights and 0 otherwise. |
USERINFO_UM | intValue | Returns 1 if the user has user manager rights and 0 otherwise. |
USERINFO_SM | intValue | Returns 1 if the user has system manager rights and 0 otherwise. |
USERINFO_STARTPROC | stringValue | Returns the name of the start procedure for this user. |
USERINFO_NAME | stringValue | Returns the name of the user. |
USERINFO_EXT_NAME | stringValue | Returns the external OS or LDAP name of the user. |
USERINFO_GROUPS | intValue, stringValue | Returns the list of TRIP groups for the user. The list is delimited by the pipe character. Pass NULL for the stringValue parameter, and the intValue will on return contain the minimum allocated size of the buffer to pass into stringValue. If stringValue and intValue are both non-NULL, the intValue parameter will on return contain the number of groups. |
USERINFO_EXT_GROUPS | intValue, stringValue | Returns the list of external OS or LDAP groups for the user. The list is delimited by the pipe character. Pass NULL for the stringValue parameter, and the intValue will on return contain the minimum allocated size of the buffer to pass into stringValue. If stringValue and intValue are both non-NULL, the intValue parameter will on return contain the number of groups. |
This function was introduced in TRIP version 3.4-0.
Code | Description | Explanation |
---|---|---|
1 | Operation completed successfully | The function completed its operations without error. |
18466 | Unrecognised option: (value}. | This error occurs when the mode parameter has an unsupported value. |
int TdbVersion | ( | char * | version, |
int * | version_length | ||
) |
Return the current TRIP version.
version | TRIP version string |
version_length | Length of version string |
The function TdbVersion() returns the TRIPsystem version identifier for the current TRIP session.
The returned version string is specified in the form M.m-s
[:p] where:
M
is the major version numberm
is the minor version numbers
is the service release version numberp
is the optional patch version numberExamples:
The version
parameter is passed a character string to receive the version identifier for the current TRIPkernel installation.
The version
length parameter is passed a pointer to an integer that receives the count of the number of characters in version string.
This function always succeeds.