summaryrefslogtreecommitdiffstats
path: root/lurker/render/commands.h
blob: c98484cb520df5b74d3f8e2a6c95312f84a50ae3 (plain)
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
/*  $Id: commands.h 1649 2009-10-19 14:35:01Z terpstra $
 *  
 *  commands.h - All the commands we support
 *  
 *  Copyright (C) 2002 - Wesley W. Terpstra
 *  
 *  License: GPL
 *  
 *  Authors: 'Wesley W. Terpstra' <wesley@terpstra.ca>
 *  
 *    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; version 2.1.
 *    
 *    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
 */
 
#ifndef COMMANDS_H
#define COMMANDS_H

#include <esort.h>
#include <ConfigFile.h>
#include <vector>

#define _(x) x

struct Request
{
	string options;
	string language;
	string ext;
};

Request parse_request(const string& param);

int handle_message(const Config& c, ESort::Reader* r, const string& param);
int handle_thread (const Config& c, ESort::Reader* r, const string& param);
int handle_mindex (const Config& c, ESort::Reader* r, const string& param);
int handle_splash (const Config& c, ESort::Reader* r, const string& param);
int handle_search (const Config& c, ESort::Reader* r, const string& param);
int handle_attach (const Config& c, ESort::Reader* r, const string& param);
int handle_mbox   (const Config& c, ESort::Reader* r, const string& param);
int handle_list   (const Config& c, ESort::Reader* r, const string& param);
int handle_zap    (const Config& c, ESort::Reader* r, const string& param);

string redirect(const string& url);
void error(
	const string& main, 
	const string& sub, 
	const string& suggest,
	const string& header = "");

using std::vector;

void tokenize(
	const string& str,
	vector<string>& tokens,
	const string& delimiters = " ");

#endif