1/*
2 * Author:      William Chia-Wei Cheng (bill.cheng@acm.org)
3 *
4 * Copyright (C) 2001-2009, William Chia-Wei Cheng.
5 *
6 * This file may be distributed under the terms of the Q Public License
7 * as defined by Trolltech AS of Norway and appearing in the file
8 * LICENSE.QPL included in the packaging of this file.
9 *
10 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
11 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
13 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
14 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
16 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * @(#)$Header: /mm2/home/cvs/bc-src/tgif/http.e,v 1.8 2011/05/16 16:21:57 william Exp $
19 */
20
21#ifndef _TGIF_HTTP_E_
22#define _TGIF_HTTP_E_
23
24extern int	debugHttp;
25extern int	gnHttpKeepAlive;
26extern char	*gpszFakedReferer;
27
28#ifdef _INCLUDE_FROM_HTTP_C_
29#undef extern
30#define extern
31#endif /*_INCLUDE_FROM_HTTP_C_*/
32
33extern void	HttpFreeBuf ARGS_DECL((char *buf));
34extern void	HttpDebug ARGS_DECL((int));
35extern void	DoBase64Encode ARGS_DECL((char *buf_in, int buf_len,
36		                          char *return_buf_in));
37extern int	DoBase64Decode ARGS_DECL((char *buf_in, int buf_len,
38		                          char *return_buf_in));
39extern char	*Base64Encode ARGS_DECL((char*));
40extern char	*Base64Decode ARGS_DECL((char*));
41extern char	*FindAuthorization ARGS_DECL((char *pszHost, int nPort,
42		                             char *pszScheme, char *pszRealm));
43extern void	CommitAuthorization ARGS_DECL((void));
44extern void	ResetAuthorization ARGS_DECL((void));
45extern int	SetAuthorization ARGS_DECL((char *pszHost, int nPort,
46		                            char *pszScheme, char *pszRealm,
47		                            char *pszAuth));
48extern void	HttpClearReferer ARGS_DECL((void));
49extern void	HttpSetReferer ARGS_DECL((char*));
50extern void	HttpFakeReferer ARGS_DECL((char*));
51extern void	CleanUpHttp ARGS_DECL((void));
52extern void	InitHttp ARGS_DECL((void));
53extern char	*HttpHeaderGetVersion ARGS_DECL((void));
54extern int	HttpHeaderGetResponseCode ARGS_DECL((void));
55extern char	*HttpHeaderGetResponseStatus ARGS_DECL((void));
56extern char	*HttpHeaderGetLastModified ARGS_DECL((void));
57extern char	*HttpHeaderGetServer ARGS_DECL((void));
58extern char	*HttpHeaderGetConnection ARGS_DECL((void));
59extern char	*HttpHeaderGetLocation ARGS_DECL((void));
60extern char	*HttpHeaderGetWWWAuthentication ARGS_DECL((void));
61extern char	*HttpHeaderGetContentEncoding ARGS_DECL((void));
62extern char	*HttpHeaderGetContentType ARGS_DECL((void));
63extern long	HttpHeaderGetContentLength ARGS_DECL((void));
64extern char	*HttpHeaderGetOtherField ARGS_DECL((char*));
65
66extern int	HttpDoConnect ARGS_DECL((char *psz_host, int us_port,
67		                         int *pn_socket));
68extern int	HttpDoWrite ARGS_DECL((int n_socket, char *psz_path,
69		                       char *psz_host, int us_port));
70extern void	HttpDumpHeader ARGS_DECL((void));
71extern char	*HttpExtractText ARGS_DECL((char *buf, int *pn_buf_sz,
72		                            int *pn_html,
73		                            char **ppsz_content_type));
74extern int	HttpDoRead ARGS_DECL((int n_socket, char **ppsz_buf,
75		                      int *pn_buf_sz));
76
77#ifdef _INCLUDE_FROM_HTTP_C_
78#undef extern
79#ifndef _NO_RECURSIVE_EXTERN
80#define extern extern
81#endif /* ~_NO_RECURSIVE_EXTERN */
82#endif /*_INCLUDE_FROM_HTTP_C_*/
83
84#endif /*_TGIF_HTTP_E_*/
85