LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

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

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

Conor Daly conor.daly_ilug at cod.homelinux.org
Fri Nov 17 16:03:20 GMT 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 ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell