[sane-devel] [patch] fix SANE_Device
Frank Zago
fzago@austin.rr.com
Sun, 14 Nov 2004 13:03:03 -0600
This is a multi-part message in MIME format.
--------------020906070304060802060600
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by ms-smtp-04.texas.rr.com id iAEJ34J5003498
>=20
> The SANE standard defines the comunication between frontend and backend.
> It does not define any structs that shall be internally used by the
> frontend or backend.
>=20
> I think the clean appoach is that the backend handles the texts interna=
l
> as non const strings and only creats the SANE_Device struct to return
> the data to the frontend. The SANE_Device struct is defined for the
> purpose to transfer the data from the backend to the frontend as const
> chars. When the backend has to use non const definitions then it is not
> allowed to use the SANE_Device struct so it has to use it=C2=B4s own da=
ta
> types and not the one of the SANE standard.
>=20
> Oliver
So, in that case what about the patch in attachment.
I've also changed the internal definition of SANE_Option_Descriptor for t=
he same=20
reason. It breaks about 5 backends, but they can all be easily fixed by=
hand=20
by removing a few const. I'd say that the current definition of SANE_Devi=
ce and=20
SANE_Option_Descriptor and created an ugly cascade of unnecessary casts a=
nd=20
consts in all the backends.
Frank.
--------------020906070304060802060600
Content-Type: text/plain;
name="sane.diff.part32"
Content-Disposition: inline;
filename="sane.diff.part32"
Content-Transfer-Encoding: base64
SW5kZXg6IGluY2x1ZGUvc2FuZS9zYW5lLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2
c3Jvb3Qvc2FuZS9zYW5lLWJhY2tlbmRzL2luY2x1ZGUvc2FuZS9zYW5lLmgsdgpyZXRyaWV2
aW5nIHJldmlzaW9uIDEuNgpkaWZmIC11IC0zIC1wIC1CIC1iIC11IC1yMS42IHNhbmUuaAot
LS0gaW5jbHVkZS9zYW5lL3NhbmUuaAkxMyBOb3YgMjAwNCAyMDoyOToxNCAtMDAwMAkxLjYK
KysrIGluY2x1ZGUvc2FuZS9zY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