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

  1. /* ------------------------- ds.c ------------------------ */
  2.  
  3. /*  Display the data of a file on stdout.  Type the filename 
  4.  *  and a list of data element names.  The query response is 
  5.  *  sent to the standard output device.  If no element list 
  6.  *  is typed, the query uses the format of the file record.
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include "cdata.h"
  11.  
  12. main(argc, argv)
  13. int argc;
  14. char *argv[];
  15. {
  16.     int f, iplist [MXELE+1];
  17.     static int fl [] = {0, -1};
  18.     extern void dblist();
  19.  
  20.     if (argc > 1)    {
  21.         if ((f = filename(argv[1])) != ERROR)    {
  22.             *fl = f;
  23.             db_open("", fl);
  24.             if (argc == 2)
  25.                 dblist(stdout, TRUE, f, 1, file_ele [f]);
  26.             else if (ellist(argc - 2, argv + 2, iplist) == OK)
  27.                 dblist(stdout, TRUE, f, 0, iplist);
  28.             db_cls();
  29.         }
  30.     }
  31. }
  32.  
  33.