kopia lustrzana https://gitlab.com/sane-project/website
152 wiersze
5.1 KiB
HTML
152 wiersze
5.1 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: Polaroid SprintScan 35 LE</TITLE>
|
|
<META NAME="Author" CONTENT="Henning Meier-Geinitz (henning@meier-geinitz.de)">
|
|
<META NAME="Subject" CONTENT="Re: Polaroid SprintScan 35 LE">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: Polaroid SprintScan 35 LE</H1>
|
|
<!-- received="Mon May 21 12:43:26 2001" -->
|
|
<!-- isoreceived="20010521194326" -->
|
|
<!-- sent="Mon, 21 May 2001 21:43:53 +0200" -->
|
|
<!-- isosent="20010521194353" -->
|
|
<!-- name="Henning Meier-Geinitz" -->
|
|
<!-- email="henning@meier-geinitz.de" -->
|
|
<!-- subject="Re: Polaroid SprintScan 35 LE" -->
|
|
<!-- id="20010521214353.A26495@vortex.swb.de" -->
|
|
<!-- inreplyto="E151uJq-0007tc-00@yoo-hoo.ai.mit.edu" -->
|
|
<STRONG>From:</STRONG> Henning Meier-Geinitz (<A HREF="mailto:henning@meier-geinitz.de?Subject=Re:%20Polaroid%20SprintScan%2035%20LE&In-Reply-To=<20010521214353.A26495@vortex.swb.de>"><EM>henning@meier-geinitz.de</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Mon May 21 2001 - 12:43:53 PDT
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0277.html">Jonathan Buzzard: "Re: Linux-compliant USB scanner"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0275.html">Henning Meier-Geinitz: "Re: PNM device configuration"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0272.html">Matto Marjanovic: "Re: Polaroid SprintScan 35 LE"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#276">[ date ]</A>
|
|
<A HREF="index.html#276">[ thread ]</A>
|
|
<A HREF="subject.html#276">[ subject ]</A>
|
|
<A HREF="author.html#276">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hi,
|
|
<BR>
|
|
<P>On Mon, May 21, 2001 at 02:22:14PM -0400, Matto Marjanovic wrote:
|
|
<BR>
|
|
<EM>> * Use DBG(...) instead of fprintf(stderr, ...) or printf
|
|
</EM><BR>
|
|
<EM>> - microtek
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> --> this is not so simple.
|
|
</EM><BR>
|
|
<EM>> There are a lot of places where I used 'fprintf(stderr, ...)'
|
|
</EM><BR>
|
|
<EM>> in order to produce readable output; usually, such code is
|
|
</EM><BR>
|
|
<EM>> conditioned off of DBG_LEVEL like so (per an early discussion
|
|
</EM><BR>
|
|
<EM>> with David Mosberger-Tang on the right way to do this):
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> if (DBG_LEVEL >= 192) {
|
|
</EM><BR>
|
|
<EM>> int i;
|
|
</EM><BR>
|
|
<EM>> fprintf(stderr, "MSL: ");
|
|
</EM><BR>
|
|
<EM>> for (i=0;i<6+comm[4];i++) fprintf(stderr, "%2x ", comm[i]);
|
|
</EM><BR>
|
|
<EM>> fprintf(stderr, "\n");
|
|
</EM><BR>
|
|
<EM>> }
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> There is no way to produce readable output using DBG(...) in a
|
|
</EM><BR>
|
|
<EM>> situation like this, because of all the stuff that DBG() prepends
|
|
</EM><BR>
|
|
<EM>> and appends to its arguments.
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> Any suggestions?
|
|
</EM><BR>
|
|
<EM>> Perhaps an additional, raw form of DBG(...) ?
|
|
</EM><BR>
|
|
<P>I'm using strings together with sprintf and strcat and after creation
|
|
<BR>
|
|
of the output string I print it with DBG(level, "%s", string). It's
|
|
<BR>
|
|
one or two more lines of code but I think it's worth it because we
|
|
<BR>
|
|
don't get problems with saned this way. So in your example:
|
|
<BR>
|
|
<P>int i;
|
|
<BR>
|
|
char *dbg_buffer[enough_mem];
|
|
<BR>
|
|
char *tmp_buffer[not_so_much_mem];
|
|
<BR>
|
|
sprintf(tmp_buffer, "MSL: ");
|
|
<BR>
|
|
strcat(dbg_buffer, tmp_buffer);
|
|
<BR>
|
|
for (i=0;i<6+comm[4];i++)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
sprintf(tmp_buffer, "%2x ", comm[i]);
|
|
<BR>
|
|
strcat(dbg_buffer, tmp_buffer);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P>(untested and ugly but you may get the idea).
|
|
<BR>
|
|
<P>Bye,
|
|
<BR>
|
|
Henning
|
|
<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?Subject=Re:%20Polaroid%20SprintScan%2035%20LE&In-Reply-To=<20010521214353.A26495@vortex.swb.de>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0277.html">Jonathan Buzzard: "Re: Linux-compliant USB scanner"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0275.html">Henning Meier-Geinitz: "Re: PNM device configuration"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0272.html">Matto Marjanovic: "Re: Polaroid SprintScan 35 LE"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#276">[ date ]</A>
|
|
<A HREF="index.html#276">[ thread ]</A>
|
|
<A HREF="subject.html#276">[ subject ]</A>
|
|
<A HREF="author.html#276">[ 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 May 21 2001 - 12:44:33 PDT</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|