This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 ); }




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]