2003-10-13 11:03:14 -04:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
* Header info for daapd server
|
|
|
|
*
|
2003-12-29 15:41:08 -05:00
|
|
|
* Copyright (C) 2003 Ron Pedde (ron@pedde.com)
|
2003-10-13 11:03:14 -04:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2004-11-12 02:27:05 -05:00
|
|
|
/**
|
|
|
|
* \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
|
|
|
|
*/
|
|
|
|
|
2003-10-13 11:03:14 -04:00
|
|
|
#ifndef _DAAPD_H_
|
|
|
|
#define _DAAPD_H_
|
|
|
|
|
2005-11-07 00:58:05 -05:00
|
|
|
#include "webserver.h"
|
|
|
|
|
2004-11-12 02:27:05 -05:00
|
|
|
/** Simple struct for holding stat info.
|
|
|
|
* \todo wire up the tag_stats#bytes_served stuff into r_write() in restart.c
|
|
|
|
*/
|
2004-03-26 15:59:28 -05:00
|
|
|
typedef struct tag_stats {
|
2004-11-12 02:27:05 -05:00
|
|
|
time_t start_time; /**< When the server was started */
|
|
|
|
int songs_served; /**< How many songs have been served */
|
2006-01-05 19:05:02 -05:00
|
|
|
|
2004-11-12 02:27:05 -05:00
|
|
|
unsigned int gb_served; /**< How many gigs of data have been served (unused) */
|
|
|
|
unsigned int bytes_served; /**< How many bytes of data served (unused) */
|
2004-03-26 15:59:28 -05:00
|
|
|
} STATS;
|
2003-10-13 11:03:14 -04:00
|
|
|
|
2004-11-12 02:27:05 -05:00
|
|
|
/** Global config struct */
|
2003-10-13 11:03:14 -04:00
|
|
|
typedef struct tag_config {
|
2004-11-12 02:27:05 -05:00
|
|
|
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 */
|
2005-07-14 17:10:05 -04:00
|
|
|
char *web_root; /**< path to the dir containing the web files */
|
2005-08-15 22:26:32 -04:00
|
|
|
char *iface; /**< interface to advertise on */
|
2004-11-12 02:27:05 -05:00
|
|
|
int port; /**< port to listen on */
|
2005-07-14 17:10:05 -04:00
|
|
|
int rescan_interval; /**< How often to do a background fs rescan */
|
2004-11-16 00:28:48 -05:00
|
|
|
int always_scan; /**< 0 to minimize disk usage (embedded devices) */
|
2004-11-12 02:27:05 -05:00
|
|
|
int process_m3u; /**< Should we process m3u files? */
|
2005-07-14 17:10:05 -04:00
|
|
|
int scan_type; /**< Method for finding playtime. see scan-mp3.c */
|
2004-12-29 00:44:32 -05:00
|
|
|
int compress; /**< Should we compress? */
|
2005-01-30 01:58:36 -05:00
|
|
|
int pid; /**< pid that will accept INT to terminate */
|
2005-02-24 00:04:05 -05:00
|
|
|
int latin1_tags; /**< interpret all tags as latin1 rather than utf8 */
|
2004-11-12 02:27:05 -05:00
|
|
|
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 */
|
2005-11-11 18:52:42 -05:00
|
|
|
char *ssc_codectypes; /**< What codectypes are converted in server */
|
2005-02-21 03:10:37 -05:00
|
|
|
char *ssc_prog; /**< Server side music format converter prog */
|
2004-11-12 02:27:05 -05:00
|
|
|
char *artfilename; /**< What filename to merge coverart with */
|
|
|
|
char *logfile; /**< What file to use as a logfile */
|
2005-07-14 17:10:05 -04:00
|
|
|
char *compdirs; /**< Compilations directories */
|
2006-01-05 19:05:02 -05:00
|
|
|
char *dbtype; /**< db backend type */
|
|
|
|
char *dbparms; /**< parameters for the db backend */
|
2005-07-14 17:10:05 -04:00
|
|
|
char **complist; /**< list of compilation directories */
|
2004-11-12 02:27:05 -05:00
|
|
|
STATS stats; /**< Stats structure (see above) */
|
2006-01-05 19:05:02 -05:00
|
|
|
WSHANDLE server; /**< webserver handle */
|
2003-10-13 11:03:14 -04:00
|
|
|
} CONFIG;
|
|
|
|
|
2003-11-12 01:23:16 -05:00
|
|
|
extern CONFIG config;
|
2003-10-13 11:03:14 -04:00
|
|
|
|
2004-01-19 23:41:20 -05:00
|
|
|
/* Forwards */
|
2004-02-14 19:51:11 -05:00
|
|
|
extern int drop_privs(char *user);
|
2004-01-19 23:41:20 -05:00
|
|
|
|
2003-10-13 11:03:14 -04:00
|
|
|
#endif /* _DAAPD_H_ */
|