Lines Matching defs:node

74   HashNode *head;   /* The head of the bucket hash-node list */
93 static HashNode *_del_HashNode(HashTable *hash, HashNode *node);
344 HashNode *node; /* The new node */
357 * See if a node with the same name already exists.
359 node = _find_HashNode(hash, bucket, name, NULL);
364 if(node) {
365 if(node->symbol.data && node->symbol.del_fn) {
366 node->symbol.data = node->symbol.del_fn(hash->app_data, node->symbol.code,
367 node->symbol.data);
370 * Allocate a new node if necessary.
373 node = _new_HashNode(hash, name, code, fn, data, del_fn);
374 if(!node)
378 * Install the node at the head of the hash-bucket list.
380 node->next = bucket->head;
381 bucket->head = node;
383 return &node->symbol;
393 * return HashNode * The deleted hash node (always NULL).
399 HashNode *prev; /* The node preceding the located node */
400 HashNode *node = _find_HashNode(hash, bucket, name, &prev);
404 if(node) {
406 * Remove the node from the bucket list.
409 prev->next = node->next;
411 bucket->head = node->next;
414 * Record the loss of a node.
418 * Delete the node.
420 (void) _del_HashNode(hash, node);
439 HashNode *node; /* The hash-table node of the requested symbol */
457 node = _find_HashNode(hash, bucket, name, NULL);
458 if(!node)
460 return &node->symbol;
464 * Private function used to allocate a hash-table node.
469 * hash HashTable * The table to allocate the node for.
476 * return HashNode * The new node, or NULL on error.
481 HashNode *node; /* The new node */
484 * Allocate the new node from the free list.
486 node = (HashNode *) _new_FreeListNode(hash->mem->node_memory);
487 if(!node)
491 * contents of 'node' at least up to the point at which it can be
494 node->symbol.name = NULL;
495 node->symbol.code = code;
496 node->symbol.fn = fn;
497 node->symbol.data = data;
498 node->symbol.del_fn = del_fn;
499 node->next = NULL;
504 node->symbol.name = _new_StringMemString(hash->mem->string_memory, len);
505 if(!node->symbol.name)
506 return _del_HashNode(hash, node);
512 strlcpy(node->symbol.name, name, len);
515 char *dst = node->symbol.name;
520 return node;
524 * Private function used to delete a hash-table node.
525 * The node must have been removed from its list before calling this
529 * hash HashTable * The table for which the node was originally
531 * node HashNode * The node to be deleted.
533 * return HashNode * The deleted node (always NULL).
535 static HashNode *_del_HashNode(HashTable *hash, HashNode *node)
537 if(node) {
538 node->symbol.name = _del_StringMemString(hash->mem->string_memory,
539 node->symbol.name);
543 if(node->symbol.data && node->symbol.del_fn)
544 node->symbol.data = node->symbol.del_fn(hash->app_data,
545 node->symbol.code,
546 node->symbol.data);
548 * Return the node to the free-list.
550 node->next = NULL;
551 node = (HashNode *) _del_FreeListNode(hash->mem->node_memory, node);
592 * prev HashNode ** If prev!=NULL then the pointer to the node
593 * preceding the located node in the list will
595 * if the name is not found or the located node is
597 * return HashNode * The located hash-table node, or NULL if not
603 HashNode *last; /* The previously searched node */
604 HashNode *node; /* The node that is being searched */
606 * Search the list for a node containing the specified name.
608 for(last=NULL, node=bucket->head;
609 node && hash->keycmp(node->symbol.name, name)!=0;
610 last = node, node=node->next)
613 *prev = node ? last : NULL;
614 return node;
625 * node_key const char * The lower-case hash-node key being compared
654 * node_key char * The lower-case hash-node key being compared against.
691 HashNode *node = bucket->head;
692 while(node) {
693 HashNode *next = node->next;
694 (void) _del_HashNode(hash, node);
695 node = next;
734 HashNode *node;
739 for(node=bucket->head; node; node=node->next) {
740 if(scan_fn(&node->symbol, context))