ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/rpc/include/httpd.h
Revision: 1.4
Committed: Sun Sep 16 18:54:44 2007 UTC (19 years, 1 month ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.3: +9 -2 lines
Log Message:
#defines to enum

File Contents

# User Rev Content
1 pippijn 1.4 /**
2     * account.h: Data structures for account information.
3     *
4     * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
5     * Rights to this code are as documented in COPYING.
6     *
7     *
8     * Portions of this file were derived from sources bearing the following license:
9 pippijn 1.1 * Copyright © 2005 Atheme Development Group
10 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
11 pippijn 1.1 *
12     * Generic HTTP server
13     *
14 pippijn 1.4 * $Id: httpd.h,v 1.3 2007-08-28 17:08:11 pippijn Exp $
15 pippijn 1.1 */
16    
17     #ifndef HTTPD_H
18     #define HTTPD_H
19    
20     #include <map>
21    
22 pippijn 1.3 #include <common/util.h>
23 pippijn 1.1
24     struct path_handler_t
25     {
26     char *path;
27     void (*handler) (connection_t *, void *);
28     };
29    
30 pippijn 1.3 typedef std::vector <path_handler_t> pathvec;
31 pippijn 1.1
32     struct httpddata
33     {
34     char method[64];
35     char filename[256];
36 pippijn 1.3 char *replybuf;
37 pippijn 1.1 char *requestbuf;
38     int length;
39     int lengthdone;
40     bool connection_close;
41     bool correct_content_type;
42     bool expect_100_continue;
43     bool sent_reply;
44 pippijn 1.3
45     httpddata ()
46     : replybuf (0),
47     requestbuf (0),
48     length (0),
49     lengthdone (0),
50     connection_close (false),
51     correct_content_type (false),
52     expect_100_continue (false),
53     sent_reply (false)
54     {
55     method[0] = 0;
56     filename[0] = 0;
57     }
58    
59     void clear (void);
60 pippijn 1.1 };
61    
62     struct pathhandler_eq
63     {
64 pippijn 1.3 pathhandler_eq (char const * const otherpath)
65     : path (otherpath)
66     {
67     }
68 pippijn 1.1
69 pippijn 1.3 bool operator () (path_handler_t const &other)
70 pippijn 1.1 {
71 pippijn 1.3 return !strcmp (other.path, path);
72 pippijn 1.1 }
73    
74     private:
75 pippijn 1.3 char const * const path;
76 pippijn 1.1 };
77    
78     #endif