kopia lustrzana https://gitlab.com/sane-project/website
279 wiersze
7.8 KiB
HTML
279 wiersze
7.8 KiB
HTML
![]() |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<TITLE>sane-devel: SANE_DEFAULT_DEVICE for scanimage (patch)</TITLE>
|
||
|
<META NAME="Author" CONTENT="Ingo Wilken (Ingo.Wilken@Informatik.Uni-Oldenburg.DE)">
|
||
|
<META NAME="Subject" CONTENT="SANE_DEFAULT_DEVICE for scanimage (patch)">
|
||
|
</HEAD>
|
||
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
||
|
<H1>SANE_DEFAULT_DEVICE for scanimage (patch)</H1>
|
||
|
<!-- received="Mon Mar 27 14:12:05 2000" -->
|
||
|
<!-- isoreceived="20000327221205" -->
|
||
|
<!-- sent="Tue, 28 Mar 2000 00:26:57 +0200 (MET DST)" -->
|
||
|
<!-- isosent="20000327222657" -->
|
||
|
<!-- name="Ingo Wilken" -->
|
||
|
<!-- email="Ingo.Wilken@Informatik.Uni-Oldenburg.DE" -->
|
||
|
<!-- subject="SANE_DEFAULT_DEVICE for scanimage (patch)" -->
|
||
|
<!-- id="E12ZhyL-0001ED-00@petersfehn.Informatik.Uni-Oldenburg.DE" -->
|
||
|
<STRONG>From:</STRONG> Ingo Wilken (<A HREF="mailto:Ingo.Wilken@Informatik.Uni-Oldenburg.DE?Subject=Re:%20SANE_DEFAULT_DEVICE%20for%20scanimage%20(patch)&In-Reply-To=<E12ZhyL-0001ED-00@petersfehn.Informatik.Uni-Oldenburg.DE>"><EM>Ingo.Wilken@Informatik.Uni-Oldenburg.DE</EM></A>)<BR>
|
||
|
<STRONG>Date:</STRONG> Mon Mar 27 2000 - 14:26:57 PST
|
||
|
<P>
|
||
|
<!-- next="start" -->
|
||
|
<LI><STRONG>Next message:</STRONG> <A HREF="0287.html">pixel fairy: "noisy umax astra 2200"</A>
|
||
|
<UL>
|
||
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0285.html">Oliver Rauch: "Re: sane 1.0.2 - strangeness"</A>
|
||
|
<!-- nextthread="start" -->
|
||
|
<!-- reply="end" -->
|
||
|
<LI><STRONG>Messages sorted by:</STRONG>
|
||
|
<A HREF="date.html#286">[ date ]</A>
|
||
|
<A HREF="index.html#286">[ thread ]</A>
|
||
|
<A HREF="subject.html#286">[ subject ]</A>
|
||
|
<A HREF="author.html#286">[ author ]</A>
|
||
|
</UL>
|
||
|
<HR NOSHADE><P>
|
||
|
<!-- body="start" -->
|
||
|
<P>
|
||
|
This patch adds support for an environment variable SANE_DEFAULT_DEVICE
|
||
|
<BR>
|
||
|
to scanimage. Useful if the first device on the list is not your
|
||
|
<BR>
|
||
|
preferred device, and you don't want to use the --device option in
|
||
|
<BR>
|
||
|
every command.
|
||
|
<BR>
|
||
|
<P>I think I sent a similar patch for SANE-1.0.1 to this list some time
|
||
|
<BR>
|
||
|
ago. Anyway, it's not in 1.0.2, so I reimplemented it (with a minor
|
||
|
<BR>
|
||
|
improvement: if the variable is set, show its contents with -L).
|
||
|
<BR>
|
||
|
<P>Regards,
|
||
|
<BR>
|
||
|
Ingo
|
||
|
<BR>
|
||
|
<P><P>*** doc/scanimage.man.orig Thu Mar 16 05:25:19 2000
|
||
|
<BR>
|
||
|
--- doc/scanimage.man Thu Mar 16 05:38:45 2000
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 38,43 ****
|
||
|
<BR>
|
||
|
--- 38,47 ----
|
||
|
<BR>
|
||
|
.B --list-devices
|
||
|
<BR>
|
||
|
option (see below). If no device-name is specified explicitly,
|
||
|
<BR>
|
||
|
.B scanimage
|
||
|
<BR>
|
||
|
+ reads a device-name from the environment variable
|
||
|
<BR>
|
||
|
+ .BR SANE_DEFAULT_DEVICE .
|
||
|
<BR>
|
||
|
+ If this variable is not set,
|
||
|
<BR>
|
||
|
+ .B scanimage
|
||
|
<BR>
|
||
|
will attempt to open the first available device.
|
||
|
<BR>
|
||
|
.PP
|
||
|
<BR>
|
||
|
The
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 228,233 ****
|
||
|
<BR>
|
||
|
--- 232,241 ----
|
||
|
<BR>
|
||
|
.BR /tmp/input.ppm .
|
||
|
<BR>
|
||
|
.RE
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
+ .SH ENVIRONMENT
|
||
|
<BR>
|
||
|
+ .TP
|
||
|
<BR>
|
||
|
+ .B SANE_DEFAULT_DEVICE
|
||
|
<BR>
|
||
|
+ The default device-name.
|
||
|
<BR>
|
||
|
.SH FILES
|
||
|
<BR>
|
||
|
.TP
|
||
|
<BR>
|
||
|
.I @CONFIGDIR@
|
||
|
<BR>
|
||
|
*** frontend/scanimage.c.orig Wed Mar 15 17:30:38 2000
|
||
|
<BR>
|
||
|
--- frontend/scanimage.c Wed Mar 15 18:05:17 2000
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 1062,1067 ****
|
||
|
<BR>
|
||
|
--- 1062,1068 ----
|
||
|
<BR>
|
||
|
const SANE_Device ** device_list;
|
||
|
<BR>
|
||
|
SANE_Int num_dev_options = 0;
|
||
|
<BR>
|
||
|
const char * devname = 0;
|
||
|
<BR>
|
||
|
+ const char * defdevname = 0;
|
||
|
<BR>
|
||
|
const char * format = 0;
|
||
|
<BR>
|
||
|
int batch = 0;
|
||
|
<BR>
|
||
|
SANE_Status status;
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 1075,1080 ****
|
||
|
<BR>
|
||
|
--- 1076,1083 ----
|
||
|
<BR>
|
||
|
else
|
||
|
<BR>
|
||
|
prog_name = argv[0];
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
+ defdevname = getenv("SANE_DEFAULT_DEVICE");
|
||
|
<BR>
|
||
|
+
|
||
|
<BR>
|
||
|
sane_init (0, 0);
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
/* make a first pass through the options with error printing and argument
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 1113,1118 ****
|
||
|
<BR>
|
||
|
--- 1116,1124 ----
|
||
|
<BR>
|
||
|
device_list[i]->name, device_list[i]->vendor,
|
||
|
<BR>
|
||
|
device_list[i]->model, device_list[i]->type);
|
||
|
<BR>
|
||
|
}
|
||
|
<BR>
|
||
|
+ if (defdevname)
|
||
|
<BR>
|
||
|
+ printf ("default device is `%s'\n", defdevname);
|
||
|
<BR>
|
||
|
+
|
||
|
<BR>
|
||
|
exit (0);
|
||
|
<BR>
|
||
|
}
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 1142,1150 ****
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
if (!devname)
|
||
|
<BR>
|
||
|
{
|
||
|
<BR>
|
||
|
! /* If no device name was specified explicitly, we open the first
|
||
|
<BR>
|
||
|
! device we find (if any): */
|
||
|
<BR>
|
||
|
!
|
||
|
<BR>
|
||
|
status = sane_get_devices (&device_list, SANE_FALSE);
|
||
|
<BR>
|
||
|
if (status != SANE_STATUS_GOOD)
|
||
|
<BR>
|
||
|
{
|
||
|
<BR>
|
||
|
--- 1148,1159 ----
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
if (!devname)
|
||
|
<BR>
|
||
|
{
|
||
|
<BR>
|
||
|
! /* If no device name was specified explicitly, we look at the
|
||
|
<BR>
|
||
|
! environment variable SANE_DEFAULT_DEVICE. If this variable
|
||
|
<BR>
|
||
|
! is not set, we open the first device we find (if any): */
|
||
|
<BR>
|
||
|
! devname = defdevname;
|
||
|
<BR>
|
||
|
! if (!devname )
|
||
|
<BR>
|
||
|
! {
|
||
|
<BR>
|
||
|
status = sane_get_devices (&device_list, SANE_FALSE);
|
||
|
<BR>
|
||
|
if (status != SANE_STATUS_GOOD)
|
||
|
<BR>
|
||
|
{
|
||
|
<BR>
|
||
|
***************
|
||
|
<BR>
|
||
|
*** 1158,1163 ****
|
||
|
<BR>
|
||
|
--- 1167,1173 ----
|
||
|
<BR>
|
||
|
exit (1);
|
||
|
<BR>
|
||
|
}
|
||
|
<BR>
|
||
|
devname = device_list[0]->name;
|
||
|
<BR>
|
||
|
+ }
|
||
|
<BR>
|
||
|
}
|
||
|
<BR>
|
||
|
|
||
|
<BR>
|
||
|
status = sane_open (devname, &device);
|
||
|
<BR>
|
||
|
<P><PRE>
|
||
|
--
|
||
|
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
|
||
|
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20SANE_DEFAULT_DEVICE%20for%20scanimage%20(patch)&In-Reply-To=<E12ZhyL-0001ED-00@petersfehn.Informatik.Uni-Oldenburg.DE>">majordomo@mostang.com</A>
|
||
|
</PRE>
|
||
|
<P><!-- body="end" -->
|
||
|
<HR NOSHADE>
|
||
|
<UL>
|
||
|
<!-- next="start" -->
|
||
|
<LI><STRONG>Next message:</STRONG> <A HREF="0287.html">pixel fairy: "noisy umax astra 2200"</A>
|
||
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0285.html">Oliver Rauch: "Re: sane 1.0.2 - strangeness"</A>
|
||
|
<!-- nextthread="start" -->
|
||
|
<!-- reply="end" -->
|
||
|
<LI><STRONG>Messages sorted by:</STRONG>
|
||
|
<A HREF="date.html#286">[ date ]</A>
|
||
|
<A HREF="index.html#286">[ thread ]</A>
|
||
|
<A HREF="subject.html#286">[ subject ]</A>
|
||
|
<A HREF="author.html#286">[ author ]</A>
|
||
|
</UL>
|
||
|
<!-- trailer="footer" -->
|
||
|
<HR NOSHADE>
|
||
|
<P>
|
||
|
<SMALL>
|
||
|
<EM>
|
||
|
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
|
||
|
: <EM>Mon Mar 27 2000 - 14:12:52 PST</EM>
|
||
|
</EM>
|
||
|
</SMALL>
|
||
|
</BODY>
|
||
|
</HTML>
|