| 1 |
< |
/* Copyright (c) 1987 Regents of the University of California */ |
| 2 |
< |
|
| 3 |
< |
/* SCCSid "$SunId$ LBL" */ |
| 4 |
< |
|
| 1 |
> |
/* RCSid $Id$ */ |
| 2 |
|
/* |
| 3 |
|
* driver.h - header file for interactive device drivers. |
| 7 |
– |
* |
| 8 |
– |
* 2/2/87 |
| 4 |
|
*/ |
| 5 |
|
|
| 6 |
+ |
#include "copyright.h" |
| 7 |
+ |
|
| 8 |
|
struct driver { /* driver functions */ |
| 9 |
< |
int (*close)(); /* close device */ |
| 10 |
< |
int (*clear)(); /* clear device */ |
| 11 |
< |
int (*paintr)(); /* paint rectangle */ |
| 9 |
> |
void (*close)(); /* close device */ |
| 10 |
> |
void (*clear)(); /* clear device */ |
| 11 |
> |
void (*paintr)(); /* paint rectangle */ |
| 12 |
|
int (*getcur)(); /* get cursor position */ |
| 13 |
< |
int (*comout)(); /* command line output */ |
| 14 |
< |
int (*comin)(); /* command line input */ |
| 15 |
< |
int (*flush)(); /* flush output */ |
| 13 |
> |
void (*comout)(); /* command line output */ |
| 14 |
> |
void (*comin)(); /* command line input */ |
| 15 |
> |
void (*flush)(); /* flush output */ |
| 16 |
|
double pixaspect; /* pixel aspect ratio */ |
| 17 |
|
int xsiz, ysiz; /* device size */ |
| 18 |
|
int inpready; /* input ready on device */ |
| 19 |
|
}; |
| 23 |
– |
|
| 24 |
– |
extern int stderr_v(); /* error vectors */ |
| 25 |
– |
extern int (*wrnvec)(), (*errvec)(), (*cmdvec)(); |
| 26 |
– |
|
| 27 |
– |
extern struct driver *comm_init(); /* stream interface */ |
| 20 |
|
/* magic numbers for verification */ |
| 21 |
|
#define COM_SENDM 0x6f37 |
| 22 |
|
#define COM_RECVM 0x51da |
| 35 |
|
struct driver *(*init)(); /* initialize device */ |
| 36 |
|
} devtable[]; /* supported devices */ |
| 37 |
|
|
| 38 |
+ |
extern char dev_default[]; /* default device name */ |
| 39 |
+ |
|
| 40 |
|
#define MB1 ('\n') /* mouse button 1 */ |
| 41 |
|
#define MB2 ('\r') /* mouse button 2 */ |
| 42 |
|
#define MB3 (' ') /* mouse button 3 */ |
| 52 |
|
* The name string identifies the driver, |
| 53 |
|
* and the id string identifies the client. |
| 54 |
|
* A device can be open by at most one client. |
| 55 |
< |
* Be verbose in error reports; call stderr_v(). |
| 56 |
< |
* If device has its own error output, set errvec, |
| 63 |
< |
* cmdvec and wrnvec. |
| 55 |
> |
* Be verbose in error reports; call eputs(). |
| 56 |
> |
* If device has its own error output, set erract. |
| 57 |
|
* } |
| 58 |
|
* (*dev->close)() |
| 59 |
|
* { |
| 94 |
|
* assuming the in buffer is big enough. Unless prompt is NULL, |
| 95 |
|
* the driver may substitute its own rview command. This is |
| 96 |
|
* the most reliable way to repaint areas of the screen. |
| 97 |
< |
* If the user enters an unrecognized control character is entered, |
| 97 |
> |
* If the user enters an unrecognized control character, |
| 98 |
|
* terminate input and return the string with only that character. |
| 99 |
|
* The input string should not contain a newline. The routines in |
| 100 |
|
* editline.c may be useful. Comin must work in consort with comout. |
| 114 |
|
* when characters are ready on the input. (Often easiest |
| 115 |
|
* to check for input during calls to paintr.) |
| 116 |
|
*/ |
| 117 |
+ |
|
| 118 |
+ |
#ifdef NOPROTO |
| 119 |
+ |
|
| 120 |
+ |
extern void editline(); |
| 121 |
+ |
extern void tocombuf(); |
| 122 |
+ |
extern int fromcombuf(); |
| 123 |
+ |
extern struct driver *slave_init(); |
| 124 |
+ |
extern struct driver *comm_init(); |
| 125 |
+ |
extern int new_ctab(); |
| 126 |
+ |
extern int get_pixel(); |
| 127 |
+ |
extern void make_gmap(); |
| 128 |
+ |
extern void set_cmap(); |
| 129 |
+ |
extern void map_color(); |
| 130 |
+ |
|
| 131 |
+ |
#else |
| 132 |
+ |
/* defined in editline.c */ |
| 133 |
+ |
extern void editline(char *buf, int (*c_get)(), void (*s_put)()); |
| 134 |
+ |
extern void tocombuf(char *b, struct driver *d); |
| 135 |
+ |
extern int fromcombuf(char *b, struct driver *d); |
| 136 |
+ |
/* defined in devcomm.c */ |
| 137 |
+ |
extern struct driver *slave_init(char *dname, char *id); |
| 138 |
+ |
extern struct driver *comm_init(char *dname, char *id); |
| 139 |
+ |
/* defined in colortab.c */ |
| 140 |
+ |
extern int new_ctab(int ncolors); |
| 141 |
+ |
extern int get_pixel(COLOR col, void (*set_pixel)()); |
| 142 |
+ |
extern void make_gmap(double gam); |
| 143 |
+ |
extern void set_cmap(BYTE *rmap, BYTE *gmap, BYTE *bmap); |
| 144 |
+ |
extern void map_color(BYTE rgb[3], COLOR col); |
| 145 |
+ |
|
| 146 |
+ |
#endif |