Re: [Owfs-developers] New owcapi interface. Happy? - ADDENDUM

2005-10-18 Thread Paul Alfille
On Tuesday 18 October 2005 10:37 am, Geo Carncross wrote: > I should clarify, that providing a common API to the language bindings > isn't bad, but requiring that they use them is- that is, having other > parts of OW use the same mutexes and locks and whathaveyou that the OW > language bindings do.

Re: [Owfs-developers] New owcapi interface. Happy? - ADDENDUM

2005-10-18 Thread Geo Carncross
On Tue, 2005-10-18 at 10:28 -0400, Geo Carncross wrote: > All of which makes exposing the synchronization primitives used by OW > pretty much worthless. I should clarify, that providing a common API to the language bindings isn't bad, but requiring that they use them is- that is, having other part

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-18 Thread Geo Carncross
On Mon, 2005-10-17 at 20:09 -0400, Paul Alfille wrote: > This gets to a larger question: what should be internal to owlib, and what > should be in ow.h that is used by other programs. In the past, the only > direct clients of owlib were the included programs owfs., owhttpd, > owserver, ... They

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-17 Thread Paul Alfille
Ok, used your code, and created some paired functions in OWLIB: // ow_api.c int OWLIB_can_init_start( void ) ; void OWLIB_can_init_end( void ) ; int OWLIB_can_access_start( void ) ; void OWLIB_can_access_end( void ) ; int OWLIB_can_finish_start( void ) ; void OWLIB_can_finish_end( void ) ;

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-17 Thread Paul Alfille
Beautiful. I was playing with the code, and didn't make the jump that you only need to SIGNAL the second transition. You're right about private data. In fact, I intend to put the mutex/lock/condition code in owlib and so simplify the owcapi code. Again, to make it easier to see the code and us

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-17 Thread Geo Carncross
A mutual exclusion device is necessary. OW_get, OW_put, and OW_finish all lock the common mutex. If OW_get and OW_put /really can/ be used simultaneously, then a condition is required: in OW_get and OW_put: LOCK(mutex); level++; UNLOCK(mutex); { real code } LOCK(mutex); level--; SIGNAL(cond);

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-16 Thread Paul Alfille
Added the same protection for the SWIG prototype (owperl, owpython, owphp). It occurs to me that it is possible that a "OW_finish" could be called while an OW_get or OW_put is in progress -- could be messy since the adapters would be disappearing while being used. I'll have to get out the old te

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-15 Thread Paul Alfille
ilto:[EMAIL PROTECTED] Behalf Of Geo > > Carncross > > Sent: Thursday, October 13, 2005 12:06 PM > > To: owfs-developers@lists.sourceforge.net > > Subject: RE: [Owfs-developers] New owcapi interface. Happy? > > > > On Thu, 2005-10-13 at 11:21 -0400, Alfille, Paul H.,

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Paul Alfille
On Thursday 13 October 2005 03:39 pm, Geo Carncross wrote: > > I did an update and cannot find the owcapi-in-progress. Is it on another > tag besides HEAD? > owfs/modules/owcapi ./configure --enable-owcapi (At least until development is done, then should be default enabled since it will compile i

RE: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Geo Carncross
same time- is OW_get() reentrant, etc. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Geo > Carncross > Sent: Thursday, October 13, 2005 12:06 PM > To: owfs-developers@lists.sourceforge.net > Subject: RE: [Owfs-developers] New owc

RE: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Alfille, Paul H.,M.D.
a mutexes protecting the physical devices, as well as important data structures. Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Geo Carncross Sent: Thursday, October 13, 2005 12:06 PM To: owfs-developers@lists.sourceforge.net Subject: RE: [Owfs-de

RE: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Geo Carncross
On Thu, 2005-10-13 at 11:21 -0400, Alfille, Paul H.,M.D. wrote: > Very nice work. > > Actually, OW_get is always null-terminated (we add an extra byte to the > allocation and zero it), but not all values are strings (like memory from > devices like the DS1993 are arbitrary data). In these cases,

RE: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Alfille, Paul H.,M.D.
Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Geo Carncross Sent: Thursday, October 13, 2005 10:26 AM To: owfs-developers@lists.sourceforge.net Subject: RE: [Owfs-developers] New owcapi interface. Happy? On Thu, 2005-10-13 at 06:45 -0400, Alfille, Paul H.,M.D

RE: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Geo Carncross
Is there danger in me doing this? OW_init(0); switch (fork()) { case 0: OW_get(...); default: OW_get(...); }; What happens? What kind of surprise do I get? What if I use owserver? I find it's usually easier to say things like: * API xyz should only be

RE: [Owfs-developers] New owcapi interface. Happy?

2005-10-13 Thread Alfille, Paul H.,M.D.
some example code for people. Modify away. Paul -Original Message- From: [EMAIL PROTECTED] on behalf of Christian Magnusson Sent: Wed 10/12/2005 11:34 PM To: owfs-developers Subject: Re: [Owfs-developers] New owcapi interface. Happy? That subject almost sounded ironic to me... :) Ar

Re: [Owfs-developers] New owcapi interface. Happy?

2005-10-12 Thread Christian Magnusson
That subject almost sounded ironic to me... :) Are you tired of new changes? Anyway, nice that this capi finally is developed. I will be back with some additions to this later. I have written some c-applications using a mounted fuse filesystem, and I have always been missing lots of functions and

[Owfs-developers] New owcapi interface. Happy?

2005-10-12 Thread Paul Alfille
/* $Id: owcapi.h,v 1.3 2005/10/11 21:37:21 alfille Exp $ OWFS (owfs, owhttpd, owserver, owperl, owtcl, owphp, owpython, owcapi) one-wire file system and related programs By Paul H Alfille {c} 2003-5 GPL [EMAIL PROTECTED] */ /* OWCAPI - specific header */ /* OWCAPI is the simple