/*
 * $Date: $
 * $Source: $
 * $Revision: $
 * $State: $
 *
 * $Log: $
 */

#ifndef _EMU_LPT_H
#define _EMU_LPT_H

#include "emu_defs.h"

struct p_fops {
  int (*open) (int prtnum);
  int (*write) (int prtnum, int data);
  int (*flush) (int prnum);
  int (*close) (int prtnum);
  int (*realwrite) (int prnum, int data);
};

struct printer {
  const char *dev;
  const char *prtcmd;
  const char *prtopt;
  int         delay;
  int         base_port;	/* Base port address handled by device */
  /* end of user-set options */
  FILE       *file;
  int         remaining;
  struct p_fops fops;
};

/* status bits */
#define LPT_TIMEOUT	0x1
#define LPT_IOERR	0x8
#define LPT_ONLINE	0x10
#define LPT_NOPAPER	0x20
#define LPT_ACK		0x40
#define LPT_NOTBUSY	0x80

#define NUM_PRINTERS 3

EXTERN struct printer lpt[NUM_PRINTERS]      \
  INIT( {                                    \
	    {NULL, "lpr", "%s", 5, 0x378},   \
	    {"lpt2", "lpr", "%s", 5, 0x278}, \
	    {"lpt3", NULL, NULL, 10, 0x3bc}  \
	});

extern void  lpt_init(void);
extern void  lpt_reset(void);
extern void  lpt_term(void);

#endif /* _EMU_LPT_H */
