chiark / gitweb /
Python test script for the scheduling code.
[disorder] / server / disorder-cgi.h
CommitLineData
1e97629d
RK
1/*
2 * This file is part of DisOrder.
3 * Copyright (C) 2004-2008 Richard Kettlewell
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 * USA
19 */
20/** @file server/disorder-cgi.h
21 * @brief Shared header for DisOrder CGI program
22 */
23
24#ifndef DISORDER_CGI_H
25#define DISORDER_CGI_H
26
27#include <config.h>
28#include "types.h"
29
30#include <stdio.h>
31#include <stdarg.h>
32#include <string.h>
33#include <time.h>
34#include <errno.h>
35#include <ctype.h>
36#include <stddef.h>
37
38#include "mem.h"
39#include "kvp.h"
40#include "queue.h"
41#include "rights.h"
42#include "sink.h"
43#include "client.h"
44#include "cgi.h"
45#include "hash.h"
46#include "macros.h"
47#include "printf.h"
48#include "defs.h"
49#include "configuration.h"
50#include "trackname.h"
51#include "table.h"
52#include "vector.h"
53#include "url.h"
54#include "log.h"
55#include "inputline.h"
56#include "split.h"
57#include "mime.h"
e7ce7665 58#include "sendmail.h"
2647daf5 59#include "charset.h"
1e97629d
RK
60
61extern disorder_client *dcgi_client;
62extern char *dcgi_cookie;
e7ce7665
RK
63extern const char *dcgi_error_string;
64extern const char *dcgi_status_string;
1e97629d 65
6d9dd8d9
RK
66/** @brief Entry in a list of tracks or directories */
67struct dcgi_entry {
68 /** @brief Track name */
69 const char *track;
70 /** @brief Sort key */
71 const char *sort;
72 /** @brief Display key */
73 const char *display;
74};
75
76/** @brief Compare two @ref entry objects */
77int dcgi_compare_entry(const void *a, const void *b);
78
e7ce7665 79void dcgi_expand(const char *name, int header);
1e97629d 80void dcgi_action(const char *action);
0d0253c9 81void dcgi_error(const char *key);
1e97629d
RK
82void dcgi_login(void);
83void dcgi_lookup(unsigned want);
84void dcgi_lookup_reset(void);
85void dcgi_expansions(void);
86char *dcgi_cookie_header(void);
87void dcgi_login(void);
d0b6635e 88void dcgi_get_cookie(void);
a2c4ad5f 89struct queue_entry *dcgi_findtrack(const char *id);
1e97629d
RK
90
91void option_set(const char *name, const char *value);
92const char *option_label(const char *key);
93int option_label_exists(const char *key);
94char **option_columns(const char *name, int *ncolumns);
95
96#define DCGI_QUEUE 0x0001
97#define DCGI_PLAYING 0x0002
98#define DCGI_RECENT 0x0004
99#define DCGI_VOLUME 0x0008
1e97629d
RK
100#define DCGI_NEW 0x0040
101#define DCGI_RIGHTS 0x0080
102#define DCGI_ENABLED 0x0100
103#define DCGI_RANDOM_ENABLED 0x0200
104
105extern struct queue_entry *dcgi_queue;
106extern struct queue_entry *dcgi_playing;
107extern struct queue_entry *dcgi_recent;
108
109extern int dcgi_volume_left;
110extern int dcgi_volume_right;
111
112extern char **dcgi_new;
113extern int dcgi_nnew;
114
115extern rights_type dcgi_rights;
116
117extern int dcgi_enabled;
118extern int dcgi_random_enabled;
119
120#endif /* DISORDER_CGI_H */
121
122/*
123Local Variables:
124c-basic-offset:2
125comment-column:40
126fill-column:79
127indent-tabs-mode:nil
128End:
129*/