[sane-devel] HP ScanJet 5s

Henning Meier-Geinitz henning@meier-geinitz.de
Tue, 26 Feb 2002 21:01:13 +0100


Hi,

On Tue, Feb 26, 2002 at 05:28:29PM +0300, Max Vorobiev wrote:
> Can somebody perform full test for HP ScanJet 5S backend to include it to 
> SANE cvs?

I can't test if it really works because I don't have the scanner but
here are some hints:

Linux:

I'm getting the following warnings:
hpsj5s.c:120: warning: ANSI C forbids specifying structure member to initialize
hpsj5s.c:131: warning: ANSI C forbids specifying structure member to initialize

Irix:
Compilation with cc doesn't work because of the same problem:
hpsj5s.c  -DPIC -o .libs/hpsj5s.lo
cfe: Error: hpsj5s.c, line 120: Syntax Error
     {range:&ImageWidthRange}
 ----------^
cfe: Error: hpsj5s.c, line 128: Syntax Error
     sizeof(SANE_Word),
 ----^
cfe: Error: hpsj5s.c, line 131: Syntax Error
     {word_list:&ImageResolutionsList[0]}
 ---------------------------------------^
cfe: Warning 625: hpsj5s.c, line 133: Empty declaration
 };
 -^
gmake[1]: *** [hpsj5s.lo] Error 1
gmake[1]: Leaving directory `/tmp/sane-backends-1.0.7-cvs/backend'
gmake: *** [all-recursive] Error 1
Otherwise compilation is ok.

Solaris:
Ok.

AIX:
Ok.

Code:

hpsj5s.c:

* When running, the backend reports that it found the scanner. Can't
  be true because I don't have a scanner nor the kernel module. I
  would just otest if you can open the devicefile and otherwise return
  nothing. Or we list hpsj5s only commented ("#hpsj5s") in dll.conf.
  However, users of your scanner must enable this entry manually in
  this case.
* sane_init():
  While reading the config file, you copy each line into scanner_path
  without checking the length. If it's longer then PATH_MAX-1 --> bang!
* Not very important: I don't like these "BYTE", "WORD" and "DWORD"
  defines beacuse they are somewhat confusing (WORD is 2 bytes but
  usually 4). If you really need these types, can you just use
  u_int8_t, 16 and 32 types? Or if 16/32 bit isn't important, use
  SANE_Word and SANE_Byte?
* Also nor that important: Try using GNU indent to get consistent
  indententing.

hpsj5s.desc: 
  * Only the last of multiple URL entries are used currently, in this case your
    email address. If you like to see your webpage listed, remove the
    line with your email.
  * You can remove the ";" before the manpage as you now provide one.

All files: Grep for "scaner" and call it "scanner" :-)

To make it easier for the person who includes your backend into CVS,
please also include patches for AUTHORS and doc/sane.man.

I didn't read all your code but if it compiles and doesn't segfault
it's ok for me with the above mentioned changes.

Bye,
  Henning