home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l200 / 6.ddi / LIB / FILES.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-09-11  |  916 b   |  48 lines

  1. /*    FILES(file) -- displays names of files on diskette
  2.  
  3.         Copyright (c) 1983, 1984  by  JMI Software Consultants, Inc.
  4.  */
  5.  
  6. #include "bio.h"
  7. #include "host.h"
  8.  
  9. /* This function requires DOS 2.0
  10.  */
  11. VOID FILES(file)
  12.     TEXT *file;
  13.     {
  14.     IMPORT INT strlpfx, strlen();
  15.     IMPORT VOID bwr_pbuf(), ptr_split();
  16.     IMPORT COUNT bwr_slot;
  17.     INTERN TEXT all[] = "*.*";
  18.     SEGREG reg;
  19.     REGVAL r;
  20.     TEXT dta[128];
  21.  
  22.     if (file == NULL)
  23.         file = all;
  24.     else
  25.         file += strlpfx;
  26.     ptr_split(dta, ®.s_ds, &r.dx);
  27.         r.ax = 0x1a00;
  28.         intdosx(&r, &r, ®);
  29.     r.ax = 0x4e00;
  30.     r.cx = 0x16;
  31.     ptr_split(file, ®.s_ds, &r.dx);
  32.     bwr_slot = 1;
  33.     intdosx(&r, &r, ®);
  34.         if (r.cflag == 0)
  35.         {
  36.            while (r.cflag == 0)
  37.         {
  38.         bwr_pbuf(&dta[30], strlen(&dta[30]));
  39.         bwr_nl(NO);
  40.         r.ax = 0x4f00;
  41.         intdosx(&r, &r, ®);
  42.         }
  43.         }
  44.     else if (r.ax == 2)
  45.         xerror(42, "FILES");
  46.     }
  47.  
  48.