Add to git.
[pthrlib.git] / examples / pthr_eg2_server.h
1 /* Pseudothread server example.
2  * - by Richard W.M. Jones <rich@annexia.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  * $Id: pthr_eg2_server.h,v 1.2 2002/08/21 10:42:16 rich Exp $
19  */
20
21 #ifndef PTHR_EG2_SERVER_H
22 #define PTHR_EG2_SERVER_H
23
24 #ifdef HAVE_SYS_SOCKET_H
25 #include <sys/socket.h>
26 #endif
27
28 #include <pool.h>
29
30 #include "src/pthr_pseudothread.h"
31 #include "src/pthr_http.h"
32 #include "src/pthr_iolib.h"
33
34 /* Define some RFC-compliant dates to represent past and future. */
35 #define DISTANT_PAST   "Thu, 01 Dec 1994 16:00:00 GMT"
36 #define DISTANT_FUTURE "Sun, 01 Dec 2030 16:00:00 GMT"
37
38 /* Headers which are sent to defeat caches. */
39 #define NO_CACHE_HEADERS "Cache-Control", "must-revalidate", "Expires", DISTANT_PAST, "Pragma", "no-cache"
40
41 #define CRLF "\r\n"
42
43 struct eg2_server_processor;
44 typedef struct eg2_server_processor *eg2_server_processor;
45
46 extern eg2_server_processor new_eg2_server_processor (int sock);
47
48 #endif /* PTHR_EG2_SERVER_H */