1 | /* Copyright (C) 1991 QMS, Inc */ |
---|
2 | #define PRINTER_ADDR "125.0.0.3" |
---|
3 | |
---|
4 | #define PRINTER_PORT 35 |
---|
5 | #define PRINTER_TCP_PORT PRINTER_PORT |
---|
6 | #define PRINTER_UDP_PORT PRINTER_PORT |
---|
7 | |
---|
8 | #define MAX_STRING_SIZE 512 |
---|
9 | #define MAX_REPLY_SIZE 256 |
---|
10 | |
---|
11 | #ifdef SYSV |
---|
12 | #ifdef sparc |
---|
13 | #define TCP_PROVIDER "/dev/tcp" |
---|
14 | #define UDP_PROVIDER "/dev/udp" |
---|
15 | #else |
---|
16 | #define TCP_PROVIDER "/dev/inet/tcp" |
---|
17 | #define UDP_PROVIDER "/dev/inet/udp" |
---|
18 | #endif |
---|
19 | #define BUFSIZE 4096 |
---|
20 | #define POLL_TIMEOUT (99 * 10) /* in msecs */ |
---|
21 | #else |
---|
22 | #define BUFSIZE 16384 |
---|
23 | #endif |
---|
24 | |
---|
25 | #define UDP_TIMEOUT 99 /* in 1/100th of a second */ |
---|
26 | #define SLEEPTIME 10 |
---|
27 | #define NUMRETRY 10 |
---|
28 | |
---|
29 | #define STATFILE "./statfile" |
---|
30 | #define STATUSINTERVAL 20 /* msecs */ |
---|
31 | |
---|
32 | /* Status file codes */ |
---|
33 | |
---|
34 | #define STABASE 512 |
---|
35 | #define STAJSTART (STABASE + 0) |
---|
36 | #define STAFSTART (STABASE + 4) |
---|
37 | #define STANCOMP (STABASE + 8) |
---|
38 | #define STARETRY (STABASE + 12) |
---|
39 | #define STAACOMP (STABASE + 16) |
---|
40 | #define STASTERM (STABASE + 20) |
---|
41 | #define STAJCOMP (STABASE + 24) |
---|
42 | |
---|
43 | |
---|
44 | struct printer_pkt{ |
---|
45 | unsigned short pr_length; |
---|
46 | unsigned char pr_status; |
---|
47 | unsigned char pr_spare; |
---|
48 | unsigned long pr_age; |
---|
49 | unsigned long pr_supportmask; |
---|
50 | unsigned long pr_acceptmask; |
---|
51 | unsigned short pr_stroffset; |
---|
52 | unsigned short pr_strlength; |
---|
53 | }; |
---|
54 | |
---|
55 | struct file_list { |
---|
56 | char filename[MAX_STRING_SIZE]; |
---|
57 | struct file_list *next; |
---|
58 | }; |
---|
59 | |
---|
60 | struct command_opt { |
---|
61 | short input_stdin; |
---|
62 | char hostname[MAX_STRING_SIZE]; |
---|
63 | char statfile[MAX_STRING_SIZE]; |
---|
64 | struct file_list *flist; /* List of filenames to be printed */ |
---|
65 | int cpid; /* it's not really a command argument. But it's a good |
---|
66 | * (though not neat) way of stashing way the child process's |
---|
67 | * pid thus obviating the need to pass it as an argument from |
---|
68 | * zillion different places. |
---|
69 | */ |
---|
70 | }; |
---|
71 | |
---|
72 | |
---|
73 | /* |
---|
74 | * Printer status. |
---|
75 | */ |
---|
76 | #define PRINTER_READY 1 |
---|
77 | |
---|
78 | |
---|
79 | #ifdef DEBUG |
---|
80 | #define DBGPRT(a) printf a; |
---|
81 | #else |
---|
82 | #define DBGPRT(a) |
---|
83 | #endif |
---|
84 | |
---|
85 | #ifndef TRUE |
---|
86 | #define TRUE 1 |
---|
87 | #endif |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | |
---|