home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclint-2_3h-os2-bin.zip / test / db3 / ereftab.c < prev    next >
Text File  |  1997-09-03  |  753b  |  52 lines

  1. /*
  2. ** This is not a good implementation.  I should probably replace
  3. ** the erc with a hash table.  
  4. */
  5.  
  6. # include "ereftab.h"
  7.  
  8. ereftab ereftab_create (void) 
  9. {
  10.   return erc_create ();
  11. }
  12.  
  13. void ereftab_insert (ereftab t, employee e, eref er) 
  14. {
  15.   eref_assign (er, e);
  16.   erc_insert (t, er);
  17. }
  18.  
  19. bool ereftab_delete (ereftab t, eref er) 
  20. {
  21.   bool result;
  22.   
  23.   result = erc_member (er, t);  
  24.   erc_delete (t, er);
  25.   return result;
  26. }
  27.  
  28. eref ereftab_lookup (employee e, ereftab t) 
  29. {
  30.   employee e1;
  31.  
  32.   ereftab_elements(t, er)
  33.     {
  34.       e1 = eref_get(er);
  35.  
  36.       if (employee_equal(&e, &e1)) 
  37.     {
  38.       return er;
  39.     }
  40.     } end_ereftab_elements ;
  41.  
  42.   return eref_undefined;
  43. }
  44.  
  45. void ereftab_initMod (void) 
  46. {
  47.   bool_initMod ();
  48.   eref_initMod ();
  49.   erc_initMod ();
  50. }
  51.  
  52.