[prog] Publishing an interface to a shared C lib.

Conor Daly conor.daly-linuxchix at cod.homelinux.org
Fri Nov 17 16:02:29 UTC 2006


Hi all,

So I'm not sure how to go about this.  I'm working on a shared library in
C for use in qc programming.  I want to publish an interface as one or
more include files.  My current layout within the sources looks like:

metdate.c datahandle.c sql.c 
metdate.h datahandle.h sql.h structs.h

where datahandle.h #includes"structs.h".  My normal mode for multi-file
sources for programs is to use a structs.h as a common header and a foo.h
header for each foo.c .  foo.h typically includes structs.h and all that
works fine.  However, in publishing a lib, I presumably need to have a
single libqc.h header file in /usr/local/include/... My main question is:

Do I keep each of my foo.h header files and repeat them in libqc.h or do I
have to dispense with the foo.h headers?

metdate.h publishes date_interval(struct, struct, int)
datahandle.h publishes qc_timeseries_add_datapoint(struct *, struct, struct)
qcrun.h will publish qc_check_delta(int[], int[], foo, bar)

However, I don't want to require users to 
#include <metdate.h>
#include <datahandle.h>
#include <qcrun.h>

Instead they should 

#include <libqc.h>

which will include all the stuff.  However, should users be able to look
in libqc.h and see the function declarations and associated commentary?
Or should they see references to metdate.h, datahandle.h and qcrun.h and
look in there for the details.   Needless to say, there are (already)
corresponding man pages detailing the functions.

Know what I mean?

Conor
-- 
Conor Daly <conor.daly at cod.homelinux.org>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/G/S/O d+(-) s:+ a+ C++(+) UL++++ US++ P>++ L+++>++++ E--- W++ !N
PS+ PE Y+ PGP? tv(-) b+++(+) G e+++(*) h-- r+++ z++++ 
------END GEEK CODE BLOCK------
http://www.geekcode.com/ http://www.ebb.org/ungeek/


More information about the Programming mailing list