gtpc2mbt | C/C++ Language Support User's Guide |
This function describes the location of user-embedded file addresses or persistent identifiers (PIDs) in collection elements.
Format
#include <c$to2.h> long TO2_addRecoupIndexEntry ( TO2_ENV_PTR env_ptr, const void *indexName, const void *entryToken, const enum TO2_RECOUP_ENTRY_TYPE entryType, const long *displacement, const enum TO2_RECOUP_ENTRY_ACCESS accessType, const long *accessValueLen, const void *accessValue);
Normal Return
The normal return is a positive value.
Error Return
An error return is indicated by a zero. When zero is returned, use the TO2_getErrorCode function to determine the specific error code. For more information, see Error Handling.
The following error code is common for this function:
TO2_ERROR_ENV
Programming Considerations
Examples
The following example adds an entry to a recoup index.
#include <c$to2.h> /* Needed for TO2 API Functions */ #include <stdio.h> /* APIs for standard I/O functions */ #define KEY_OFFSET 20 TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ u_char indexName[]="INDEX001"; /* index identifier */ char entryToken;[8]; /* pointer to the entry token */ TO2_RECOUP_ENTRY_TYPE entryType; /* PID or FA index entry */ long displacement; /* displacement to element */ TO2_RECOUP_ENTRY_ACCESS accessType; /* key or index to access element */ long accessValueLen; /* key length */ u_char accessValue[]="JACOB"; /* key to access element */
·
·
·
memcpy(entryToken, "MYDSNAME",8); entryType = TO2_RECOUP_ENTRY_PID; displacement = KEY_OFFSET; accessType = TO2_RECOUP_ACCESS_KEY; accessValueLen = sizeof(accessValue); if (TO2_addRecoupIndexEntry(env_ptr, indexName, &entryToken, entryType, &displacement, accessType, &accessValueLen, accessValue) == TO2_ERROR) { printf ("TO2_addRecoupIndexEntry failed!\n"); process_error(env_ptr); } else printf("TO2_addRecoupIndexEntry successful\n");
Related Information