By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,507 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,507 IT Pros & Developers. It's quick & easy.

Re: C and faxes

P: n/a
On Sun, 02 Nov 2008 20:09:29 -0600, Jack Klein wrote:
On Sat, 1 Nov 2008 20:37:24 -0700, George <ge****@example.invalid>
wrote in comp.lang.c:

[slightly re-ordered]
>Grateful for any hints,

Perhaps you should visit the C Unleashed page on my web site:

http://jk-technology.com/C_Unleashed/code_list.html
I'm only half done with it. That you credit only jaysome with correcting
your Hamming code is your choice. No single entity *can* in a lot of ways.
In some sense, every value is triangulated by concurrent errors.
>
One of the source files linked is:

"text2bin.c 240,894 This program generates binary pixel image files,
suitable for encoding by encode.c, from ASCII text files (see
Chap18.txt for more information). Note size, contains large character
generator arrays!"

The next one you want to look at is:

"lj300.c 3,213 This program will generate files for an HP
LaserJet or compatible printer to output the images from encode.c,
decode.c, and test2bin.c (see Chap18.txt for more information)"

I've got these both on disc and a couple tricks up my sleeve here.
>
In fact, I used these two programs extensively in testing the T4
encoding and decoding programs. I generated image files with
text2bin, and used lj300 to generate files I could send to the
printer. Then I encoded and decoded them, and printed them to make
sure I got back the same thing I put in.

If your printer has PCL emulation, and many do, you should be able to
use lj300. If not, you should be able to get information on your
printer and use lj300.c as a starting point for a program to generate
binary files suitable for your printer.

As for sending the PCL 300 DPI image to the printer, I was running
Win98 SE in those days, and my Laser Jet 4 was attached to a parallel
printer port. The command line:

"copy /b filename.ext lpt1"

...worked just fine.

Of course, the Laser Jet and the computer that used to run Windows 98
have long ago been recycled.
Thanks, Jack. Right off the bat that dos command needs updating with my
setup. Keith has posted an ng before that could address it: comp.os -
ms-dos.progammer.something ?
Good luck with your project.
What I'm struggling with now is my C setup. I've taken steps to enter
gcc's mailing list, but I want a c compiler when I stumble home from the
pub tonight.

I get gcc to execute, but gcc can't find the headers when these are my
compiler complaints and configuration:

C:\Program Files\gfortran\source>gcc -o out text2bin.c
text2bin.c:33:19: error: stdio.h: No such file or directory
text2bin.c:34:20: error: stdlib.h: No such file or directory
text2bin.c:35:20: error: string.h: No such file or directory
text2bin.c: In function 'main':
text2bin.c:4957: error: 'FILE' undeclared (first use in this function)
text2bin.c:4957: error: (Each undeclared identifier is reported only once
text2bin.c:4957: error: for each function it appears in.)
text2bin.c:4957: error: 'input' undeclared (first use in this function)
text2bin.c:4958: error: 'output' undeclared (first use in this function)
text2bin.c:4983: error: 'stderr' undeclared (first use in this function)
text2bin.c:4984: error: 'EXIT_FAILURE' undeclared (first use in this
function)
text2bin.c:4986: error: 'NULL' undeclared (first use in this function)
text2bin.c:4988: warning: incompatible implicit declaration of built-in
function
'fprintf'
text2bin.c:4993: warning: incompatible implicit declaration of built-in
function
'fprintf'
text2bin.c:4999: warning: incompatible implicit declaration of built-in
function
'fprintf'
text2bin.c:5012: warning: incompatible implicit declaration of built-in
function
'memset'
text2bin.c:5026: warning: incompatible implicit declaration of built-in
function
'strchr'
text2bin.c:5039: warning: incompatible implicit declaration of built-in
function
'fwrite'
text2bin.c:5051: warning: incompatible implicit declaration of built-in
function
'printf'
text2bin.c:5052: error: 'EXIT_SUCCESS' undeclared (first use in this
function)

C:\Program Files\gfortran\source>cd ..

C:\Program Files\gfortran>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55

Directory of C:\Program Files\gfortran

11/03/2008 01:09 PM <DIR .
11/03/2008 01:09 PM <DIR ..
11/03/2008 01:08 PM <DIR bin
11/03/2008 01:08 PM <DIR doc
06/03/2008 04:11 PM 35,819 GPL.txt
11/03/2008 01:08 PM <DIR include
11/03/2008 01:08 PM <DIR lib
11/03/2008 01:08 PM <DIR libexec
11/05/2007 04:37 PM 1,315 perl3.lnk
06/03/2008 04:11 PM 4,845 README.html
11/03/2008 01:12 PM <DIR source
11/03/2008 01:08 PM 34,851 uninstaller.exe
4 File(s) 76,830 bytes
8 Dir(s) 75,307,155,456 bytes free

C:\Program Files\gfortran>

Good grief. How can dos find gcc and gcc not find stdio.h?
--
George

Freedom itself was attacked this morning by a faceless coward, and freedom
will be defended.
George W. Bush

Picture of the Day http://apod.nasa.gov/apod/
Nov 4 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.