sane-project-website/old-archive/1999-06/0151.html

110 wiersze
3.7 KiB
HTML

<!-- received="Wed Jun 23 08:02:28 1999 PDT" -->
<!-- sent="Wed, 23 Jun 1999 17:03:08 +0200 (MET DST)" -->
<!-- name="Ingo Wilken" -->
<!-- email="Ingo.Wilken@Informatik.Uni-Oldenburg.DE" -->
<!-- subject="scanimage: support $SANE_DEFAULT_DEVICE (patch)" -->
<!-- id="m10woYP-000A5gC@petersfehn.Informatik.Uni-Oldenburg.DE" -->
<!-- inreplyto="" -->
<title>sane-devel: scanimage: support $SANE_DEFAULT_DEVICE (patch)</title>
<h1>scanimage: support $SANE_DEFAULT_DEVICE (patch)</h1>
<b>Ingo Wilken</b> (<a href="mailto:Ingo.Wilken@Informatik.Uni-Oldenburg.DE"><i>Ingo.Wilken@Informatik.Uni-Oldenburg.DE</i></a>)<br>
<i>Wed, 23 Jun 1999 17:03:08 +0200 (MET DST)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#151">[ date ]</a><a href="index.html#151">[ thread ]</a><a href="subject.html#151">[ subject ]</a><a href="author.html#151">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0152.html">Oliver Rauch: "Re: Umax 1200S on LinuxPPC R5"</a>
<li> <b>Previous message:</b> <a href="0150.html">Simon Piette: "Re: Umax 1200S on LinuxPPC R5"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
This patch adds support for an environment-variable SANE_DEFAULT_DEVICE<br>
to scanimage (SANE 1.0.1). Quite useful if you have several SANE devices<br>
available and the first on the list is not your preferred device.<br>
<p>
Regards,<br>
Ingo<br>
<p>
<p>
*** doc/scanimage.man.orig Wed Jun 23 16:13:42 1999<br>
--- doc/scanimage.man Wed Jun 23 16:28:31 1999<br>
***************<br>
*** 38,43 ****<br>
--- 38,46 ----<br>
.B --list-devices<br>
option (see below). If no device-name is specified explicitly,<br>
.B scanimage<br>
+ takes it from the environment-variable SANE_DEFAULT_DEVICE.<br>
+ If this does not exist,<br>
+ .B scanimage<br>
will attempt to open the first available device.<br>
.PP<br>
The<br>
***************<br>
*** 227,232 ****<br>
--- 230,240 ----<br>
filename <br>
.BR /tmp/input.ppm .<br>
.RE<br>
+ <br>
+ .SH ENVIRONMENT<br>
+ .TP<br>
+ .I SANE_DEFAULT_DEVICE<br>
+ The default device name.<br>
<br>
.SH FILES<br>
.TP<br>
*** frontend/scanimage.c.orig Wed Jun 23 16:00:25 1999<br>
--- frontend/scanimage.c Wed Jun 23 16:29:33 1999<br>
***************<br>
*** 1125,1133 ****<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 (&amp;device_list, SANE_FALSE);<br>
if (status != SANE_STATUS_GOOD)<br>
{<br>
--- 1125,1136 ----<br>
<br>
if (!devname)<br>
{<br>
! /* If no device name was specified explicitly, we use<br>
! $SANE_DEFAULT_DEVICE. If it does not exist, we open<br>
! the first device we find (if any): */<br>
! devname = getenv("SANE_DEFAULT_DEVICE");<br>
! if (!devname )<br>
! {<br>
status = sane_get_devices (&amp;device_list, SANE_FALSE);<br>
if (status != SANE_STATUS_GOOD)<br>
{<br>
***************<br>
*** 1141,1146 ****<br>
--- 1144,1150 ----<br>
exit (1);<br>
}<br>
devname = device_list[0]-&gt;name;<br>
+ }<br>
}<br>
<br>
status = sane_open (devname, &amp;device);<br>
<p>
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0152.html">Oliver Rauch: "Re: Umax 1200S on LinuxPPC R5"</a>
<li> <b>Previous message:</b> <a href="0150.html">Simon Piette: "Re: Umax 1200S on LinuxPPC R5"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>