kopia lustrzana https://gitlab.com/sane-project/website
75 wiersze
3.9 KiB
HTML
75 wiersze
3.9 KiB
HTML
<!-- received="Thu Jul 23 06:30:17 1998 PDT" -->
|
|
<!-- sent="Thu, 23 Jul 1998 09:29:26 -0400 (EDT)" -->
|
|
<!-- name="Matto Marjanovic" -->
|
|
<!-- email="maddog@mir.com" -->
|
|
<!-- subject="Re: shmem in backends?" -->
|
|
<!-- id="m0yzLR0-000J3sC@yoo-hoo.ai.mit.edu" -->
|
|
<!-- inreplyto="shmem in backends?" -->
|
|
<title>sane-devel: Re: shmem in backends?</title>
|
|
<h1>Re: shmem in backends?</h1>
|
|
<b>Matto Marjanovic</b> (<a href="mailto:maddog@mir.com"><i>maddog@mir.com</i></a>)<br>
|
|
<i>Thu, 23 Jul 1998 09:29:26 -0400 (EDT)</i>
|
|
<p>
|
|
<ul>
|
|
<li> <b>Messages sorted by:</b> <a href="date.html#141">[ date ]</a><a href="index.html#141">[ thread ]</a><a href="subject.html#141">[ subject ]</a><a href="author.html#141">[ author ]</a>
|
|
<!-- next="start" -->
|
|
<li> <b>Next message:</b> <a href="0142.html">Chinedum Osuji: "Re: problems with sgi/umax"</a>
|
|
<li> <b>Previous message:</b> <a href="0140.html">Yuri Dario: "[PATCH] OS/2 parallel port and scsi matching support"</a>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
</ul>
|
|
<!-- body="start" -->
|
|
<i> >From: "Yuri Dario" <<a href="mailto:mc6530@mclink.it">mc6530@mclink.it</a>></i><br>
|
|
<i> >Date: Thu, 23 Jul 1998 09:35:27 +0100</i><br>
|
|
<p>
|
|
<i> >oops, I have some #ifdefs in the backend, but they can be removed easily. I will think on a sample API for </i><br>
|
|
<i> >SANE. Now I'm using a structure like </i><br>
|
|
<i> ></i><br>
|
|
<i> >static struct _Thread_Data { // for OS/2 thread data</i><br>
|
|
<i> > Mustek_Scanner* scanner; // scanner internal data</i><br>
|
|
<i> > int fds; // pipe write handle</i><br>
|
|
<i> >} Thread_Data;</i><br>
|
|
<i> ></i><br>
|
|
<i> >because beginthread() accept only one parameter. We need also a function for starting the thread, with at </i><br>
|
|
<i> >least two parameters (function address and pointer to data).</i><br>
|
|
<i> >I didn't implement thread stop&waiting, but that function are endthread() and killthread().</i><br>
|
|
<i> ></i><br>
|
|
<i> >I think that 3 function wrappers and one data structure should be sufficient. But every backend uses a </i><br>
|
|
<i> >different name for its data (Mustek_Scanner, Umax_Scanner,...), so we need to use a macro for the </i><br>
|
|
<i> >preprocessor.</i><br>
|
|
<p>
|
|
I suggest just using an opaque pointer ("void *") instead of any<br>
|
|
structure.... No need to tie a backend down to passing any<br>
|
|
particular set of data to its threads, when this threading is all<br>
|
|
quite backend-dependent anyway. (Much like SANE_Handle is cast<br>
|
|
about into all those Mustek_Scanner, Umax_Scanner, etc., ptrs.)<br>
|
|
<p>
|
|
<i> >I think that we need also an API for reading a line from the configuration file: actually sources strip \n at the </i><br>
|
|
<i> >end, but e.g. under OS/2 in text mode there is also a \r to remove; spaces at start and end of line should </i><br>
|
|
<i> >also be removed. So a single api (maybe called sanei_config_read) should be fine. I can write it and add </i><br>
|
|
<i> >to sanei_config.c; or someone else is working on that?</i><br>
|
|
<p>
|
|
I still like the idea of adopting a single config file for all the<br>
|
|
backends, with a SAMBA-config-like syntax to split it up into<br>
|
|
per-backend blocks, and set tokens = values. Then provide a <br>
|
|
mechanism to read this once and give access to the the database<br>
|
|
of values to each backend.<br>
|
|
But, no, I haven't put any work into this.<br>
|
|
<p>
|
|
-matt m.<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">majordomo@mostang.com</a>
|
|
</pre>
|
|
<!-- body="end" -->
|
|
<p>
|
|
<ul>
|
|
<!-- next="start" -->
|
|
<li> <b>Next message:</b> <a href="0142.html">Chinedum Osuji: "Re: problems with sgi/umax"</a>
|
|
<li> <b>Previous message:</b> <a href="0140.html">Yuri Dario: "[PATCH] OS/2 parallel port and scsi matching support"</a>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
</ul>
|