Category : C Source Code
Archive   : BARCOD.ZIP
Filename : PRBAR.TSH

 
Output of file : PRBAR.TSH contained in archive : BARCOD.ZIP
/*
* prbar - print a thick or thin line or space
* TOSH/QUME version (P321)
* written 1987 David J. Rodman
* Paradise Technology, Inc.
*/

#include
extern int res, depth; /* settings for width and heigth of barcode */
static char *str; /* the string to encode */
extern char *text[]; /* text for the right-hand part of label */
extern lineno; /* current line of label */


/*
* initialize the printer as required to print string s
*/
prinit(s)
char *s;
{
char *asclen(); /* convert string length to ascii chars */
int n;

str = s;
n = 16 * res * (strlen(s) + 2); /* total # of graphic bytes */
printf("%c%c%c", 0x1b, 0x1e, 7); /* 8 lpi */
printf("%c>", 0x1b); /* no bidirectional print */
printf("%c;%s", 0x1b, asclen(n)); /* enter graphics mode */
}

/*
* print bottom line defined as text[0]
*/
prfini()
{
int i;

printf("\n%s\n", text[0]);
}

static char *asclen(n)
{
static char buf[5];
char *p;

sprintf(buf, "%4d", n);
for(p = &buf[0]; *p == ' '; p++)
*p = '0';
return &buf[0];
}

/*
* print an individual line or space, thick or thin
* args are boolean
*/
prbar(thick, line)
{
int w, c;

w = res * (thick ? 3 : 1);
c = line ? 0xff : 0;
while(w--)
printf("%c%c%c%c", c, c, c, c);
}

/*
* move down one line, printing the appropriate text
*/
prdown()
{
printf(" %s", text[lineno++]);
printf("%c%c", 0x0d, 0x0a);
}



  3 Responses to “Category : C Source Code
Archive   : BARCOD.ZIP
Filename : PRBAR.TSH

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/