gtpc2mhv | C/C++ Language Support User's Guide |
This function reclaims (unmarks) a collection that has been marked for deletion but has not actually been deleted.
Format
#include <c$to2.h> long TO2_reclaimPID (const TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr);
Normal Return
The normal return is a positive value. This occurs if the collection is either successfully unmarked or was not originally marked for deletion.
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
A commit scope will be created for the TO2_reclaimPID request. If the request is successful, the scope will be committed. If an error occurs while processing the TO2_reclaimPID request, the scope will be rolled back.
Examples
The following example reclaims (unmarks) a collection that is marked for deletion.
#include <c$to2.h> /* TO2 API function prototypes */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_PID collect; TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */
·
·
·
/*******************************************************************/ /* Reclaim (unmark) a collection marked for deletion. */ /*******************************************************************/ if (TO2_reclaimPID(&collect, env_ptr) == TO2_ERROR) { { printf("TO2_reclaimPID failed!\n"); process_error(env_ptr); } else { printf("TO2_reclaimPID successful!\n"); } }
Related Information
TO2_deletePID-Delete a Persistent Identifier and Its Backing Store.