ORCA-C/C.Samples/Text.Samples/Print.cc
Stephen Heumann ab975b611c Add C samples.
These are the samples from ORCA/C 2.1.0, converted to LF line endings.
2023-04-23 18:34:34 -05:00

35 lines
851 B
C++

/*****************************************************************
*
* Text Printer Demo
*
* This example shows how to access the .PRINTER text printer
* driver from a C program. The .PRINTER driver must be installed
* before this sample is executed.
*
* There really isn't much to this sample, which may seem bad at
* first, but it's really good: accessing the text printer driver
* really is as simple as opening the printer and writing to it!
*
* By Mike Westerfield
*
* Copyright 1993
* Byte Works, Inc.
*
*****************************************************************/
#pragma keep "Print"
#pragma lint -1
#include <stdio.h>
void main (void)
{
FILE *f;
f = fopen(".printer", "w+");
fprintf(f, "Hello, printer!\n");
fputc('\f', f); /* on most printers, this will eject a page */
fclose(f);
}