home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / database / cdbms / dbinit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-01  |  613 b   |  29 lines

  1. /* ---------------- dbinit.c -------------------------- */
  2.  
  3. /*     This program is used to build the initial data base.  
  4.     It constructs all files and indexes.  
  5.     There is no data loaded,
  6.     and any existing files are deleted.    */
  7.  
  8. #include <stdio.h>
  9. #include "cdata.h"
  10.  
  11. extern char *dbfiles [];
  12. extern void file_create();
  13.  
  14. main ()
  15. {
  16.     int f = 0;
  17.     extern int rlen();
  18.     char fname [13];
  19.  
  20.     while (dbfiles [f])    {
  21.         sprintf(fname, "%.8s.dat", dbfiles [f]);
  22.         file_create(fname, rlen(f));
  23.         printf("\nCreating file %s with length %d",
  24.                             fname, rlen(f));
  25.          build_index("", f);
  26.         f++;
  27.     }
  28. }
  29.