23#ifndef CIVETWEB_HEADER_INCLUDED
24#define CIVETWEB_HEADER_INCLUDED
26#define CIVETWEB_VERSION "1.15"
27#define CIVETWEB_VERSION_MAJOR (1)
28#define CIVETWEB_VERSION_MINOR (15)
29#define CIVETWEB_VERSION_PATCH (0)
33#if defined(CIVETWEB_DLL_EXPORTS)
34#define CIVETWEB_API __declspec(dllexport)
35#elif defined(CIVETWEB_DLL_IMPORTS)
36#define CIVETWEB_API __declspec(dllimport)
41#define CIVETWEB_API __attribute__((visibility("default")))
141#define MG_MAX_HEADERS (64)
294#if defined(MG_EXPERIMENTAL_INTERFACES)
344 unsigned context_flags);
347 unsigned context_flags);
393 void *(*init_thread)(
const struct mg_context *ctx,
int thread_type);
402 void *thread_pointer);
448 const char **configuration_options);
477 const char **configuration_options);
724#define mg_server_ports mg_server_port
758 const char *password);
868#undef PRINTF_FORMAT_STRING
869#if defined(_MSC_VER) && _MSC_VER >= 1400
871#if defined(_MSC_VER) && _MSC_VER > 1400
872#define PRINTF_FORMAT_STRING(s) _Printf_format_string_ s
874#define PRINTF_FORMAT_STRING(s) __format_string s
877#define PRINTF_FORMAT_STRING(s) s
881#define PRINTF_ARGS(x, y) __attribute__((format(printf, x, y)))
883#define PRINTF_ARGS(x, y)
899 unsigned int chunk_len);
959 const
char *target_url,
1028 const
char *additional_headers);
1079 const
char *var_name,
1108 const
char *var_name,
1144 unsigned num_form_fields);
1161 const
char *var_name,
1190 size_t error_buffer_size,
1221 int (*field_found)(
const char *key,
1239 int (*field_get)(
const char *key,
1261 int (*field_store)(
const char *path,
long long file_size,
void *user_data);
1307typedef void *(*mg_thread_func_t)(
void *);
1335 int is_form_url_encoded);
1393 size_t error_buffer_size,
1405 size_t error_buffer_size,
1408 const
char *extensions,
1430 size_t error_buffer_size);
1446 size_t error_buffer_size);
1452 size_t error_buffer_size,
1463 size_t error_buffer_size,
1466 const char *extensions,
1471#if defined(MG_LEGACY_INTERFACE)
1472enum { TIMEOUT_INFINITE = -1 };
1549 const char *http1_headers);
1641#if defined(MG_EXPERIMENTAL_INTERFACES)
1684#if defined(MG_EXPERIMENTAL_INTERFACES)
1687mg_connect_client2(
const char *host,
1688 const char *protocol,
1704 const char **configuration_options,
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
void mg_send_mime_file2(struct mg_connection *conn, const char *path, const char *mime_type, const char *additional_headers)
int mg_websocket_client_write(struct mg_connection *conn, int opcode, const char *data, size_t data_len)
int mg_strncasecmp(const char *s1, const char *s2, size_t len)
int mg_read(struct mg_connection *, void *buf, size_t len)
void mg_unlock_connection(struct mg_connection *conn)
const struct mg_option * mg_get_valid_options(void)
int mg_response_header_add(struct mg_connection *conn, const char *header, const char *value, int value_len)
void *(* mg_thread_func_t)(void *)
int mg_write(struct mg_connection *, const void *buf, size_t len)
void mg_lock_context(struct mg_context *ctx)
int mg_response_header_send(struct mg_connection *conn)
const struct mg_request_info * mg_get_request_info(const struct mg_connection *)
int mg_send_http_redirect(struct mg_connection *conn, const char *target_url, int redirect_code)
int mg_websocket_write(struct mg_connection *conn, int opcode, const char *data, size_t data_len)
struct mg_connection * mg_connect_websocket_client_secure(const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
#define PRINTF_FORMAT_STRING(s)
int mg_get_server_ports(const struct mg_context *ctx, int size, struct mg_server_port *ports)
int mg_get_var2(const char *data, size_t data_len, const char *var_name, char *dst, size_t dst_len, size_t occurrence)
void mg_disable_connection_keep_alive(struct mg_connection *conn)
struct mg_connection * mg_connect_client_secure(const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size)
int mg_send_http_ok(struct mg_connection *conn, const char *mime_type, long long content_length)
void mg_send_file(struct mg_connection *conn, const char *path)
int(* mg_authorization_handler)(struct mg_connection *conn, void *cbdata)
const char * mg_get_response_code_text(const struct mg_connection *conn, int response_code)
const char * mg_get_header(const struct mg_connection *, const char *name)
int mg_send_http_error(struct mg_connection *conn, int status_code, const char *fmt,...)
@ MG_CONFIG_TYPE_DIRECTORY
@ MG_CONFIG_TYPE_EXT_PATTERN
@ MG_CONFIG_TYPE_STRING_MULTILINE
@ MG_CONFIG_TYPE_STRING_LIST
@ MG_CONFIG_TYPE_YES_NO_OPTIONAL
@ MG_FEATURES_X_DOMAIN_SOCKET
@ MG_FEATURES_COMPRESSION
struct mg_context * mg_start2(struct mg_init_data *init, struct mg_error_data *error)
void * mg_get_user_context_data(const struct mg_connection *conn)
long long mg_store_body(struct mg_connection *conn, const char *path)
int mg_get_response(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int timeout)
@ MG_WEBSOCKET_OPCODE_CONNECTION_CLOSE
@ MG_WEBSOCKET_OPCODE_BINARY
@ MG_WEBSOCKET_OPCODE_PONG
@ MG_WEBSOCKET_OPCODE_TEXT
@ MG_WEBSOCKET_OPCODE_CONTINUATION
@ MG_WEBSOCKET_OPCODE_PING
unsigned mg_check_feature(unsigned feature)
void(* mg_websocket_ready_handler)(struct mg_connection *, void *)
void mg_set_websocket_handler(struct mg_context *ctx, const char *uri, mg_websocket_connect_handler connect_handler, mg_websocket_ready_handler ready_handler, mg_websocket_data_handler data_handler, mg_websocket_close_handler close_handler, void *cbdata)
int mg_get_var(const char *data, size_t data_len, const char *var_name, char *dst, size_t dst_len)
int mg_start_thread(mg_thread_func_t f, void *p)
void mg_unlock_context(struct mg_context *ctx)
unsigned mg_init_library(unsigned features)
struct mg_connection * mg_connect_client(const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size)
int mg_response_header_add_lines(struct mg_connection *conn, const char *http1_headers)
int mg_start_domain2(struct mg_context *ctx, const char **configuration_options, struct mg_error_data *error)
void mg_send_mime_file(struct mg_connection *conn, const char *path, const char *mime_type)
int mg_handle_form_request(struct mg_connection *conn, struct mg_form_data_handler *fdh)
int mg_split_form_urlencoded(char *data, struct mg_header *form_fields, unsigned num_form_fields)
void mg_set_user_connection_data(const struct mg_connection *conn, void *data)
const struct mg_response_info * mg_get_response_info(const struct mg_connection *)
unsigned mg_exit_library(void)
int mg_send_digest_access_authentication_request(struct mg_connection *conn, const char *realm)
struct mg_connection * mg_connect_websocket_client(const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
struct mg_context * mg_start(const struct mg_callbacks *callbacks, void *user_data, const char **configuration_options)
char * mg_md5(char buf[33],...)
int mg_get_request_link(const struct mg_connection *conn, char *buf, size_t buflen)
int mg_url_encode(const char *src, char *dst, size_t dst_len)
struct mg_connection * mg_connect_websocket_client_extensions(const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, const char *extensions, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
int mg_url_decode(const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded)
int mg_start_domain(struct mg_context *ctx, const char **configuration_options)
#define PRINTF_ARGS(x, y)
struct mg_connection * mg_connect_websocket_client_secure_extensions(const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, const char *extensions, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
@ MG_FORM_FIELD_STORAGE_GET
@ MG_FORM_FIELD_STORAGE_ABORT
@ MG_FORM_FIELD_STORAGE_STORE
@ MG_FORM_FIELD_STORAGE_SKIP
void mg_close_connection(struct mg_connection *conn)
int mg_modify_passwords_file_ha1(const char *passwords_file_name, const char *realm, const char *user, const char *ha1)
void * mg_get_user_connection_data(const struct mg_connection *conn)
@ MG_FORM_FIELD_HANDLE_NEXT
@ MG_FORM_FIELD_HANDLE_GET
@ MG_FORM_FIELD_HANDLE_ABORT
const char * mg_get_builtin_mime_type(const char *file_name)
int mg_send_chunk(struct mg_connection *conn, const char *chunk, unsigned int chunk_len)
int(* mg_websocket_data_handler)(struct mg_connection *, int, char *, size_t, void *)
void mg_set_auth_handler(struct mg_context *ctx, const char *uri, mg_authorization_handler handler, void *cbdata)
int(* mg_request_handler)(struct mg_connection *conn, void *cbdata)
int mg_get_context_info(const struct mg_context *ctx, char *buffer, int buflen)
void * mg_get_thread_pointer(const struct mg_connection *conn)
int mg_get_cookie(const char *cookie, const char *var_name, char *buf, size_t buf_len)
int mg_response_header_start(struct mg_connection *conn, int status)
void(* mg_websocket_close_handler)(const struct mg_connection *, void *)
int mg_strcasecmp(const char *s1, const char *s2)
void mg_set_request_handler(struct mg_context *ctx, const char *uri, mg_request_handler handler, void *cbdata)
void mg_stop(struct mg_context *)
int mg_check_digest_access_authentication(struct mg_connection *conn, const char *realm, const char *filename)
int(* mg_websocket_connect_handler)(const struct mg_connection *, void *)
struct mg_connection * mg_download(const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size, const char *request_fmt,...)
int mg_get_system_info(char *buffer, int buflen)
struct mg_context * mg_get_context(const struct mg_connection *conn)
void mg_set_websocket_handler_with_subprotocols(struct mg_context *ctx, const char *uri, struct mg_websocket_subprotocols *subprotocols, mg_websocket_connect_handler connect_handler, mg_websocket_ready_handler ready_handler, mg_websocket_data_handler data_handler, mg_websocket_close_handler close_handler, void *cbdata)
int mg_modify_passwords_file(const char *passwords_file_name, const char *realm, const char *user, const char *password)
int mg_printf(struct mg_connection *, const char *fmt,...)
void * mg_get_user_data(const struct mg_context *ctx)
const char * mg_version(void)
void mg_lock_connection(struct mg_connection *conn)
int mg_send_file_body(struct mg_connection *conn, const char *path)
int(* init_ssl)(void *ssl_ctx, void *user_data)
int(* log_message)(const struct mg_connection *, const char *message)
void(* exit_lua)(const struct mg_connection *conn, void *lua_context, unsigned context_flags)
void(* end_request)(const struct mg_connection *, int reply_status_code)
int(* init_connection)(const struct mg_connection *conn, void **conn_data)
void(* connection_close)(const struct mg_connection *)
int(* http_error)(struct mg_connection *conn, int status, const char *errmsg)
void(* exit_context)(const struct mg_context *ctx)
int(* init_ssl_domain)(const char *server_domain, void *ssl_ctx, void *user_data)
int(* external_ssl_ctx)(void **ssl_ctx, void *user_data)
void(* exit_thread)(const struct mg_context *ctx, int thread_type, void *thread_pointer)
int(* begin_request)(struct mg_connection *)
int(* log_access)(const struct mg_connection *, const char *message)
void(* init_context)(const struct mg_context *ctx)
void(* connection_closed)(const struct mg_connection *)
void(* init_lua)(const struct mg_connection *conn, void *lua_context, unsigned context_flags)
int(* external_ssl_ctx_domain)(const char *server_domain, void **ssl_ctx, void *user_data)
struct mg_callbacks callbacks
const struct mg_callbacks * callbacks
const char ** configuration_options
const char * default_value
struct mg_header http_headers[(64)]
const char * local_uri_raw
const char * request_method
struct mg_client_cert * client_cert
const char * query_string
const char * http_version
const char * acceptedWebSocketSubprotocol
struct mg_header http_headers[(64)]
const char * http_version
const char ** subprotocols