Mon Jan 27 19:32:29 1997  David Mosberger-Tang  <davidm@azstarnet.com>


	* doc/sane.tex (subsection{Device Descriptor Type}): Change vendor
 	name "None" to "Noname".
	* backend/pnm.c (dev): Change vendor name from "noname" to "Noname".

	* include/sane.h (SANE_STATUS_ACCESS_DENIED): New status value.
	* sanei/sane_strstatus.c (sane_strstatus): Return appropriate
	status string.

	* frontend/xscan.c (scan_dialog): Don't depend on first_frame
	when creating image---the old code didn't work for R/G/B-only
	frames anyhow, so there is no point pretending.

	* include/sane.h (SANE_Parameters): Rename first_frame to
	last_frame.
	* backend/metanet.c (sane_get_parameters): Update accordingly.
	* backend/qcam.c (sane_get_parameters): Ditto.
	* frontend/saned.c (readcmd): Ditto.
	* frontend/test.c (testsane): Ditto.
	* backend/mustek.c (sane_get_parameters): Set last_frame unless
	the current pass is acquiring a red- or green-only frame.

	* doc/sane.tex (subsection{sane_get_parameters)): Change
 	FIRST_FRAME into LAST_FRAME.

	* backend/metanet.c: Initialize PEER with -1.
	(sane_get_select_fd): Return PEER and succeed if not negative.

	* include/netsane.h (ns_printf, ns_scanf, netfd_wr, netfd_rd):
 	Remove (obsolete).

	* frontend/saned.c: Increase STRBUF size to 32KB to get better
	scan_read() throughput.

	* include/sane.h (SANE_Athorization_Callback): Return void
 	(instead of int) and make USERNAME and PASSWORD (pointers to)
 	return values.

	* frontend/saned.c (netsane_auth_callback): Update prototype.

	* backend/metanet.c (sane_init): Move assignments out of
 	if-conditional for clarity (and to avoid gcc warning).

	* sanei/sanei_printf.c: Include <memory.h>, <string.h>.

	* backend/Makefile.in (libsane-mustek.a): Replace
 	../sanei/sane_strstatus.o with appropriately defined EXTRA
	macro.

	* backend/mustek.c (attach): Initialize ld.mode to MLD_NORMAL for
 	all scanners but MFS-12000SP.
	(line_distance): In MD_MFS correction mode, do not issue LD
 	command.
	(sane_close): Free s->ld.red_buf if non-NULL.
	(fix_line_distance_mfs): New function.
	(fix_line_distance_normal): Rename from fix_line_distance().
	(reader_process): In MLD_MFS line-distance mode, call the
	mfs-specific routine, not the normal one.

	* backend/mustek.h (Mustek_Scanner): New members ld.red_buf,
 	ld.green_buf.
	(MUSTEK_FLAG_LD_MFS): New flag to indicate when MFS-specific
 	line-distance correction is needed.

	* backend/metanet.c: Fix up some minor formatting problems due
	to indent.

	* Merge in Andy's netsane diffs.

Sun Jan 26 00:04:22 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* frontend/xscan.c (zoom_in_preview): Ignore selections of zero
	or negative width/height.
	(set_max_selection): Use SANE_UNFIX() instead of open coding.
	Adapted to use gtkglue.

	* backend/metadl.c (sane_init): Grabe authorization callback.
	(authorization_callback): New variable.
	(load): Pass authorization callback to init function.

	* frontend/gtkglue.h (gsg_destroy_dialog): Add param_callback.

