Exemple #1
0
/*============================================================================
 * tclhandleFree --
 *   Frees a handle table entry by handle.
 *
 * Parameters:
 *   o headerPtr (I) - A pointer to the table header.
 *   o handle (I) - The handle of an entry.
 *----------------------------------------------------------------------------
 * Returns:
 *   The contents of the entry, if success, or NULL if an error occured.
 *----------------------------------------------------------------------------
 */
void *tclhandleFree(tblHeader_pt tblHdrPtr, char *handle)
{
    uint64_t entryIdx;

    if ((tclhandleIndex(tblHdrPtr, handle, &entryIdx)) != TCL_OK)
	return NULL;
    return (tclhandleFreeIndex(tblHdrPtr, entryIdx));
}
Exemple #2
0
/*=============================================================================
 * tclhandleXlate --
 *   Translate a string handle to an entry pointer.
 *
 * Parameters:
 *   o headerPtr (I) - A pointer to the table header.
 *   o handle (I) - The handle string -- <prefix><int>
 * Returns:
 *   A pointer to the entry, or NULL if an error occured.
 *-----------------------------------------------------------------------------
 */
void *tclhandleXlate(tblHeader_pt tblHdrPtr, char *handle)
{
    unsigned long entryIdx;

    if ((tclhandleIndex(tblHdrPtr, handle, &entryIdx)) != TCL_OK)
	return NULL;
    return (tclhandleXlateIndex(tblHdrPtr, entryIdx));
}