On Fri, Apr 27, 2001 at 06:52:45PM -0500, Steven Hazel wrote: > "Kalle A. Sandstr\"om" <ksandstr at iki.fi> writes: > > > Many functions aren't prefixed (inappropriate for a potentially shared > > library). > > Yeah, I should have done that a long time ago. All of the exposed API > functions are prefixed. I'll be sure to get around to prefixing the > rest of them, unless you feel like having some search-and-replace fun > yourself. > > > Also, glib has a nice stdout/stderr/logging abstraction which should > > make things easier for a node that runs as a UNIX daemon (i.e. the > > node could install its own log handlers into glib and push the > > output into a log file instead of a stdout connected to /dev/null). > > I don't think this kind of thing is appropriate internal to a library. > Does my library have to support glib for you to use it for logging?
Not really, no. It'd be nice to have some kind of "output to log through THIS function here" interface in any case. Sufficiently verbose error reporting (i.e. both an error code and a description of what went wrong) is probably good too. > > There's also a pretty nice mutual exclusion thingy in the glib > > thread module, that would remove the need to code for POSIX threads > > if libfreenet ever requires explicit threading support > > (gethostbyname(3), anybody?). > > Threading does not belong in a unix library. My goal is to write a > threadsafe API, and let users worry about whether they want to thread > or fork() or select(). True, that. But then there's the matter of non-reentrant functions (frex gethostbyname(3)) that would either have to be wrapped, or not used at all (letting the using code do the resolving for the library, which is arguably the right thing to do). > > The 'cipherstream_t' stuff was designed to use a separate 'cipher_t' > > block cipher encapsulation because I wanted to be able to switch > > between Rijndael and Twofish cleanly, perhaps supporting other types > > of encryption in the future. The result is a bit C++-ish, only in > > C. > > I think libfreenet already has something like this. Yeah. My version may be a tad overengineered. -- Kalle A. Sandstro"m ksandstr &at& iki &dot& fi http ohutsuoli 2*viilto www piste iki piste fi viilto mato ksandstr viilto 1ED7 C636: 7728 49D5 F784 D2DD D20F 63CF 655D F19E 1ED7 C636 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20010428/4494e90c/attachment.pgp>
