Open System Services Programmer's Guide

fprintf(stderr, "SPOOLCONTROL failed: %s\n", printer);
fprintf(stderr, "retcode = %d\n", retcode);
exit(1);
}
retcode = SPOOLEND( /* complete the spool job */
, /* 16-bit level-3 buffer */
0104, /* flag - attributes of job */
/* 0100 - hold bit on */
/* 0004 - job priority = 4 */
l3buffer
);
if (retcode != 0) {
fprintf(stderr, "SPOOLEND error %d\n", retcode);
exit(1);
}
fclose(infile); /* close input file */
FILE_CLOSE_(filenum); /* close printer file */
printf("File %s spooled to %s printer\n", pathname,printer);
exit(0);
return 0; /* keep compiler happy */
}
Sending an OSS File Directly to a Printer
Your application can send an OSS file or output directly to a printer.
Example 54 (page 232) shows how to send an OSS file directly to a printer. You must specify the
printer using the Guardian filename format; you cannot access a printer by using its name in the
/G directory. For further information on working with printers directly, refer to the Guardian
Programmer’s Guide. In this example, the printer is opened using the Guardian FILE_OPEN_
procedure, control messages are sent using the CONTROL procedure, and data is written using
the WRITEX procedure. This example uses the escape sequences for a 5515/5516/5518 printer.
Control codes are dependent on the printer. They are listed in the Guardian Programmer’s Guide
and in manuals for the printer you are using.
Printer I/O 231