[sane-devel] SANE2 standard revisited: image data format

Henning Meier-Geinitz henning@meier-geinitz.de
Tue, 10 Dec 2002 20:10:21 +0100


Hi,

On Tue, Dec 10, 2002 at 01:53:47PM -0500, Matto Marjanovic wrote:
>  >Some details:
>  >
>  >| 4.3.8 sane_get_parameters
>  >http://www.meier-geinitz.de/sane/sane2/0.07/doc012.html#s4.3.8
>  >
>  >|typedef struct
>  >|  {
>  >[...]
>  >|    char reserved[32]; /* 32 bytes for future use */
>  >|  }
>  >| SANE_Parameters;
>  >
>  >--> SANE_Char, not char
> 
> SANE_Byte, not SANE_Char!  :)

u_int8_t, not SANE_Byte :-)

> SANE_Char is (according to the standard) used for a textual character,
>  which may or may not be a byte in the future.  SANE_Byte is a byte.

SANE_Byte is a data type that can carry AT LEAST a byte.
Theoretically, it may be bigger.

> Although, technically SANE_Byte could be bigger than a byte; it just has
>  to be able to hold a byte.  How about "uint8_t"?  It's standard, no?

I should read to the end first :-)

It won't work this way, for other reasons. You don't know the size of
e.g. SANE_String (pointer) or SANE_Word  so if you add some new
members, you don't know, to which value 32 must be decreased.

SANE_Int could be 4 bytes, or 8. Or maybe something different?

So probably the way to go is something like:

SANE_String reserved1, reserved2, reserved3;
SANE_Word reserved1, reserved2, reserved3;

Or similar.

Bye,
  Henning