#include "mfb.h"
#include "mfbP.h"
#include <dos.h>
#include <sys/types.h>
#include <sys/stat.h>
Go to the source code of this file.
static Bool dump |
( |
long |
size, |
|
|
FILE * |
fp |
|
) |
| |
|
static |
Definition at line 246 of file mkhpplot.c.
259 if (!buf) buf =
malloc(bsize);
268 sprintf(buf,
"Error: Printer driver %s not found.",
hc_device);
275 if (bsize > size) bsize = size;
283 while (size >= bsize) {
284 fread(buf,bsize,1,fp);
285 for (i = 0; i < bsize; i++)
290 fread(buf,size,1,fp);
291 for (i = 0; i < size; i++)
static char buf[MAXPROMPT]
void PrinterErrmsg(char *msg1, char *msg2)
static char hc_device[10]
Definition at line 26 of file mkhpplot.c.
35 fp = fopen(
"hpplot",
"wb");
53 "Hit any key to continue, q to abort:");
58 if (stat(
"hpplot",&b)) {
64 fp = fopen(
"hpplot",
"rb");
71 er =
dump((
long) b.st_size,fp);
void PrinterErrmsg(char *msg1, char *msg2)
Bool PrinterPortStatus(int which)
void PrinterErrmsg |
( |
char * |
msg1, |
|
|
char * |
msg2 |
|
) |
| |
Bool PrinterPortStatus |
( |
int |
which | ) |
|
Definition at line 228 of file mkhpplot.c.
240 if (i & 0x29)
return (
true);
Bool rasterize |
( |
FILE * |
fp | ) |
|
Definition at line 78 of file mkhpplot.c.
83 int i, j, k, kk, len, isdev = 0;
85 union {
unsigned short o[2];
long l; } p1;
87 unsigned char mask, chr;
89 if (!fp)
return (
true);
119 fprintf(fp,
"\033*p250X\033*p400Y\033*t100R\033*r1A");
129 for (i = 0; i <
pc.
ysize; i++) {
133 for (j = 0; j <
pc.
xsize; j++) {
135 outp(0x3cd,(cbuf = p1.o[1]) << 4);
138 mask = (mask >> 1) | (mask << 7);
158 fprintf(fp,
"\033*rB\014");
165 for (i = 0; i <
pc.
ysize; i++) {
169 for (k = 0; k < 4; k++) {
170 outpw(0x3ce,k << 8 | 4);
188 fprintf(fp,
"\033*rB\014");
static char buf[MAXPROMPT]
void PrinterErrmsg(char *msg1, char *msg2)
void SetPrinterDevice |
( |
char * |
device | ) |
|
Definition at line 301 of file mkhpplot.c.
309 else if (!strcmp(
device,
"lpt2"))
311 else if (!strcmp(
device,
"lpt3"))
313 else if (!strcmp(
device,
"lpt4"))
static char hc_device[10]
char hc_device[10] = {'p','r','n'} |
|
static |
char* hmsg = "hit any key to continue" |
|
static |