File: file.h

package info (click to toggle)
mpdscribble 0.2.10-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 716 kB
  • ctags: 500
  • sloc: ansic: 3,904; sh: 3,603; makefile: 70
file content (70 lines) | stat: -rw-r--r-- 1,998 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
    This file is part of mpdscribble.
    another audioscrobbler plugin for music player daemon.
    Copyright © 2005 Kuno Woudt <kuno@frob.nl>

    mpdscribble 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.

    mpdscribble 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 mpdscribble; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

#ifndef FILE_H
#define FILE_H

/* 
  default locations for files.

  FILE_ETC_* are paths for a system-wide install.
  FILE_USR_* will be used instead if FILE_USR_CONF exists.
*/

#define FILE_CONF       "/etc/mpdscribble.conf"
#define FILE_CACHE      "/var/cache/mpdscribble/mpdscribble.cache"
#define FILE_LOG        "/var/log/mpdscribble/mpdscribble.log"
#define FILE_HOME_CONF  "~/.mpdscribble/mpdscribble.conf"
#define FILE_HOME_CACHE "~/.mpdscribble/mpdscribble.cache"
#define FILE_HOME_LOG   "~/.mpdscribble/mpdscribble.log"

#define FILE_DEFAULT_PORT 6600
#define FILE_DEFAULT_HOST "localhost"

enum file_location { file_etc, file_home, file_unknown, };

#include "as.h"

struct config
{
  char *username;
  char *password;
  char *log;
  char *cache;
  char *musicdir;
  char *conf;
  char *host;
  int port;
  int sleep;
  int cache_interval;
  int verbose;
  enum file_location loc;
};

extern struct config file_config;

FILE *file_open_logfile (void);
int file_read_config (int argc, char **argv);
int file_write_cache (struct song *sng);
int file_read_cache (void);
void file_cleanup (void);

#endif /* FILE_H */