This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Stdprn in GCC
- From: David <decibel8 at charter dot net>
- To: gcc-help at gcc dot gnu dot org
- Cc: John Carter <john dot carter at tait dot co dot nz>
- Date: Tue, 22 Oct 2002 18:11:33 -0500
- Subject: Re: Stdprn in GCC
John Carter wrote:
If you want it to come out (directly) /dev/lp0 (the line printer port)
just open that and fire away.
Either that stuff it in a file and invoke "lpr fileName" at a later stage.
You can also pipe either stdout to "lpr" or fork and pipe to lpr.
A good reference source if the Linux Documentation Project (ask google)
and in particular the Linux Programmers Guide.
I searched google and haven't came up with anything yet, tried putting /dev/lp0
in there and piping it to lpr. Just get errors about it.
page = 0; line = 1; do_heading( argc[1] ); while( fgets(
buffer, 256, fp ) != NULL ) { if( line % 55 == 0 )
do_heading( argc[1] ); fprintf( stdprn, "%4d:\t%s",
line++, buffer ); } fprintf( stdprn, "\f" ); fclose(fp);
return 0; } /* Start function */ void do_heading( char *filename )
{ page++; if( page > 1) fprintf( stdprn, "\f");
fprintf( stdprn, "Page: %d, %s\n\n", page, filename ); }