gtpc2mh4 | C/C++ Language Support User's Guide |
This function returns the class name of the specified collection.
Format
#include <c$to2.h> TO2_BUF_PTR TO2_getCollectionName (const TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr);
Normal Return
The normal return is a pointer (TO2_BUF_PTR) to a structure (buffer) of type TO2_BUF_HDR (see Type Definitions).
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.
Programming Considerations
Examples
The following example retrieves the class name for the collection indicated.
#include <c$to2.h> /* Needed for TO2 API functions */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ TO2_PID collect; TO2_BUF_PTR bufferPtr; char *collectionName; long nameLength;
·
·
·
if ((bufferPtr = TO2_getCollectionName(&collect, env_ptr)) == TO2_ERROR) { printf("TO2_getCollectionName failed!\n"); process_error(env_ptr); } else { collectionName = bufferPtr->data; nameLength = bufferPtr->dataL; printf("TO2_getCollectionName successful!\n"); }
·
·
·
free(buffer_ptr);
Related Information