/[m4]/m4/m4/hash.c
ViewVC logotype

Diff of /m4/m4/hash.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by gary, Thu Sep 20 03:48:05 2001 UTC revision 1.4 by gary, Sun Sep 30 14:43:38 2001 UTC
# Line 271  m4_hash_remove (m4_hash *hash, const voi Line 271  m4_hash_remove (m4_hash *hash, const voi
271    
272  /* Return the address of the value field of the first node in  /* Return the address of the value field of the first node in
273     HASH that has a matching KEY.  The address is returned so that     HASH that has a matching KEY.  The address is returned so that
274     an explicit 0 value can be distinguished from a failed lookup     an explicit 0 value can be distinguihed from a failed lookup
275     (also 0).  Fortuitously for M4, this also means that the value     (also 0).  */
    field can be changed `in situ' to implement a value stack.  */  
276  void **  void **
277  m4_hash_lookup (m4_hash *hash, const void *key)  m4_hash_lookup (m4_hash *hash, const void *key)
278  {  {
# Line 364  m4_hash_bucket_insert (m4_hash *hash, m4 Line 363  m4_hash_bucket_insert (m4_hash *hash, m4
363    while (bucket);    while (bucket);
364  }  }
365    
 void  
 m4_hash_exit (void)  
 {  
   while (m4_hash_node_free_list)  
     {  
       m4_hash_node *stale = m4_hash_node_free_list;  
       m4_hash_node_free_list = M4_HASH_NODE_NEXT (stale);  
       xfree (stale);  
     }  
 }  
   
366    
367    
368  struct m4_hash_iterator  struct m4_hash_iterator
# Line 460  m4_hash_iterator_key (m4_hash_iterator * Line 448  m4_hash_iterator_key (m4_hash_iterator *
448    return M4_HASH_NODE_KEY (M4_ITERATOR_PLACE (place));    return M4_HASH_NODE_KEY (M4_ITERATOR_PLACE (place));
449  }  }
450    
451  void **  void *
452  m4_hash_iterator_value (m4_hash_iterator *place)  m4_hash_iterator_value (m4_hash_iterator *place)
453  {  {
454    assert (place);    assert (place);
455    
456    return &M4_HASH_NODE_VAL (M4_ITERATOR_PLACE (place));    return M4_HASH_NODE_VAL (M4_ITERATOR_PLACE (place));
457  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26