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

Pádraig Brady P at draigBrady.com
Fri Nov 17 16:40:42 GMT 2006


Conor Daly wrote:
> 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?

no need

> Or should they see references to metdate.h, datahandle.h and qcrun.h and
> look in there for the details.

yes, and easy with "gf" in vim, or ctags, or ...

Also if you look at existing libraries like gtk:

#ifndef __GTK_H__
#define __GTK_H__

#include <gdk/gdk.h>
#include <gtk/gtkaboutdialog.h>
/* loads more snipped */
#include <gtk/gtkwindow.h>

#endif /* __GTK_H__ */

Pádraig.



More information about the ILUG mailing list