home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / install / printercfg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-24  |  3.6 KB  |  83 lines

  1. /* Text based printer configuration for the RHS install program */
  2. /* Michael Fulbright - 1997                                     */
  3. /*                                                              */
  4.  
  5. /* Most of this should be hidden in printercfg.c rather then exported
  6.    to the world, but... -ewt */
  7.  
  8. #ifndef _RHS_PRINTERCFG_H
  9.  
  10. #define _RHS_PRINTERCFG_H
  11.  
  12.  
  13. /* An entry in the 'printerdb' file, which describes each type of */
  14. /* supported printer                                              */
  15.  
  16. struct prnDBEntry {
  17.   char  *Entry;          /* Human-readable name of the entry       */
  18.   char  *GSDriver;       /* gs driver used by this printer         */
  19.   char  *Descr;          /* Single line description of printer     */
  20.   char  *About;          /* Lengthy description of printer         */
  21.   char **Resolution;     /* List of resolutions supported          */
  22.   char **ResDescr;       /* Description of each resolution         */
  23.   int    NumRes;         /* Length of list of resolutions          */
  24.   char **BitsPerPixel;   /* List of color depths supported         */
  25.   char **BppDescr;       /* Description of each color depth        */
  26.   int    NumBpp;         /* Length of list of color depths         */
  27. };
  28. typedef struct prnDBEntry DBEntry;
  29.  
  30. #define PRINTER_NONE    0
  31. #define PRINTER_LOCAL    1
  32. #define PRINTER_LPRREM    2
  33. #define PRINTER_SMB    3
  34.  
  35. /* A printcap entry */
  36. /* Only represents a subset of possible options available */
  37. /* Sufficient for the simple configuration we are interested in */
  38. struct prnPCEntry {
  39.     char *Queue;           /* Queue name, can have multi separated by '|' */
  40.     char *SpoolDir;        /* Spool directory                             */
  41.     char *Device;          /* Print device                                */
  42.     char *IF;              /* input filter                                */
  43.     char *AF;              /* accounting filter (needed for smbprint)     */
  44.     
  45.     int Type;
  46.     
  47.     /* these apply to all types and are not represented by printcap entry */
  48.  
  49.     /* following 4 are OBSOLETE */
  50. #if 0
  51.     char *PrinterDescr;    /* Engligh description of gsdriver             */
  52.     char *PrinterType;     /* Database entry for this queue               */
  53.     char *PrinterAbout;    /* Lengthy description                         */
  54.     char *GSDriver;        /* ghostscript driver to use                   */
  55. #endif
  56.     /* replaced by */
  57.     DBEntry *db;    /* entry in printer database for this printer  */
  58.     char *Resolution;      /* ghostscript resolution to use               */
  59.     char *PaperSize;       /* Papersize                                   */
  60.     char *BitsPerPixel;    /* ghostscript color option                    */
  61.     int CRLF;              /* Whether or not to do CR/LF xlation          */
  62.     
  63.     /* REMOTE (lpd) printers only */
  64.     char *RemoteHost;      /* Remote host (not used for all entries)      */
  65.     char *RemoteQueue;     /* Queue on the remote machine                 */
  66.     
  67.     /* SMB (LAN Manager) only */
  68.     char *SMBHost;         /* Server name (NMB name, can have spaces)      */
  69.     char *SMBHostIP;       /* Can optional specify and IP address for host */
  70.     char *SMBShare;        /* Name of share on the SMB server              */
  71.     char *SMBUser;         /* User to log in as on SMB server              */
  72.     char *SMBPasswd;       /* Corresponding password                       */
  73. };
  74. typedef struct prnPCEntry PCEntry;
  75.  
  76. /* location of the printer database in an installed system*/
  77. #define PRINTER_DB_FILE "/usr/lib/rhs/rhs-printfilters/printerdb"
  78. #define PRINTER_FILTER_DIR "/usr/lib/rhs/rhs-printfilters/"
  79.  
  80. int doConfigurePrinters (char *theroot, int direction);
  81.  
  82. #endif
  83.