On Mon, 2008-04-28 at 01:56 -0400, der Mouse wrote:
>
> - watch_file takes a "condition" argument whose possible values are
> not documented.
A documentation omission:
/* File Watch flags */
/* Based upon those in dbus/dbus-connection.h */
typedef enum
{
PCB_WATCH_READABLE = 1 << 0, /**< As in POLLIN */
PCB_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */
PCB_WATCH_ERROR = 1 << 2, /**< As in POLLERR */
PCB_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP */
} PCBWatchFlags;
I should have perhaps used this type for the argument to the watch_file
member, rather than unsigned int. For comparison though, the struct
these flags are passed to "poll" via, uses "short".
The only current use of the watch_file API is for DBus support, the DBus
library passes us a file descriptor and asks us to call back when
something happens. Since PCB has no single main-loop we could code
directly for, this feature was added to the HIDs.
The add_block_hook (and in retrospect) its badly named parter,
stop_block_hook, are used to insert hooks into the main-loop which give
(in this case again) the DBus support code a chance to dispatch any
remaining data before the mainloop blocks.
There are probably other variations on how the DBus dispatching could
have been setup.
Best wishes,
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev