First steps into providing API documentation
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Aug 2008 23:25:48 +0000 (01:25 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Aug 2008 23:25:48 +0000 (01:25 +0200)
doc/Makefile.am
doc/connman-docs.xml
include/log.h
include/plugin.h
src/log.c
src/plugin.c

index c7b59b6..a2e9205 100644 (file)
@@ -5,25 +5,32 @@ DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml
 
 DOC_SOURCE_DIR = ../src
 
-MKDB_OPTIONS = --sgml-mode --output-format=xml --tmpl-dir=.
+SCAN_OPTIONS = --rebuild-sections --source-dir=../include
+
+MKDB_OPTIONS = --sgml-mode --output-format=xml --tmpl-dir=. \
+                                               --ignore-files=connman \
+                                               --source-dir=../include \
+                                               --source-suffixes=c,h
 
 MKTMPL_OPTIONS = --output-dir=.
 
 HFILE_GLOB = $(top_srcdir)/include/*.h
-CFILE_GLOB = $(top_srcdir)/src/*.c
+CFILE_GLOB = $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h
 
-IGNORE_HFILES = config.h connman.h
+IGNORE_HFILES = connman connman.h supplicant.h \
+               iface.h rtnl.h dbus.h element.h property.h driver.h security.h
 
 HTML_IMAGES =
 
 content_files = connman-introduction.xml
 
-INCLUDES = -I$(top_srcdir) $(GLIB_CFLAGS) $(DBUS_CFLAGS)
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/gdbus \
+       $(GTHREAD_CFLAGS) $(GMODULE_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS)
 
-GTKDOC_LIBS =
+GTKDOC_LIBS = $(DBUS_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) $(GTHREAD_LIBS)
 
 MAINTAINERCLEANFILES = Makefile.in \
-       $(DOC_MODULE).types $(DOC_MODULE)-*.sgml $(DOC_MODULE)-*.txt
+       $(DOC_MODULE).types $(DOC_MODULE)-*.txt *.sgml
 
 if ENABLE_GTK_DOC
 include $(top_srcdir)/doc/gtk-doc.make
index d070a3d..4674a62 100644 (file)
@@ -64,6 +64,8 @@
        This part presents the function reference for Connection Manager.
       </para>
     </partintro>
+    <xi:include href="xml/log.xml" />
+    <xi:include href="xml/plugin.xml" />
   </reference>
 
   <appendix id="license">
index 8a0b5a5..81a5bc4 100644 (file)
 extern "C" {
 #endif
 
+/**
+ * SECTION:log
+ * @title: Logging premitives
+ * @short_description: Functions for logging error and debug information
+ */
+
 extern void connman_info(const char *format, ...);
 extern void connman_error(const char *format, ...);
 extern void connman_debug(const char *format, ...);
 
+/**
+ * DBG:
+ * @fmt: format string
+ * @arg...: list of arguments
+ *
+ * Simple macro around connman_debug() which also include the function
+ * name it is called in.
+ */
 #define DBG(fmt, arg...) connman_debug("%s:%s() " fmt, __FILE__, __FUNCTION__ , ## arg)
 
 #ifdef __cplusplus
index 387a48c..427ceed 100644 (file)
 extern "C" {
 #endif
 
+/**
+ * SECTION:plugin
+ * @title: Plugin premitives
+ * @short_description: Functions for declaring plugins
+ */
+
 struct connman_plugin_desc {
        const char *name;
        const char *description;
@@ -34,7 +40,17 @@ struct connman_plugin_desc {
        void (*exit) (void);
 };
 
-#define CONNMAN_PLUGIN_DEFINE(name,description,version,init,exit) \
+/**
+ * CONNMAN_PLUGIN_DEFINE:
+ * @name: plugin name
+ * @description: plugin description
+ * @version: plugin version string
+ * @init: init function called on plugin loading
+ * @exit: exit function called on plugin removal
+ *
+ * Macro for defining a plugin descriptor
+ */
+#define CONNMAN_PLUGIN_DEFINE(name, description, version, init, exit) \
                struct connman_plugin_desc connman_plugin_desc = { \
                        name, description, version, init, exit \
                };
index 93026d5..b195df2 100644 (file)
--- a/src/log.c
+++ b/src/log.c
 
 static volatile gboolean debug_enabled = FALSE;
 
+/**
+ * connman_info:
+ * @format: format string
+ * @Varargs: list of arguments
+ *
+ * Output general information
+ */
 void connman_info(const char *format, ...)
 {
        va_list ap;
@@ -41,6 +48,13 @@ void connman_info(const char *format, ...)
        va_end(ap);
 }
 
+/**
+ * connman_error:
+ * @format: format string
+ * @varargs: list of arguments
+ *
+ * Output error messages
+ */
 void connman_error(const char *format, ...)
 {
        va_list ap;
@@ -52,6 +66,16 @@ void connman_error(const char *format, ...)
        va_end(ap);
 }
 
+/**
+ * connman_debug:
+ * @format: format string
+ * @varargs: list of arguments
+ *
+ * Output debug message
+ *
+ * The actual output of the debug message is controlled via a command line
+ * switch. If not enabled, these messages will be ignored.
+ */
 void connman_debug(const char *format, ...)
 {
        va_list ap;
index d2ee80f..244aaeb 100644 (file)
@@ -28,8 +28,6 @@
 #include <glib.h>
 #include <gmodule.h>
 
-#include <connman/plugin.h>
-
 #include "connman.h"
 
 static GSList *plugins = NULL;