Re: Conduit writing...



On Wed, 4 Nov 1998 jrb@redhat.com wrote:

> I would like to write a conduit for the address book.  I have been
> reading through the memo conduit.  It's pretty complex.  Do you

Most of the complexity is the handling of files. Unfortunately, the only
documentation currently is the Documentation/conduit-SyncAbs-impl.sgml
file.

If you find the function set_abs in the bottom of memo_conduit_abs.s, you
can see, that I set all the conduit needed methods. This is where you
start, by implementing these. Basically, you need all except those related
to archival (since its still missing from pilot-link).

In addition, you'll want to look into pilot-link/addresses.c, lines 72-88.
Regarding getting the AppInfo block for the addressbook, plus decoding a
pilotrecord into a structure. Eg. the conduit call StoreRemote, which you
must implement in the conduit, recevies a PilotRecord, which just contains
the data as a char*. This char* you decode and store locally. 

Vice versa, when the conduit starts, you read new (or all) local records,
convert them to the Address structure defined in pilot-link/pi-address.h.
Then eg. when MatchRecord is called, when the conduit manager whishes to
compare a local record with a remote, you decode the remote and compare
them by using one of the fields in the Address structure, eg. first and
lastname, and return a pointer to a local record (see conduit-SyncAbs.sgml
for info on how to make this structure).

The encoding/decoding to from char* is done via some calls also defined in
pilot-link/pi-address.h. Basically pilot-link has these for all the
default application.

Some other important conduit calls :
Transmit, encodes the local record into a PilotRecord (the char*).
Iterate, called initially with NULL, and used to iterate over the records.
IterateSpecific, as Iterate, but the manager uses this eg. to 
                 iterate only the new records.

I hope this hepls a bit and isn't too confusingly written.

/dev/eskil
---




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]