Define a new enum that contains Avision data type codes and use those instead
of pure values. I also added a couple of helper functions for debugging the
command operation and data type code if read or send.
With the exception of use in three quotes as well as our inlcuded copy
of the GPL, all use of the Free Software Foundation's postal address
has been removed.
Re #320.
297mm is advertised in the official specs for this machine family.
Tested against the ScanJet 3300C and it doesn't bottom out or anything.
Issue came about because A4 is 297mm in height and 296mm too short.
Probably just a typo or an oversight.
- add new gray and color interlacing options for DR-C120
- initial support for DR-C120 and C130
- enable fine calibration for P-208 (per @sashacmc in !546)
The default values for string options are set using static (i.e.
non-malloced) strings. Later, if new values are loaded from the config
file, those SANE_Strings will then point to dynamically allocated memory
which is eventually leaked.
Change the initial values for the string options to NULL, and initialize
them to the proper values within sane_init() using strdup(). This way,
whenever the value for the string is changed, we can safely free() the
previous value.
This eliminates the other main source of memory leaks in the test backend.
This patch also updates sane_init for the test backend to properly cleanup
memory if it fails.
Inside Test_Device, track whether we've already called init_options().
If we have, don't call it again when calling sane_open() again.
Add a function cleanup_options() which frees the memory used for these
options, and call it in sane_exit() if we previously called
init_options().
Change Test_Devices to be initialized with calloc instead of malloc,
so that we can assume that uninitialized fields are NULL, and can safely
call free() on them unconditionally.
This eliminates some larger memory leaks within the test backend.
In the case where we are unable to get a path for loading libs, and
instead just use LIBDIR, we set 'src = strdup(LIBDIR)'. However, we
never update orig_src to point to src before tokenizing the path with
strsep(), so the memory is never freed.
Update load to always set orig_src to src so that we don't leak memory.