Category : Printer Utilities
Archive   : HPPRINT.ZIP
Filename : HPPRINT.DOC
HPPRINT.EXE is a short 'C' program to print out source code listings
on an HP-THINKJET printer. The program prints in compressed mode
with 80 lines per page. You should use the Alternate Mode on your
printer (for IBM-PC). With minor modifications, this can drive
most any dot-matrix printer...just find out what your codes for
compressed print and 8 lines per page are and modify.
Here's the source code for HPPRINT
/*
** Program: hpprint.c
** Function: file dump program for HP-THINKJET.
** Prints program in condensed mode, 8 lines to inch (80 lines page)
** Line Numbering optional.
** Date: 09/14/87
** Compiler: Microsoft, version 4.0
** Author: W. Grotophorst, Library Systems Office, George Mason U.
*/
#include
#include
#include
#include
#define MAX 225
#define BREAKPOINT 6
#define PutPrinter(ch) putc(ch,stdout)
#define PAGE 80
FILE *InFile;
main(argc,argv)
int argc;
char *argv[];
{
struct tm *newtime;
char *am_pm = "PM";
time_t long_time;
char line[MAX];
char fname[13]; /* holds name of file, print at top of each page */
int lines=0; /* line counter, per page */
int pc=1; /* page counter */
int i,lc=0;
time(&long_time);
newtime = localtime(&long_time);
if (newtime->tm_hour < 12) /* time routine from Microsoft */
am_pm = "AM"; /* C (version 4) reference */
if (newtime->tm_hour > 12) /* manual, page 262 */
newtime->tm_hour -= 12;
if (argc < 2) {
puts(" ");
puts("HPPRINT (c) 1987, GMUtant Software");
puts("Source Code print program for HP-Thinkjet printer (Alternate mode).");
puts("Program prints out source code listing in condensed print, 80 lines per page.");
puts("Line numbering is optional.");
puts(" ");
puts("Usage: HPPRINT FileName [l]
puts(" HPPRINT FileName [l] > LPT1:
puts(" [l] is optional, will add line numbers to source.");
exit(0);
}
strcpy(fname,argv[1]);
if (!(InFile = fopen(argv[1],"r"))) {
puts("hpprint [ERROR]: Can't find input file [%s]",argv[1]);
exit(0);
}
PutPrinter(15); /* HP THINKJET (Alt Mode) Compressed */
PutPrinter(27); /* 8 lines to */
PutPrinter(48); /* the inch */
printf("-------------------------------------------------------------------------------------------------------------\n");
printf("%s print date: %.16s %s \n",fname,asctime(newtime),am_pm);
printf("-------------------------------------------------------------------------------------------------------------\n");
while (fgets(line,MAX,InFile) != NULL)
{
lines++;
lc++;
if ( lines > PAGE )
{
for(i=1;i
pc++;
printf("%s (continued) page: %d\n\n",fname,pc);
lines = 0;
}
if (argc == 2)
printf(" %s",line);
else
{
printf("[%d] %s",lc,line);
}
}
fclose(InFile);
PutPrinter(18); /* Return Printer to Normal */
PutPrinter(27); /* 8 lines to */
PutPrinter(50); /* the inch */
} /* EOF: hpprint.c */
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/