1/* 2 * $Id: daapd.h,v 1.1 2009-06-30 02:31:08 steven Exp $ 3 * Header info for daapd server 4 * 5 * Copyright (C) 2003 Ron Pedde (ron@pedde.com) 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 22/** 23 * \file daapd.h 24 * 25 * header file for main.c. Why it isn't main.h, I don't know. 26 * In fact... 27 * 28 * \todo make daapd.h into main.h 29 */ 30 31#ifndef _DAAPD_H_ 32#define _DAAPD_H_ 33 34/** Simple struct for holding stat info. 35 * \todo wire up the tag_stats#bytes_served stuff into r_write() in restart.c 36 */ 37typedef struct tag_stats { 38 time_t start_time; /**< When the server was started */ 39 int songs_served; /**< How many songs have been served */ 40 41 unsigned int gb_served; /**< How many gigs of data have been served (unused) */ 42 unsigned int bytes_served; /**< How many bytes of data served (unused) */ 43} STATS; 44 45/** Global config struct */ 46typedef struct tag_config { 47 int use_mdns; /**< Should we do rendezvous advertisements? */ 48 int stop; /**< Time to exit? */ 49 int reload; /**< Time to reload and/or rescan the database? */ 50 char *configfile; /**< path to config file */ 51 char *iface; /**< interface to advertise on */ 52 char *web_root; /**< path to the directory containing the admin-root files */ 53 int port; /**< port to listen on */ 54 int rescan_interval; /**< How often to do a background rescan of the file system */ 55 int always_scan; /**< 0 to minimize disk usage (embedded devices) */ 56 int process_m3u; /**< Should we process m3u files? */ 57 int scan_type; /**< How hard to search mp3 files. see scan_get_mp3fileinfo() */ 58 int compress; /**< Should we compress? */ 59 int pid; /**< pid that will accept INT to terminate */ 60 char *adminpassword; /**< Password to web management pages */ 61 char *readpassword; /**< iTunes password */ 62 char *mp3dir; /**< root directory of the mp3 files */ 63 char *servername; /**< Name advertised via rendezvous */ 64 char *playlist; /**< Path to the playlist file */ 65 char *runas; /**< Who to drop privs to (if run as root) */ 66 char *dbdir; /**< Where to put the db file */ 67 char *extensions; /**< What music file extentions to process */ 68 char *artfilename; /**< What filename to merge coverart with */ 69 char *logfile; /**< What file to use as a logfile */ 70 STATS stats; /**< Stats structure (see above) */ 71} CONFIG; 72 73extern CONFIG config; 74 75/* Forwards */ 76extern int drop_privs(char *user); 77 78#endif /* _DAAPD_H_ */ 79