home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 170_01 / isamupd.c < prev    next >
Text File  |  1979-12-31  |  896b  |  42 lines

  1. /*
  2. **                 ISAMC - Written by John M. Dashner
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <ctype.h>
  7.  
  8. #include <isam.h>
  9.  
  10. /*
  11. **                  UPDATE - Control Record Update
  12. */
  13.  
  14. isamupd(hdr)
  15. struct isam *hdr;
  16. {
  17.     char buf[MAXKEY + 2];
  18.     struct rec1 *r1;
  19.     struct rec2 *r2;
  20.     r1 = (struct rec1 *) buf;
  21.     r2 = (struct rec2 *) buf;
  22.  
  23.     lseek(hdr->q7, 0L, 0);
  24.     r1->ttl_recs = hdr->q1;
  25.     r1->del_recs = hdr->q2;
  26.     if (write(hdr->q7, buf, hdr->q6 + 2))
  27.     {
  28.         isam_err = 8;
  29.         return ERROR;
  30.     }
  31.     r2->srt_recs = hdr->q3;
  32.     r2->del_ptr  = 0;       /* not presently used */
  33.     if (write(hdr->q7, buf, hdr->q6 + 2))
  34.     {
  35.         isam_err = 8;
  36.         return ERROR;
  37.     }
  38.     return NULL;
  39. }
  40.  
  41.  
  42.