Lines Matching defs:entry
219 * Find active list entry according to object handle and return pointer to the
220 * entry otherwise return NULL.
228 PK11_active *entry;
230 for (entry = active_list[type]; entry != NULL; entry = entry->next) {
231 if (entry->h == h) {
232 return (entry);
240 * Search for an entry in the active list using PKCS#11 object handle as a
241 * search key and return refcnt of the found/created entry or -1 in case of
250 PK11_active *entry = NULL;
257 /* search for entry in the active list */
258 if ((entry = pk11_active_find(h, type)) != NULL) {
259 entry->refcnt++;
261 /* not found, create new entry and add it to the list */
262 entry = OPENSSL_malloc(sizeof (PK11_active));
263 if (entry == NULL) {
267 entry->h = h;
268 entry->refcnt = 1;
269 entry->prev = NULL;
270 entry->next = NULL;
271 /* connect the newly created entry to the list */
273 active_list[type] = entry;
274 } else { /* make the entry first in the list */
275 entry->next = active_list[type];
276 active_list[type]->prev = entry;
277 active_list[type] = entry;
281 return (entry->refcnt);
285 * Remove active list entry from the list and free it.
291 pk11_active_remove(PK11_active *entry, PK11_OPTYPE type)
295 /* remove the entry from the list and free it */
296 if ((prev_entry = entry->prev) != NULL) {
297 prev_entry->next = entry->next;
298 if (entry->next != NULL) {
299 entry->next->prev = prev_entry;
302 active_list[type] = entry->next;
304 if (entry->next != NULL) {
305 entry->next->prev = NULL;
310 entry->h = CK_INVALID_HANDLE;
311 entry->prev = NULL;
312 entry->next = NULL;
313 OPENSSL_free(entry);
320 PK11_active *entry;
334 while ((entry = active_list[type]) != NULL) {
335 pk11_active_remove(entry, type);
341 * Search for active list entry associated with given PKCS#11 object handle,
342 * decrement its refcnt and if it drops to 0, disconnect the entry and free it.
344 * Return 1 if the PKCS#11 object associated with the entry has no references,
353 PK11_active *entry = NULL;
355 if ((entry = pk11_active_find(h, type)) == NULL) {
360 OPENSSL_assert(entry->refcnt > 0);
361 entry->refcnt--;
362 if (entry->refcnt == 0) {
363 pk11_active_remove(entry, type);