home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 228_01 / isamcls.c < prev    next >
Text File  |  1987-07-31  |  1KB  |  45 lines

  1. /*
  2. HEADER:         CUGXXX;
  3. TITLE:          Close ISAM index (of ISAM system);
  4. DATE:           3-31-86;
  5. DESCRIPTION:    Part of ISAM Library;
  6. KEYWORDS:       ISAM;
  7. FILENAME:       ISAMCLS.C;
  8. WARNINGS:       None;
  9. AUTHORS:        John M. Dashner;
  10. COMPILER:       Lattice C;
  11. REFERENCES:     US-DISK 1310;
  12. ENDREF
  13. */
  14. /*
  15. **                 ISAMC - Written by John M. Dashner
  16. */
  17.  
  18. #include <stdio.h>
  19. #include <ctype.h>
  20.  
  21. #include <isam.h>
  22.  
  23. /*
  24. **                  CLOSE - Close an ISAMC Index
  25. */
  26.  
  27. isamcls(hdr)
  28. struct isam *hdr;
  29. {
  30.     if (hdr->q5 == 1)           /* ck if index needs to be sorted */
  31.         if (isamsrt(hdr) == ERROR)
  32.             return ERROR;
  33.     else                        /* if not, update the control records */
  34.         if (isamupd(hdr) == ERROR)
  35.             return ERROR;
  36.     if (close(hdr->q7) == ERROR)
  37.     {
  38.         isam_err = 8;
  39.         return ERROR;
  40.     }
  41.     free(hdr);
  42.     return NULL;
  43. }
  44.  
  45.