libwebsockets
Lightweight C library for HTML5 websockets
lws-cgi.h
1 /*
2  * libwebsockets - small server side websockets and web server implementation
3  *
4  * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation:
9  * version 2.1 of the License.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301 USA
20  *
21  * included from libwebsockets.h
22  */
23 
34 enum lws_enum_stdinouterr {
35  LWS_STDIN = 0,
36  LWS_STDOUT = 1,
37  LWS_STDERR = 2,
38 };
39 
40 enum lws_cgi_hdr_state {
41  LCHS_HEADER,
42  LCHS_CR1,
43  LCHS_LF1,
44  LCHS_CR2,
45  LCHS_LF2,
46  LHCS_RESPONSE,
47  LHCS_DUMP_HEADERS,
48  LHCS_PAYLOAD,
49  LCHS_SINGLE_0A,
50 };
51 
52 struct lws_cgi_args {
53  struct lws **stdwsi;
54  enum lws_enum_stdinouterr ch;
55  unsigned char *data;
56  enum lws_cgi_hdr_state hdr_state;
57  int len;
58 };
59 
60 #ifdef LWS_WITH_CGI
71 LWS_VISIBLE LWS_EXTERN int
72 lws_cgi(struct lws *wsi, const char * const *exec_array,
73  int script_uri_path_len, int timeout_secs,
74  const struct lws_protocol_vhost_options *mp_cgienv);
75 
81 LWS_VISIBLE LWS_EXTERN int
82 lws_cgi_write_split_stdout_headers(struct lws *wsi);
83 
89 LWS_VISIBLE LWS_EXTERN int
90 lws_cgi_kill(struct lws *wsi);
91 
98 LWS_VISIBLE LWS_EXTERN struct lws *
99 lws_cgi_get_stdwsi(struct lws *wsi, enum lws_enum_stdinouterr ch);
100 
101 #endif
103 
Definition: lws-cgi.h:52
int len
Definition: lws-cgi.h:57
struct lws ** stdwsi
Definition: lws-cgi.h:53
enum lws_cgi_hdr_state hdr_state
Definition: lws-cgi.h:56
unsigned char * data
Definition: lws-cgi.h:55
enum lws_enum_stdinouterr ch
Definition: lws-cgi.h:54
Definition: lws-context-vhost.h:994