more doxygen stuff

This commit is contained in:
Ron Pedde
2004-11-12 07:27:05 +00:00
parent 71ec35efd3
commit 2801956df0
4 changed files with 61 additions and 47 deletions

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;