Sat Jan 25 17:35:52 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* frontend/Makefile.in (distclean): Mention $(TESTPROGRAMS).

	* backend/metanet.c (copy_opt): Fix constraint-length computation.

	* backend/metadl.c (sane_get_devices): Pass along LOCA_ONLY arg
	to backend.

	* frontend/xcam.c (main): Remove extraneous calls to gtk_exit()
	and sane_exit().

	* frontend/scan.c (main): Install sane_exit() as atexit handler.

	* backend/metadl.c (sane_get_devices): Ignore NULL BE_LIST.

	* frontend/saned.c (quit): New function.
	(main): catch SIGALRM, and SIGPIPE.

	* backend/metanet.c (sane_get_devices): Return empty list of
	LOCAL_ONLY is TRUE.

	* frontend/saned.c (readcmd): Don't take LOCAL arg from
 	request---always pass SANE_TRUE!

	* doc/netprotocol.doc (sane_get_devices): Don't need LOCAL arg.

	* include/sanei.h: Include <sane.h>.

	* frontend/test.c (testsane): Print status message instead of
	status code and make robust against failed calls.  Use fprintf(stderr
	instead of printf.

	* backend/qcam.c (reader_process): Remove extraneous arg.
	(reader_process): Declare `static' to make setjmp() safe.

	* frontend/saned.c (readcmd): Delete unused variable schr_hlp.
	(peerfp): New variable.
	Rename ns_printf() to sanei_printf() and pass peerfp arg.
	Rename ns_scanf() to sanei_scanf() and pass peerfp arg.
	(say_helo): Make peerfp refer to fd 0.

	* backend/metanet.c (openit): Return FILE*, not socket.
	(openit): Return 0, not -1 in case of failure.
	(peerfp): New variable.
	Rename ns_printf() to sanei_printf() and pass peerfp arg.
	Rename ns_scanf() to sanei_scanf() and pass peerfp arg.

	* sanei/sane_strstatus.c: New file (in lieu of backend/sane.c)
	* sanei/sanei_constrain_value.c: Ditto.
	* sanei/sanei_init_debug.c: Ditto.

	* sanei/sanei_scanf.c (ns_scanf): New file (based on Andy's
 	ns_scanf).
	Use int8_t for 'c', int32_t for 'd'.
	Include <sys/types.h>.

	* sanei/sanei_printf.c (sanei_printf): New file (based on Andy's
 	ns_printf).
	Use int8_t for 'c', int32_t for 'd'.
	Include <sys/types.h>.

	* include/netsane.h (CMD_SANE_STRS): Remove.

	* backend/metanet.c: Include <errno.h>
	(sane_strstatus): Remove.

	* backend/Makefile.in (BACKENDS): Mention libsane-metanet.

	* backend/metanet.c (openit): Use memcpy instead of bcopy.  Use
 	inet_aton() instead of inet_addr(), don't prototype.
	(sane_get_devices): Use strdup() instead of opencoding it.
	(sane_get_devices): Don't append " (NS)" to modelname!  Metanet
 	already prefixes the devicename with netsane, which is good
 	enough.

	* backend/sanei.h (IF_DBG): New macro.

	* PROJECTS (Backend): Mention saned, metanet, and autoadj.
	(Frontend): New info.

	* AUTHORS: Update to reflect sanescan -> xscan namechange.
	Credit Andy for netsane.

Fri Jan 24 00:01:45 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* doc/sane.tex (subsection{\code{sane\_get\_option\_descriptor}}):
	Define how long the returned option descriptor must remain valid.

	* frontend/gtkglue.c (autobutton_update): Check for
 	SANE_INFO_RELOAD_OPTIONS.
	(button_update): Ditto.

	* frontend/xcam.c (main): Add device info label.

	* backend/mustek.c (init_options): Make OPT_BRIGHTNESS and
 	OPT_CONTRAST inactive by default.

	* frontend/xcam.c (exit_callback): Only call gsg_destroy_dialog()
	if dialog is non-null.

Thu Jan 23 00:17:46 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/mustek.c (sane_control_option): Return
 	SANE_STATUS_DEVICE_BUSY when attempting to set option during
 	scanning.
	(sane_close): Call do_cancel(), not sane_cancel().
	(sane_start): Ditto.

	* backend/pnm.c (sod): Rename "File" group to "Source Selection".

	* frontend/xcam.c (device_name_dialog_cancel): New function.
	(device_name_dialog_ok): Ditto.
	(prompt_for_device_name): Ditto.
	(build_device_menu): Move "Rescan devices..." from build_files_menu()
	to here.  Add "Specify device name..." entry that invokes
	prompt_for_device_name.
	(play_stop_button): Ignore call if there is no device_dialog yet.
	(main): Don't attempt to set preview size if there is no device
	dialog yet.

	* frontend/gtkglue.c (text_entry_callback): Don't ignore tab
	key---it's used to switch focus!

	* backend/qcam.c (qc_wait): Return read value so optimizer won't
 	be able to get rid of it easily.
	(qc_lock_wait): Use same lockname as qcam-0.7d for
 	interoperability.
	(reader_process): Explicitly do an enable_ports() in the reader
 	process.  Linux/x86 doesn't inherit i/o port access rights.
	
	* frontend/xcam.c (stop_camera): New function.
	(input_available): Use stop_camera().
	(next_frame): Ditto.

	* backend/genscsi.c (genscsi_open): Add missing DBG_INIT(GENSCSI).
	(genscsi_cmd): Return SANE_STATUS_DEVICE_BUSY if EBUSY is
 	returned.

	* frontend/xcam.c (input_available): Fix line wrap for
 	SANE_FRAME_GRAY.

	* include/sane.h: Remove old SANE_STATUS_AGAIN.
	* backend/sane.c (sane_strstatus): Ditto.
	* backend/mustek.c (sane_read): Return SANE_STATUS_GOOD, not AGAIN
	when no data available.
	(sane_start): Add debug printing.
	(sane_set_io_mode): Fix typo: return SANE_STATUS_GOOD on success.

	* backend/mustek.c (sane_control_option): Add support for
 	OPT_BACKTRACK.
	(attach): Add lots of debug printing.

	* backend/qcam.README: New file.

	* backend/qcam.c (sane_control_option): Allow changing resolution
 	while scan is in progress, but set RELOAD_OPTIONS only if not
 	scanning already.

	* frontend/xcam.c (canvas_events): Get rid of old debug messages.

	* backend/qcam.c (sane_get_parameters): Update parameters only if
 	not scanning.  This makes it possible to change certain options
	(such as width/height while a scan is in progress).
	(sane_control_option): Allow changing of image corners,
 	transfer-scale, and depth while scan is in progress.  Set
	RELOAD_PARAMS only if scan is not in progress.
	(sane_start): Return DEVICE_BUSY if scan is in progress.

	* configure.in (PACKAGE_VERSION): Version 0.41 released.

	* backend/qcam.c (brightness_range): New variable.
	(init_options): Use brightness_range instead of u8_range to
	avoid going into bulb-mode accidentally.

Wed Jan 22 09:16:21 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/qcam.c (reader_process): Correct typo: it's buf, not
 	buffer that we want to write out in high-res mode.
	(qc_reset): New function.
	(reader_process): Send at least one byte of data after receiving a
 	signal.
	(sighandler): New function.
	(sane_cancel): If a read request is outstanding, cancel request by
 	(a) sending SIGINT to reader process, (b) reading one byte of data
 	in blocking mode, and then (c) reading whatever is left in the
 	pipe in non-blocking mode.
	(sane_read): Return SANE_STATUS_CANCELLED if SCANNING is not set.

	* backend/qcam.h (QC_Scanner): Remove unused x/y fields.

	* backend/qcam.c (sane_close): Call disable_ports().
	(sane_init): Replace isblank() with isspace() (former is a GNU
 	extension).
	(sane_control_option): Scale corner coordinates when switching
 	resolution and ensure they're always legal values.
	(sane_close): Check for reader_pid >= 0 not != 0!
	(sane_exit): Move disable_ports () from sane_close to here.
	(sane_start): Keep track of when we're holding lock.
	(sane_read): Release lock if s->holding_lock is TRUE and we
	read a few bytes.
	(sane_cancel): Release lock if it's being held.

	* backend/qcam.c: Clean up unused variables.

Tue Jan 21 13:49:00 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/qcam.c (sane_control_option): Keep track of changes to
 	option values.
	(sane_get_select_fd): Implemented.
	(sane_set_io_mode): Ditto.
	(reader_process): New function.
	(sane_start): Modify to use reader_process().

	* backend/qcam.h: (struct QC_Scanner): New field value_changed.

Mon Jan 20 22:11:11 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/metadl.c (sane_open): Correctly handle case where
	backend name is empty.

Sun Jan 19 10:29:43 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/qcam.c (attach): Add qc_wait() calls after each
 	write_lpcontrol() call to ensure reliable communication.
	(attach): Add debug output in case of failure.

	* Version 0.4 released.

Sat Jan 18 10:12:40 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* frontend/xscan.c (get_scan_size): Handle case where scan
 	width/height is of type SANE_TYPE_INT.
	(get_scan_size): If width/height unit is pixels and the height is
 	less than 500 pixels, use a ratio of 1.
	(device_dialog): Call update_complete_dialog() to ensure inactive
 	options do not show (there probably is a better solution to this).

	* frontend/scan.c (main): Compute bottom-right position as
 	top-left + width/height - 1 (the - 1 is new and necessary and
 	works both for fixed and integer values).
	(print_option): Insert line-break when column >= 79 (not 80) to
 	leave last column blank (better when running inside Emacs, for
 	example).
	(main): Fix typos: case 't': window[2] -> window[3], switch short
 	option names for top/left.
	(print_option): Print current option values (except for vectors).
	(fetch_options): Another off by one bug: width is br_x|y-tl_x|y+1.

Thu Jan 16 20:26:29 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/sane.c (sanei_constrain_value): Fix so it properly
 	handles strings that are longer than any of the strings in a
 	string list.

	* frontend/scan.c (main): Subtract value of top-left-x/top-left-y
	from width/height, respectively after all options have been
	read in.
	(main): Print help message _after_ options have been processed.
	(fetch_options): New function.
	(set_option): Call fetch_options() if SANE_INFO_RELOAD_OPTIONS is
	set.
	(main): Call fetch_options() instead of open-coding same.

	* doc/sane.tex (subsection{Device Descriptor Type}): Add index
	entry for device-name.

Wed Jan 15 19:55:03 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/metadl.c (sane_init): Call DBG_INIT() and declare
	debug level variable with DBG_DECL.  Added various debug
	statements.

	* backend/pnm.c (sane_init): Ditto.
	* backend/mustek.c (sane_init): Ditto.

	* frontend/scan.c (parse_scalar): Default to mm again (instead of
 	cm).  Using `mm' as the default is counter-intuitive since the
 	help info is printed with `mm' as the unit.

	* frontend/xscan.c (main): Pass local_only==SANE_FALSE as second
	argument to sane_get_devices().

Sun Jan 12 13:12:45 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/sane.c (sanei_constrain_value): For string-lists, ignore
 	case and allow prefixes as long as they remain unique.

	* frontend/scan.c (print_option): Print "auto" as a legal option
 	value if the option has capability SANE_CAP_AUTOMATIC set.
	(process_backend_option): If option has SANE_CAP_AUTOMATIC set,
 	let option value of "auto" turn on automatic mode.

Wed Jan  8 19:55:31 1997  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/Makefile.in (install): Modify install rule so that
	$(libdir) gets added to /etc/ld.so.conf if it isn't there
	already.
	(COMPILE): Use $(SHCFLAGS) instead of $(CFLAGS).
	(LINK): Remove (unused).

Wed Dec 25 20:21:39 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/mustek.README: Add section "SCSI Adapter Tips".

Fri Dec 13 20:02:03 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/mustek.c (line_distance): Rename
 	LINE_DISTANCE_WORKAROUND to NEED_MUSTEK_LINE_DISTANCE_WORKAROUND.
	Include <config.h>.

Thu Dec 12 20:19:26 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/mustek.h (next): New member.  Forms linked list of open
 	handles.  * backend/mustek.c (first_handle): New variable.  Root
 	of list of open handles.
	(sane_open): Insert handle into list of open handles.
	(sane_close): Remove handle from list of open handles.

Wed Dec  4 18:37:45 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/mustek.c (attach): Added back MFS-12000SP, MFS-08000SP,
 	and MFS-06000SP.  At least the first one really does exist.  I
 	don't know how the differ from the other scanners, but it looks as
 	if line-distance correction might be different.

Tue Dec  3 21:22:54 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/sane.c (sane_strstatus): Remove trailing dot from error
 	message.

Mon Dec  2 19:12:53 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* backend/mustek.c (max_string_size): New function to determine
 	maximum size of a string constraint list.
	(init_options): Use max_string_size () to initialize size of
 	string-valued options.

Sun Dec  1 15:44:53 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* Version 0.1 released.
	
	* backend/mustek.c (attach): Fix mispelled/bad model names:
		MFS-12000SP -> MSF-12000SP
		MFS-08000SP -> MSF-08000SP
		MFS-06000SP -> MSF-06000SP
		MFS-08000CZ -> <removed>
		MFS-06000CZ -> <removed>
	
Tue Nov 26 19:11:18 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* frontend/scan.c (print_option): Separate option name from option
 	values by blank, not equal so the syntax is correct even for short
 	options.
	(parse_scalar): Added missing newline to error message.

Sat Nov 16 17:26:19 1996  David Mosberger-Tang  <davidm@azstarnet.com>

	* frontend/scan.c (main): Created (by Andy).

	* backend/pnm.c: Adapted from Andy's pnm.c (just minor updates).

	* backend/mustek.c: Created.
	* backend/metadl.c: Ditto.
