gtpc2mguC/C++ Language Support User's Guide

TO2_deleteBrowseName-Delete a Collection Name from the Browser Dictionary

This function deletes the given name from the browser dictionary for the data store (DS) pointed to by the current environment pointer.

Format

#include <c$to2.h>
long TO2_deleteBrowseName (      TO2_ENV_PTR  env_ptr,
                           const char         name[ ]);

env_ptr
The pointer to the environment as returned by the TO2_createEnv function.

name
The pointer to a string, which is the name to be deleted from the browser dictionary. The maximum name length is 32 bytes.

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 codes are common for this function:

TO2_ERROR_ENV

TO2_ERROR_DATA_LGH

TO2_ERROR_METHOD

TO2_ERROR_NOT_INIT

TO2_ERROR_LOCATOR_NOT_FOUND

Programming Considerations

None.

Examples

The following example deletes the name COLLECTION1 from the browser dictionary for DS TEST1_DS.

#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 the TO2 environment  */
long          userToken=0;      /* no user token value             */
char          applid[]="APPLICATION_NAME                 ";
char          dsname[]="TEST1_DS"; /*  data store name             */
char          name[] = "COLLECTION1"; /* name to assign            */

  ·
  ·
  ·
if (TO2_createEnv(&env_ptr, &userToken, applID, dsname)) == TO2_ERROR) { printf("TO2_createEnv failed!\n"); process_error(env_ptr); } if (TO2_deleteBrowseName(env_ptr, const name)) == TO2_ERROR) { printf("TO2_deleteBrowseName failed!\n"); process_error(env_ptr); } else { printf("TO2_deleteBrowseName was successful!\n"); }

Related Information