Stdprn in GCC

David decibel8@charter.net
Tue Oct 22 16:13:00 GMT 2002



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






More information about the Gcc-help mailing list