kopia lustrzana https://gitlab.com/sane-project/website
324 wiersze
8.9 KiB
HTML
324 wiersze
8.9 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: Re: forwarded message from Karl Heinz Kremer</TITLE>
|
|
<META NAME="Author" CONTENT="Petter Reinholdtsen (pere@hungry.com)">
|
|
<META NAME="Subject" CONTENT="Re: forwarded message from Karl Heinz Kremer">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: forwarded message from Karl Heinz Kremer</H1>
|
|
<!-- received="Mon Jan 17 16:47:53 2000" -->
|
|
<!-- isoreceived="20000118004753" -->
|
|
<!-- sent="Tue, 18 Jan 2000 08:51:14 +0800" -->
|
|
<!-- isosent="20000118005114" -->
|
|
<!-- name="Petter Reinholdtsen" -->
|
|
<!-- email="pere@hungry.com" -->
|
|
<!-- subject="Re: forwarded message from Karl Heinz Kremer" -->
|
|
<!-- id="200001180051.IAA29038@minerva.cc.uit.no" -->
|
|
<!-- inreplyto="forwarded message from Karl Heinz Kremer" -->
|
|
<STRONG>From:</STRONG> Petter Reinholdtsen (<A HREF="mailto:pere@hungry.com?Subject=Re:%20forwarded%20message%20from%20Karl%20Heinz%20Kremer&In-Reply-To=<200001180051.IAA29038@minerva.cc.uit.no>"><EM>pere@hungry.com</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Mon Jan 17 2000 - 16:51:14 PST
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0131.html">Petter Reinholdtsen: "Libtool ltdl patch"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0129.html">Petter Reinholdtsen: "Re: A bug in the backend? (microtek2)"</A>
|
|
<LI><STRONG>Maybe in reply to:</STRONG> <A HREF="0026.html">David Mosberger-Tang: "forwarded message from Karl Heinz Kremer"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0238.html">abel deuring: "Re: forwarded message from Karl Heinz Kremer"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0238.html">abel deuring: "Re: forwarded message from Karl Heinz Kremer"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#130">[ date ]</A>
|
|
<A HREF="index.html#130">[ thread ]</A>
|
|
<A HREF="subject.html#130">[ subject ]</A>
|
|
<A HREF="author.html#130">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
[David Mosberger-Tang]
|
|
<BR>
|
|
<EM>> Could someone consider this for inclusion in the CVS tree?
|
|
</EM><BR>
|
|
<P>I had a look at it, reformatted it to be consistent with current style
|
|
<BR>
|
|
and rewrote the for loop to make sure non-batch mode still works.
|
|
<BR>
|
|
Could someone please verify that the new patch work? I don't have a
|
|
<BR>
|
|
scanner to test with. :-(
|
|
<BR>
|
|
<P>I guess the batch mode should have a way to limit the number of scans.
|
|
<BR>
|
|
If it is used on the video4linux backend, the flow of images will
|
|
<BR>
|
|
never stop... :-)
|
|
<BR>
|
|
<P>Index: frontend/scanimage.c
|
|
<BR>
|
|
===================================================================
|
|
<BR>
|
|
RCS file: /cvsroot/external/sane/frontend/scanimage.c,v
|
|
<BR>
|
|
retrieving revision 1.1.1.1
|
|
<BR>
|
|
diff -u -r1.1.1.1 scanimage.c
|
|
<BR>
|
|
--- scanimage.c 1999/08/09 18:05:40 1.1.1.1
|
|
<BR>
|
|
+++ scanimage.c 2000/01/18 00:48:07
|
|
<BR>
|
|
@@ -61,7 +61,8 @@
|
|
<BR>
|
|
{"verbose", no_argument, NULL, 'v'},
|
|
<BR>
|
|
{"test", no_argument, NULL, 'T'},
|
|
<BR>
|
|
{"version", no_argument, NULL, 'V'},
|
|
<BR>
|
|
- {0, }
|
|
<BR>
|
|
+ {"batch", optional_argument, NULL, 'b'},
|
|
<BR>
|
|
+ {0, 0, NULL, 0}
|
|
<BR>
|
|
};
|
|
<BR>
|
|
|
|
<BR>
|
|
#define BASE_OPTSTRING "d:hLvVT"
|
|
<BR>
|
|
@@ -749,7 +750,7 @@
|
|
<BR>
|
|
return image->data;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
-static void
|
|
<BR>
|
|
+static SANE_Status
|
|
<BR>
|
|
scan_it (void)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
int i, len, first_frame = 1, offset = 0, must_buffer = 0;
|
|
<BR>
|
|
@@ -870,7 +871,7 @@
|
|
<BR>
|
|
{
|
|
<BR>
|
|
fprintf (stderr, "%s: sane_read: %s\n",
|
|
<BR>
|
|
prog_name, sane_strstatus (status));
|
|
<BR>
|
|
- return;
|
|
<BR>
|
|
+ return status;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
break;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
@@ -938,6 +939,8 @@
|
|
<BR>
|
|
sane_cancel (device);
|
|
<BR>
|
|
if (image.data)
|
|
<BR>
|
|
free (image.data);
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ return status;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
#define clean_buffer(buf,size) memset ((buf), 0x23, size)
|
|
<BR>
|
|
@@ -1049,6 +1052,8 @@
|
|
<BR>
|
|
const SANE_Device ** device_list;
|
|
<BR>
|
|
SANE_Int num_dev_options = 0;
|
|
<BR>
|
|
const char * devname = 0;
|
|
<BR>
|
|
+ const char * format = 0;
|
|
<BR>
|
|
+ int batch = 0;
|
|
<BR>
|
|
SANE_Status status;
|
|
<BR>
|
|
char *full_optstring;
|
|
<BR>
|
|
|
|
<BR>
|
|
@@ -1076,6 +1081,7 @@
|
|
<BR>
|
|
break; /* may be an option that we'll parse later on */
|
|
<BR>
|
|
|
|
<BR>
|
|
case 'd': devname = optarg; break;
|
|
<BR>
|
|
+ case 'b': batch = 1; format = optarg; break;
|
|
<BR>
|
|
case 'h': help = 1; break;
|
|
<BR>
|
|
case 'v': ++verbose; break;
|
|
<BR>
|
|
case 'T': test= 1; break;
|
|
<BR>
|
|
@@ -1115,6 +1121,7 @@
|
|
<BR>
|
|
Start image acquisition on a scanner device and write PNM image data to\n\
|
|
<BR>
|
|
standard output.\n\
|
|
<BR>
|
|
\n\
|
|
<BR>
|
|
+-b, --batch=FORMAT working in batch mode\n\
|
|
<BR>
|
|
-d, --device-name=DEVICE use a given scanner device\n\
|
|
<BR>
|
|
-h, --help display this help message and exit\n\
|
|
<BR>
|
|
-L, --list-devices show available scanner devices\n\
|
|
<BR>
|
|
@@ -1337,11 +1344,43 @@
|
|
<BR>
|
|
signal (SIGTERM, sighandler);
|
|
<BR>
|
|
|
|
<BR>
|
|
if (test == 0)
|
|
<BR>
|
|
- scan_it ();
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ int n = 1;
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (batch && NULL == format)
|
|
<BR>
|
|
+ format = "out%d.pnm";
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ do
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ char path [ 1024];
|
|
<BR>
|
|
+ sprintf (path, format, n); /* love --(C++) */
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (batch && NULL == freopen (path, "w", stdout) )
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ fprintf (stderr, "cannot open %s\n", path);
|
|
<BR>
|
|
+ return SANE_STATUS_ACCESS_DENIED;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ status = scan_it ();
|
|
<BR>
|
|
+ if (batch)
|
|
<BR>
|
|
+ fprintf( stderr, "status = %d\n", status);
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ switch (status)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ case SANE_STATUS_EOF:
|
|
<BR>
|
|
+ status = SANE_STATUS_GOOD;
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ default:
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ } /* switch */
|
|
<BR>
|
|
+ n++;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ while (batch && SANE_STATUS_GOOD == status);
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
else
|
|
<BR>
|
|
test_it ();
|
|
<BR>
|
|
|
|
<BR>
|
|
sane_close (device);
|
|
<BR>
|
|
|
|
<BR>
|
|
- return 0;
|
|
<BR>
|
|
+ return status;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<PRE>
|
|
--
|
|
##> Petter Reinholdtsen <## | <A HREF="mailto:pere@td.org.uit.no?Subject=Re:%20forwarded%20message%20from%20Karl%20Heinz%20Kremer&In-Reply-To=<200001180051.IAA29038@minerva.cc.uit.no>">pere@td.org.uit.no</A>
|
|
<P>--
|
|
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:%20forwarded%20message%20from%20Karl%20Heinz%20Kremer&In-Reply-To=<200001180051.IAA29038@minerva.cc.uit.no>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0131.html">Petter Reinholdtsen: "Libtool ltdl patch"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0129.html">Petter Reinholdtsen: "Re: A bug in the backend? (microtek2)"</A>
|
|
<LI><STRONG>Maybe in reply to:</STRONG> <A HREF="0026.html">David Mosberger-Tang: "forwarded message from Karl Heinz Kremer"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0238.html">abel deuring: "Re: forwarded message from Karl Heinz Kremer"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0238.html">abel deuring: "Re: forwarded message from Karl Heinz Kremer"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#130">[ date ]</A>
|
|
<A HREF="index.html#130">[ thread ]</A>
|
|
<A HREF="subject.html#130">[ subject ]</A>
|
|
<A HREF="author.html#130">[ 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 Jan 17 2000 - 16:55:15 PST</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|