[Portland] Client library

Lubos Lunak l.lunak at suse.cz
Wed Mar 1 02:18:01 EET 2006


 Client library, i.e. the code apps will use.

- I'd like to have a simple possibility to have more than just plain C 
bindings for various reasons like the fact that plain C sucks when used in 
anything that's not plain C. E.g. I'd like to have C++/Qt code for doing this 
in Qt/KDE apps, which should be nice especially if this takes off and we end 
up with many calls (Kevin's addressbook functions have memory leaks and look 
ugly, and I don't blame him).

- I think the current C API with dapi_(read/write)(Command/Reply)Whatever is 
fine as lowlevel calls and I find them directly reading/writing the wire 
format to be fine as well, no need to complicate that. However C API for 
apps/daemons should need improvements, I originally meant just a simple 
processData( connection ) callbacks, but something like Norbert's callbacks 
should be much better for use in apps. I'm however not sure I like the 
implementation and I actually have some trouble reading it - things like the 
layering of two tiny libraries make it IMHO needlessly complex. Might be I'm 
just getting lost in it. If that spares me writing the C bindings I guess I 
actually don't care as long as it works. I could then just do C++/Qt ones.

 The library API should:
- Allow synchronous calls of functions from the API
- Allow asynchronous calls of functions from the API
- Have callbacks for handling messages accepted while waiting for reply in 
synchronous calls or when being idle

 I wonder about thread safety and whether it'd be actually needed. A simple 
solution might be a connection per thread, if something more powerful would 
be needed there probably should be rather outgoing/incomming buffer per 
thread and the library should merge and separate the data according to their 
thread.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/



More information about the Portland mailing list