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

  1. /* da_special - open special file names
  2.  
  3.     Copyright (c) 1985 by JMI Software Consultants, Inc.
  4.  */
  5. #include "acom.h"
  6. #include "host.h"
  7. #include "adl.h"
  8.  
  9. INT da_special(name, isoutput)
  10.     TEXT *name;
  11.     BOOL isoutput;
  12.     {
  13.     IMPORT struct adm_var avar;
  14.     TEXT buf[6];
  15.     INT n;
  16.  
  17.     for (n = 0; n < 5 && name[n]; ++n)
  18.         buf[n] = tolower(name[n]);
  19.     buf[n] = NULLCH;
  20.     if (strcmp(buf, "scrn:") == 0)
  21.         return(open("CON", D_OPEN, S_IWRITE));
  22.     if (strcmp(buf, "kybd:") == 0)
  23.         return(open("CON", D_OPEN, S_IWRITE));
  24.     else if (strcmp(buf, "lpt1:") == 0)
  25.         return(open("LPT1", D_OPEN, S_IWRITE));
  26.     else if (strcmp(buf, "lpt2:") == 0)
  27.         return(open("LPT2", D_OPEN, S_IWRITE));
  28.     else if (strcmp(buf, "lpt3:") == 0)
  29.         return(open("LPT3", D_OPEN, S_IWRITE));
  30.     else if (strcmp(buf, "com1:") == 0)
  31.         return(open("AUX", D_OPEN, S_IWRITE));
  32.     else if (strcmp(buf, "com2:") == 0)
  33.         return(open("AUX", D_OPEN, S_IWRITE));
  34.     return (-1);
  35.     }
  36.