hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
httpd.H
Go to the documentation of this file.
1 /*****************************************
2  * an optional quick-and-dirty web server that works through events
3  ****************************************/
4 
5 #ifndef HOBBES_EVENTS_HTTPD_HPP_INCLUDED
6 #define HOBBES_EVENTS_HTTPD_HPP_INCLUDED
7 
8 #include <string>
9 #include <vector>
10 #include <map>
11 
12 namespace hobbes {
13 
14 struct HTTPRequest {
15  typedef std::map<std::string, std::string> Headers;
16  typedef std::vector<char> Data;
17 
18  std::string method;
19  std::string document;
20  Headers headers;
21  Data data;
22 };
23 
24 typedef void (*HTTPRequestHandler)(const HTTPRequest&, int fd, void* ud);
25 
26 int installHTTPD(int port, HTTPRequestHandler, void* ud = 0);
27 
28 }
29 
30 #endif
31 
std::map< std::string, std::string > Headers
Definition: httpd.H:15
Definition: httpd.H:14
std::vector< char > Data
Definition: httpd.H:16
Definition: boot.H:7
Headers headers
Definition: httpd.H:20
void(* HTTPRequestHandler)(const HTTPRequest &, int fd, void *ud)
Definition: httpd.H:24
std::string document
Definition: httpd.H:19
int installHTTPD(int port, HTTPRequestHandler, void *ud=0)
Definition: httpd.C:151
Data data
Definition: httpd.H:21
std::string method
Definition: httpd.H:18