home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 19 Printer
/
19-Printer.zip
/
lj2os2.zip
/
patches.os2
< prev
next >
Wrap
Text File
|
1993-04-28
|
11KB
|
412 lines
diff -c old/lj2.c new/lj2.c
*** old/lj2.c Fri Jul 31 16:21:04 1992
--- new/lj2.c Wed Apr 28 15:54:54 1993
***************
*** 51,56 ****
--- 51,61 ----
** compiled under OS/2 2.0 using C set/2.
** removed the message "printing page nn, line nn to make it look good under
** IBM's Workframe
+ *****************************************************************************
+ ** Revised 28-Apr-93 by Darrel Hankerson hankedr@mail.auburn.edu.
+ ** Output is now to stdout. Messages re-inserted. Perhaps a "quiet" mode
+ ** is needed. Code involving chars and fgetc corrected. copyname() was
+ ** broken. Makefile added for EMX and MSC.
**/
#include <stdio.h>
***************
*** 63,69 ****
#define MAXVERT 69 /* maximum lines per page on LaserJet */
! FILE *lp;
int line_no = 1;
int pagenum;
--- 68,74 ----
#define MAXVERT 69 /* maximum lines per page on LaserJet */
! FILE *lp;
int line_no = 1;
int pagenum;
***************
*** 99,104 ****
--- 104,113 ----
int first;
int jim;
+ #ifdef __EMX__
+ _wildcard (&argc, &argv);
+ #endif
+
if (argc <= 1)
{
usage();
***************
*** 105,112 ****
exit(1);
}
!
! lp = fopen("PRN","w+");
/* initialize the LaserJet for landscape printing */
--- 114,121 ----
exit(1);
}
! /* lp = fopen("PRN","w+"); */
! lp = stdout;
/* initialize the LaserJet for landscape printing */
***************
*** 113,119 ****
fprintf( lp,"\033E\033&l1O\033(s17H\033&l5.14C\033&l70F\033&l5E" );
for (first = 1; first < argc; first++) {
! if (*argv[first] != '/' && *argv[first] != '-') /* check for flags */
break; /* and exit if none */
argv[first]++;
switch (tolower(*argv[first])) {
--- 122,128 ----
fprintf( lp,"\033E\033&l1O\033(s17H\033&l5.14C\033&l70F\033&l5E" );
for (first = 1; first < argc; first++) {
! if (*argv[first] != '-') /* check for flags */
break; /* and exit if none */
argv[first]++;
switch (tolower(*argv[first])) {
***************
*** 130,136 ****
case 't': /* Horizontal tab value */
tab = atoi(++argv[first]);
if (tab < 1 || tab > 8) {
! printf("Invalid tab value specified -- defaulting to 8\n");
tab = 8;
}
break;
--- 139,145 ----
case 't': /* Horizontal tab value */
tab = atoi(++argv[first]);
if (tab < 1 || tab > 8) {
! fprintf(stderr, "Invalid tab value specified -- defaulting to 8\n");
tab = 8;
}
break;
***************
*** 137,143 ****
case 'l':
MAXLINE = atoi(++argv[first]);
if (MAXLINE < 1 || MAXLINE > MAXLINE_RESET) {
! printf("Invalid lines/page value specified -- defaulting to MAX\n");
MAXLINE = MAXLINE_RESET;
}
break;
--- 146,152 ----
case 'l':
MAXLINE = atoi(++argv[first]);
if (MAXLINE < 1 || MAXLINE > MAXLINE_RESET) {
! fprintf(stderr, "Invalid lines/page value specified -- defaulting to MAX\n");
MAXLINE = MAXLINE_RESET;
}
break;
***************
*** 161,177 ****
formfeed++;
break;
default:
! printf("Invalid Flag Specified ('%s') -- ignored.....\n",
--argv[first]);
break;
}
}
! printf("Lines per page set to %d\n",MAXLINE);
if(duplex) {
if((argc - 1) > first) {
! printf("Only one file at a time may be printed when using DUPLEX mode.\n");
exit(1);
}
}
--- 170,186 ----
formfeed++;
break;
default:
! fprintf(stderr, "Invalid Flag Specified ('%s') -- ignored.....\n",
--argv[first]);
break;
}
}
! fprintf(stderr, "Lines per page set to %d\n",MAXLINE);
if(duplex) {
if((argc - 1) > first) {
! fprintf(stderr, "Only one file at a time may be printed when using DUPLEX mode.\n");
exit(1);
}
}
***************
*** 182,192 ****
fp = fopen(fname ,"r");
if( fp == NULL )
{
! printf( "File %s doesn't exist.\n", fname );
}
else
{
! printf( "Now printing %s\n", fname );
printfile( fname );
fclose( fp );
}
--- 191,201 ----
fp = fopen(fname ,"r");
if( fp == NULL )
{
! fprintf(stderr, "File %s doesn't exist.\n", fname );
}
else
{
! fprintf(stderr, "Now printing %s\n", fname );
printfile( fname );
fclose( fp );
}
***************
*** 197,205 ****
fputc('\f', lp);
*/
fprintf( lp, "\r\033E" ); /* clear LaserJet */
! fclose(lp);
-
}
/*************************************************************************
--- 206,214 ----
fputc('\f', lp);
*/
fprintf( lp, "\r\033E" ); /* clear LaserJet */
! if (lp != stdout)
! fclose(lp);
}
/*************************************************************************
***************
*** 214,220 ****
int retval = 0;
int printed = 0;
int pass=0;
! char c2;
int f_feed=0;
int phys_pages=0;
int plus=1;
--- 223,229 ----
int retval = 0;
int printed = 0;
int pass=0;
! int c2;
int f_feed=0;
int phys_pages=0;
int plus=1;
***************
*** 232,238 ****
if(feof(fp)) break;
switch (c2) {
case EOF:
- case '\377':
case '\032':
retval = -1;
break;
--- 241,246 ----
***************
*** 264,270 ****
if(feof(fp)) break;
switch (c2) {
case EOF:
- case '\377':
case '\032':
retval = -1;
break;
--- 272,277 ----
***************
*** 310,316 ****
retval=0;
pagenum=1;
do_print = 0;
! printf("\nFlip the paper and press any key when ready\n");
z = getchar();
goto do_it_again;
}
--- 317,323 ----
retval=0;
pagenum=1;
do_print = 0;
! fprintf(stderr, "\nFlip the paper and press any key when ready\n");
z = getchar();
goto do_it_again;
}
***************
*** 326,332 ****
printpage()
{
! char c;
int line,col;
static int cont = 0;
static char *cont1 = "---->";
--- 333,339 ----
printpage()
{
! int c;
int line,col;
static int cont = 0;
static char *cont1 = "---->";
***************
*** 353,359 ****
case '\r':
case '\f':
case EOF:
- case '\377':
case '\032':
break;
default:
--- 360,365 ----
***************
*** 370,389 ****
}
if(col == 0) {
! /*********************************************/
! /* removed the following lines to make it work good under IBM's Workframe *
! * if(do_print) {
! * printf("Printing page %4.4d line %4.4d\r",pagenum-1,line);
! * }
! * else {
! * printf("Skipping page %4.4d line %4.4d\r",pagenum-1,line);
! * }
! */
if(numbers) {
if(do_print) fprintf(lp,"%4.4d:",line_no);
col=5;
! }
! ++line_no;
}
switch(c)
--- 376,392 ----
}
if(col == 0) {
! if(do_print) {
! fprintf(stderr, "Printing page %4.4d line %4.4d\r",pagenum-1,line);
! }
! else {
! fprintf(stderr, "Skipping page %4.4d line %4.4d\r",pagenum-1,line);
! }
if(numbers) {
if(do_print) fprintf(lp,"%4.4d:",line_no);
col=5;
! }
! ++line_no;
}
switch(c)
***************
*** 407,413 ****
line = MAXLINE; /* force termination of loop */
break;
case EOF: /* EOF mark */
- case '\377': /* EOF mark */
case '\032': /* EOF mark */
return(-1);
default: /* no special case */
--- 410,415 ----
***************
*** 498,506 ****
copyname(to, from)
char *to, *from;
{
! while (*from)
! *to++ = toupper(*from++);
! *to = 0;
}
/************************************************************************/
--- 500,512 ----
copyname(to, from)
char *to, *from;
{
! #if __EMX__ || _MSC_VER
! strcpy(to, from);
! #else
! do {
! *to++ = toupper(*from);
! } while (*from++);
! #endif
}
/************************************************************************/
***************
*** 507,527 ****
usage()
{
! printf("\nUSAGE:\n\n");
! printf("C>LJ2 [flags] filename1 [filename2 ..........]\n");
! printf("\tItems shown in brackets are optional.");
! printf("\n\n\tFilename(s) may include wildcards");
! printf("\n\n\tFlags are:\n");
! printf("\t\t-e (or /e) select Helv proportional 6 PT font\n");
! printf("\t\t-h (or /h) suppress page headers\n");
! printf("\t\t-tx (or /tx) set tab stop value (where x is 1 to 8)\n");
! printf("\t\t-p (or /p) do not leave blank half pages between files\n");
! printf("\t\t-s (or /s) shade every other line\n");
! printf("\t\t-n (or /n) print line numbers\n");
! printf("\t\t-b (or /b) indent for punching\n");
! printf("\t\t-d (or /d) for duplex printing\n");
! printf("\t\t-lxx (or /lxx) set lines/page to x(where x is 1 to 66)\n");
! printf("\t\t-i (or /l) ignore formfeed characters\n");
}
--- 513,529 ----
usage()
{
! fprintf(stderr, "\nUsage: lj2 [flags] file1 [file2 ...]\n\n");
! fprintf(stderr, "\t-e select Helv proportional 6 PT font\n");
! fprintf(stderr, "\t-h suppress page headers\n");
! fprintf(stderr, "\t-tx set tab stop value (where x is 1 to 8)\n");
! fprintf(stderr, "\t-p do not leave blank half pages between files\n");
! fprintf(stderr, "\t-s shade every other line\n");
! fprintf(stderr, "\t-n print line numbers\n");
! fprintf(stderr, "\t-b indent for punching\n");
! fprintf(stderr, "\t-d for duplex printing\n");
! fprintf(stderr, "\t-lxx set lines/page to x(where x is 1 to 66)\n");
! fprintf(stderr, "\t-i ignore formfeed characters\n");
}
***************
*** 536,540 ****
fprintf (lp, "\033&f1S");
}
-
-
--- 538,540 ----
Only in new: lj2.def
Binary files old/lj2.exe and new/lj2.exe differ
Only in new: lj2bnd.exe
Only in new: makefile.os2
Only in new: ORIG
Only in new: readme.os2