From 2801956df07ef875be32748c7ffbfa3e22338b97 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Fri, 12 Nov 2004 07:27:05 +0000 Subject: [PATCH] more doxygen stuff --- Doxyfile | 16 +++++++------- src/daapd.h | 63 ++++++++++++++++++++++++++++++++--------------------- src/err.c | 20 +++++++---------- src/main.c | 9 ++++++-- 4 files changed, 61 insertions(+), 47 deletions(-) diff --git a/Doxyfile b/Doxyfile index 1cb0dc2b..af266a64 100644 --- a/Doxyfile +++ b/Doxyfile @@ -169,7 +169,7 @@ DISTRIBUTE_GROUP_DOC = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. -TAB_SIZE = 4 +TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". @@ -221,7 +221,7 @@ EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. @@ -425,7 +425,7 @@ INPUT = src # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp # *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm -FILE_PATTERNS = *.c *.h +FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. @@ -448,7 +448,7 @@ EXCLUDE_SYMLINKS = NO # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = mDNS* redblack* # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see @@ -505,7 +505,7 @@ SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. -INLINE_SOURCES = NO +INLINE_SOURCES = YES # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code @@ -1022,7 +1022,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and @@ -1054,7 +1054,7 @@ TEMPLATE_RELATIONS = NO # file showing the direct and indirect include dependencies of the file with # other documented files. -INCLUDE_GRAPH = YES +INCLUDE_GRAPH = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each @@ -1069,7 +1069,7 @@ INCLUDED_BY_GRAPH = YES # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. -CALL_GRAPH = NO +CALL_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. diff --git a/src/daapd.h b/src/daapd.h index efc6f7c2..35bfd1a1 100644 --- a/src/daapd.h +++ b/src/daapd.h @@ -19,38 +19,51 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/** + * \file daapd.h + * + * header file for main.c. Why it isn't main.h, I don't know. + * In fact... + * + * \todo make daapd.h into main.h + */ + #ifndef _DAAPD_H_ #define _DAAPD_H_ +/** Simple struct for holding stat info. + * \todo wire up the tag_stats#bytes_served stuff into r_write() in restart.c + */ typedef struct tag_stats { - time_t start_time; - int songs_served; - - unsigned int gb_served; - unsigned int bytes_served; + time_t start_time; /**< When the server was started */ + int songs_served; /**< How many songs have been served */ + + unsigned int gb_served; /**< How many gigs of data have been served (unused) */ + unsigned int bytes_served; /**< How many bytes of data served (unused) */ } STATS; +/** Global config struct */ typedef struct tag_config { - int use_mdns; - int stop; - int reload; - char *configfile; - char *web_root; - int port; - int rescan_interval; - int always_scan; /* 0 to minimize disk usage (embedded devices) - not in config */ - int process_m3u; - char *adminpassword; - char *readpassword; - char *mp3dir; - char *servername; - char *playlist; - char *runas; - char *dbdir; - char *extensions; - char *artfilename; - char *logfile; - STATS stats; + int use_mdns; /**< Should we do rendezvous advertisements? */ + int stop; /**< Time to exit? */ + int reload; /**< Time to reload and/or rescan the database? */ + char *configfile; /**< path to config file */ + char *web_root; /**< path to the directory containing the admin-root files */ + int port; /**< port to listen on */ + int rescan_interval; /**< How often to do a background rescan of the file system */ + int always_scan; /**< 0 to minimize disk usage (embedded devices) - not in config */ + int process_m3u; /**< Should we process m3u files? */ + char *adminpassword; /**< Password to web management pages */ + char *readpassword; /**< iTunes password */ + char *mp3dir; /**< root directory of the mp3 files */ + char *servername; /**< Name advertised via rendezvous */ + char *playlist; /**< Path to the playlist file */ + char *runas; /**< Who to drop privs to (if run as root) */ + char *dbdir; /**< Where to put the db file */ + char *extensions; /**< What music file extentions to process */ + char *artfilename; /**< What filename to merge coverart with */ + char *logfile; /**< What file to use as a logfile */ + STATS stats; /**< Stats structure (see above) */ } CONFIG; extern CONFIG config; diff --git a/src/err.c b/src/err.c index b68e5b4f..fd43b267 100644 --- a/src/err.c +++ b/src/err.c @@ -24,8 +24,8 @@ * Error handling, logging, and memory leak checking. * * Most of these functions should not be used directly. For the most - * part, they are hidden in macros like DPRINTF and MEMNOTIFY. The - * only function here that is really directly useable is log_setdest + * part, they are hidden in macros like #DPRINTF and #MEMNOTIFY. The + * only function here that is really directly useable is log_setdest() */ #ifdef HAVE_CONFIG_H @@ -83,13 +83,11 @@ static int err_unlock_mutex(void); /** * Write a printf-style formatted message to the log destination. * This can be stderr, syslog, or a logfile, as determined by - * log_setdest. Note that this function should not be directly - * used, rather it should be used via the DPRINTF macro. + * log_setdest(). Note that this function should not be directly + * used, rather it should be used via the #DPRINTF macro. * * \param level Level at which to log \ref log_levels * \param fmt printf-style - * - * \relatesalso log_setdest */ void log_err(int level, char *fmt, ...) { @@ -139,9 +137,7 @@ void log_err(int level, char *fmt, ...) * * \param app appname (used only for syslog destination) * \param destination where to log to \ref log_dests "as defined in err.h" - * - * \relatesalso log_err - ****************************************************/ + */ void log_setdest(char *app, int destination) { if(err_logdestination == destination) return; @@ -212,10 +208,10 @@ int err_unlock_mutex(void) { * Let the leak detector know about a chunk of memory * that needs to be freed, but came from an external library. * Example: gdbm functions. Note that this should only - * be called via the MEMNOTIFY macro. + * be called via the #MEMNOTIFY macro. * - * \param file filled in from the MEMNOTIFY macro with __FILE__ - * \param line filled in from the MEMNOTIFY macro with __LINE__ + * \param file filled in from the #MEMNOTIFY macro with __FILE__ + * \param line filled in from the #MEMNOTIFY macro with __LINE__ * \param ptr ptr to block of memory which must be freed */ void err_notify(char *file, int line, void *ptr) { diff --git a/src/main.c b/src/main.c index 7f273238..7b72d9d7 100644 --- a/src/main.c +++ b/src/main.c @@ -36,7 +36,7 @@ * \todo Refactor daap_handler() */ -/* \mainpage mt-daapd +/** \mainpage mt-daapd * \section about_section About * * This is mt-daapd, an attempt to create an iTunes server for @@ -105,7 +105,8 @@ # define SIGCLD SIGCHLD #endif -#define MAIN_SLEEP_INTERVAL 2 /**< seconds to sleep before checking for shutdown/reload */ +/** Seconds to sleep before checking for a shutdown or reload */ +#define MAIN_SLEEP_INTERVAL 2 /* * Globals */ @@ -119,6 +120,8 @@ static void write_pid_file(void); static void usage(char *program); static void *signal_handler(void *arg); static int start_signal_handler(void); +static void daap_handler(WS_CONNINFO *pwsc); +static int daap_auth(char *username, char *password); /** * Handles authentication for the daap server. This isn't the @@ -152,6 +155,8 @@ int daap_auth(char *username, char *password) { * into multiple functions, and perhaps moved into daap.c * * \param pwsc Webserver connection info, passed from the webserver + * + * \todo Decomplexify this! */ void daap_handler(WS_CONNINFO *pwsc) { int close;