Lines Matching refs:node

91 static HashNode *_del_HashNode(HashTable *hash, HashNode *node);
342 HashNode *node; /* The new node */ in _new_HashSymbol() local
357 node = _find_HashNode(hash, bucket, name, NULL); in _new_HashSymbol()
362 if(node) { in _new_HashSymbol()
363 if(node->symbol.data && node->symbol.del_fn) { in _new_HashSymbol()
364 node->symbol.data = node->symbol.del_fn(hash->app_data, node->symbol.code, in _new_HashSymbol()
365 node->symbol.data); in _new_HashSymbol()
371 node = _new_HashNode(hash, name, code, fn, data, del_fn); in _new_HashSymbol()
372 if(!node) in _new_HashSymbol()
378 node->next = bucket->head; in _new_HashSymbol()
379 bucket->head = node; in _new_HashSymbol()
381 return &node->symbol; in _new_HashSymbol()
398 HashNode *node = _find_HashNode(hash, bucket, name, &prev); in _del_HashSymbol() local
402 if(node) { in _del_HashSymbol()
407 prev->next = node->next; in _del_HashSymbol()
409 bucket->head = node->next; in _del_HashSymbol()
418 (void) _del_HashNode(hash, node); in _del_HashSymbol()
437 HashNode *node; /* The hash-table node of the requested symbol */ in _find_HashSymbol() local
455 node = _find_HashNode(hash, bucket, name, NULL); in _find_HashSymbol()
456 if(!node) in _find_HashSymbol()
458 return &node->symbol; in _find_HashSymbol()
479 HashNode *node; /* The new node */ in _new_HashNode() local
484 node = (HashNode *) _new_FreeListNode(hash->mem->node_memory); in _new_HashNode()
485 if(!node) in _new_HashNode()
492 node->symbol.name = NULL; in _new_HashNode()
493 node->symbol.code = code; in _new_HashNode()
494 node->symbol.fn = fn; in _new_HashNode()
495 node->symbol.data = data; in _new_HashNode()
496 node->symbol.del_fn = del_fn; in _new_HashNode()
497 node->next = NULL; in _new_HashNode()
502 node->symbol.name = _new_StringMemString(hash->mem->string_memory, len); in _new_HashNode()
503 if(!node->symbol.name) in _new_HashNode()
504 return _del_HashNode(hash, node); in _new_HashNode()
510 strlcpy(node->symbol.name, name, len); in _new_HashNode()
513 char *dst = node->symbol.name; in _new_HashNode()
518 return node; in _new_HashNode()
533 static HashNode *_del_HashNode(HashTable *hash, HashNode *node) in _del_HashNode() argument
535 if(node) { in _del_HashNode()
536 node->symbol.name = _del_StringMemString(hash->mem->string_memory, in _del_HashNode()
537 node->symbol.name); in _del_HashNode()
541 if(node->symbol.data && node->symbol.del_fn) in _del_HashNode()
542 node->symbol.data = node->symbol.del_fn(hash->app_data, in _del_HashNode()
543 node->symbol.code, in _del_HashNode()
544 node->symbol.data); in _del_HashNode()
548 node->next = NULL; in _del_HashNode()
549 node = (HashNode *) _del_FreeListNode(hash->mem->node_memory, node); in _del_HashNode()
602 HashNode *node; /* The node that is being searched */ in _find_HashNode() local
606 for(last=NULL, node=bucket->head; in _find_HashNode()
607 node && hash->keycmp(node->symbol.name, name)!=0; in _find_HashNode()
608 last = node, node=node->next) in _find_HashNode()
611 *prev = node ? last : NULL; in _find_HashNode()
612 return node; in _find_HashNode()
689 HashNode *node = bucket->head; in _clear_HashTable() local
690 while(node) { in _clear_HashTable()
691 HashNode *next = node->next; in _clear_HashTable()
692 (void) _del_HashNode(hash, node); in _clear_HashTable()
693 node = next; in _clear_HashTable()
732 HashNode *node; in _scan_HashTable() local
737 for(node=bucket->head; node; node=node->next) { in _scan_HashTable()
738 if(scan_fn(&node->symbol, context)) in _scan_HashTable()