|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
40 #ifndef CIVETWEB_HEADER_INCLUDED
41 #define CIVETWEB_HEADER_INCLUDED
43 #define CIVETWEB_VERSION "1.16"
44 #define CIVETWEB_VERSION_MAJOR (1)
45 #define CIVETWEB_VERSION_MINOR (16)
46 #define CIVETWEB_VERSION_PATCH (0)
50 #if defined(CIVETWEB_DLL_EXPORTS)
51 #define CIVETWEB_API __declspec(dllexport)
52 #elif defined(CIVETWEB_DLL_IMPORTS)
53 #define CIVETWEB_API __declspec(dllimport)
58 #define CIVETWEB_API __attribute__((visibility("default")))
154 struct mg_connection;
158 #define MG_MAX_HEADERS (64)
253 void (*
end_request)(
const struct mg_connection *,
int reply_status_code);
257 int (*
log_message)(
const struct mg_connection *,
const char *message);
261 int (*
log_access)(
const struct mg_connection *,
const char *message);
311 #if defined(MG_EXPERIMENTAL_INTERFACES)
321 int (*websocket_data)(
struct mg_connection *,
361 unsigned context_flags);
364 unsigned context_flags);
410 void *(*init_thread)(
const struct mg_context *ctx,
int thread_type);
419 void *thread_pointer);
465 const char **configuration_options);
494 const char **configuration_options);
602 struct mg_context *ctx,
741 #define mg_server_ports mg_server_port
775 const char *password);
885 #undef PRINTF_FORMAT_STRING
886 #if defined(_MSC_VER) && _MSC_VER >= 1400
888 #if defined(_MSC_VER) && _MSC_VER > 1400
889 #define PRINTF_FORMAT_STRING(s) _Printf_format_string_ s
891 #define PRINTF_FORMAT_STRING(s) __format_string s
894 #define PRINTF_FORMAT_STRING(s) s
898 #define PRINTF_ARGS(x, y) __attribute__((format(printf, x, y)))
900 #define PRINTF_ARGS(x, y)
916 unsigned int chunk_len);
961 const
char *mime_type,
976 const
char *target_url,
1016 const
char *filename);
1028 const
char *mime_type);
1044 const
char *mime_type,
1045 const
char *additional_headers);
1096 const
char *var_name,
1125 const
char *var_name,
1161 unsigned num_form_fields);
1178 const
char *var_name,
1207 size_t error_buffer_size,
1238 int (*field_found)(
const char *key,
1239 const char *filename,
1256 int (*field_get)(
const char *key,
1278 int (*field_store)(
const char *path,
long long file_size,
void *user_data);
1324 typedef void *(*mg_thread_func_t)(
void *);
1352 int is_form_url_encoded);
1386 #if !defined(MG_MATCH_CONTEXT_MAX_MATCHES)
1387 #define MG_MATCH_CONTEXT_MAX_MATCHES (32)
1402 #if defined(MG_EXPERIMENTAL_INTERFACES)
1460 size_t error_buffer_size,
1472 size_t error_buffer_size,
1475 const
char *extensions,
1497 size_t error_buffer_size);
1513 size_t error_buffer_size);
1519 size_t error_buffer_size,
1530 size_t error_buffer_size,
1533 const char *extensions,
1538 #if defined(MG_LEGACY_INTERFACE)
1539 enum { TIMEOUT_INFINITE = -1 };
1617 const char *http1_headers);
1710 #if defined(MG_EXPERIMENTAL_INTERFACES)
1727 CIVETWEB_API int mg_get_connection_info(
const struct mg_context *ctx,
1822 #if defined(MG_EXPERIMENTAL_INTERFACES)
1825 mg_connect_client2(
const char *host,
1826 const char *protocol,
1832 CIVETWEB_API int mg_get_response2(
struct mg_connection *conn,
1842 const char **configuration_options,
CIVETWEB_API int mg_websocket_client_write(struct mg_connection *conn, int opcode, const char *data, size_t data_len)
@ MG_CONFIG_TYPE_DIRECTORY
@ MG_FEATURES_X_DOMAIN_SOCKET
CIVETWEB_API int mg_response_header_start(struct mg_connection *conn, int status)
@ MG_FORM_FIELD_HANDLE_GET
@ MG_FEATURES_COMPRESSION
CIVETWEB_API 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)
@ MG_CONFIG_TYPE_STRING_LIST
CIVETWEB_API char * mg_md5(char buf[33],...)
CIVETWEB_API void mg_stop(struct mg_context *)
CIVETWEB_API void mg_set_auth_handler(struct mg_context *ctx, const char *uri, mg_authorization_handler handler, void *cbdata)
@ MG_ERROR_DATA_CODE_INIT_PORTS_FAILED
@ MG_ERROR_DATA_CODE_INIT_LIBRARY_FAILED
@ MG_ERROR_DATA_CODE_INIT_USER_FAILED
CIVETWEB_API struct mg_connection * mg_download(const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size, PRINTF_FORMAT_STRING(const char *request_fmt),...) PRINTF_ARGS(6
@ MG_ERROR_DATA_CODE_OS_ERROR
CIVETWEB_API int mg_handle_form_request(struct mg_connection *conn, struct mg_form_data_handler *fdh)
@ MG_FORM_FIELD_STORAGE_ABORT
CIVETWEB_API int mg_get_server_ports(const struct mg_context *ctx, int size, struct mg_server_port *ports)
int(* begin_request)(struct mg_connection *)
const char * local_uri_raw
void *(* mg_thread_func_t)(void *)
@ MG_ERROR_DATA_CODE_HOST_NOT_FOUND
@ MG_ERROR_DATA_CODE_SERVER_STOPPED
const CIVETWEB_API char * mg_get_response_code_text(const struct mg_connection *conn, int response_code)
CIVETWEB_API struct mg_connection * mg_connect_client(const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size)
constexpr const char * init
CIVETWEB_API void mg_set_request_handler(struct mg_context *ctx, const char *uri, mg_request_handler handler, void *cbdata)
@ MG_WEBSOCKET_OPCODE_TEXT
int(* external_ssl_ctx)(void **ssl_ctx, void *user_data)
struct mg_header http_headers[MG_MAX_HEADERS]
CIVETWEB_API int CIVETWEB_API int mg_send_http_ok(struct mg_connection *conn, const char *mime_type, long long content_length)
CIVETWEB_API int mg_strncasecmp(const char *s1, const char *s2, size_t len)
CIVETWEB_API void mg_unlock_context(struct mg_context *ctx)
@ MG_ERROR_DATA_CODE_INVALID_PARAM
@ MG_FORM_FIELD_STORAGE_STORE
CIVETWEB_API int mg_get_cookie(const char *cookie, const char *var_name, char *buf, size_t buf_len)
CIVETWEB_API 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)
@ MG_FORM_FIELD_STORAGE_SKIP
const char * http_version
CIVETWEB_API void mg_disable_connection_keep_alive(struct mg_connection *conn)
@ MG_WEBSOCKET_OPCODE_PING
CIVETWEB_API int mg_url_encode(const char *src, char *dst, size_t dst_len)
CIVETWEB_API int mg_send_http_error(struct mg_connection *conn, int status_code, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(3
CIVETWEB_API struct mg_connection CIVETWEB_API void mg_close_connection(struct mg_connection *conn)
const char * request_method
CIVETWEB_API struct mg_connection * mg_connect_client_secure(const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size)
int(* external_ssl_ctx_domain)(const char *server_domain, void **ssl_ctx, void *user_data)
CIVETWEB_API void CIVETWEB_API int mg_strcasecmp(const char *s1, const char *s2)
@ MG_WEBSOCKET_OPCODE_CONNECTION_CLOSE
CIVETWEB_API void mg_send_mime_file(struct mg_connection *conn, const char *path, const char *mime_type)
CIVETWEB_API int mg_response_header_add_lines(struct mg_connection *conn, const char *http1_headers)
@ MG_ERROR_DATA_CODE_CONNECT_TIMEOUT
CIVETWEB_API const struct mg_response_info * mg_get_response_info(const struct mg_connection *)
int(* init_connection)(const struct mg_connection *conn, void **conn_data)
void(* mg_websocket_ready_handler)(struct mg_connection *, void *)
CIVETWEB_API int mg_check_digest_access_authentication(struct mg_connection *conn, const char *realm, const char *filename)
@ MG_ERROR_DATA_CODE_TLS_CONNECT_ERROR
CIVETWEB_API int mg_start_domain(struct mg_context *ctx, const char **configuration_options)
@ MG_WEBSOCKET_OPCODE_BINARY
int(* http_error)(struct mg_connection *conn, int status, const char *errmsg)
CIVETWEB_API unsigned mg_exit_library(void)
struct mg_client_cert * client_cert
CIVETWEB_API void mg_lock_connection(struct mg_connection *conn)
CIVETWEB_API struct mg_context * mg_start(const struct mg_callbacks *callbacks, void *user_data, const char **configuration_options)
CIVETWEB_API const struct mg_request_info * mg_get_request_info(const struct mg_connection *)
CIVETWEB_API const struct mg_option * mg_get_valid_options(void)
int(* mg_websocket_data_handler)(struct mg_connection *, int, char *, size_t, void *)
const char ** subprotocols
CIVETWEB_API int mg_base64_encode(const unsigned char *src, size_t src_len, char *dst, size_t *dst_len)
@ MG_ERROR_DATA_CODE_CONNECT_FAILED
struct mg_header http_headers[MG_MAX_HEADERS]
@ MG_ERROR_DATA_CODE_MISSING_OPTION
@ MG_ERROR_DATA_CODE_TLS_SERVER_CERT_ERROR
void(* exit_context)(const struct mg_context *ctx)
@ MG_CONFIG_TYPE_STRING_MULTILINE
const char * query_string
CIVETWEB_API int mg_get_context_info(const struct mg_context *ctx, char *buffer, int buflen)
CIVETWEB_API int mg_modify_passwords_file(const char *passwords_file_name, const char *realm, const char *user, const char *password)
@ MG_ERROR_DATA_CODE_OUT_OF_MEMORY
CIVETWEB_API 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(* init_ssl)(void *ssl_ctx, void *user_data)
CIVETWEB_API int mg_response_header_add(struct mg_connection *conn, const char *header, const char *value, int value_len)
void(* exit_thread)(const struct mg_context *ctx, int thread_type, void *thread_pointer)
CIVETWEB_API int CIVETWEB_API int mg_send_chunk(struct mg_connection *conn, const char *chunk, unsigned int chunk_len)
@ MG_FORM_FIELD_HANDLE_NEXT
CIVETWEB_API int mg_read(struct mg_connection *, void *buf, size_t len)
CIVETWEB_API int mg_start_domain2(struct mg_context *ctx, const char **configuration_options, struct mg_error_data *error)
void(* end_request)(const struct mg_connection *, int reply_status_code)
@ MG_ERROR_DATA_CODE_SCRIPT_ERROR
CIVETWEB_API int mg_modify_passwords_file_ha1(const char *passwords_file_name, const char *realm, const char *user, const char *ha1)
#define PRINTF_ARGS(x, y)
CIVETWEB_API void mg_lock_context(struct mg_context *ctx)
CIVETWEB_API 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)
const CIVETWEB_API char * mg_get_header(const struct mg_connection *, const char *name)
const char * acceptedWebSocketSubprotocol
const char ** configuration_options
CIVETWEB_API int mg_get_var(const char *data, size_t data_len, const char *var_name, char *dst, size_t dst_len)
@ MG_ERROR_DATA_CODE_INIT_TLS_FAILED
@ MG_ERROR_DATA_CODE_TLS_CLIENT_CERT_ERROR
CIVETWEB_API int mg_url_decode(const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded)
CIVETWEB_API void * mg_get_user_context_data(const struct mg_connection *conn)
constexpr const char * size
CIVETWEB_API int mg_get_response(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int timeout)
CIVETWEB_API 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)
CIVETWEB_API int mg_start_thread(mg_thread_func_t f, void *p)
@ MG_CONFIG_TYPE_YES_NO_OPTIONAL
CIVETWEB_API int mg_write(struct mg_connection *, const void *buf, size_t len)
CIVETWEB_API int mg_get_request_link(const struct mg_connection *conn, char *buf, size_t buflen)
const char * default_value
CIVETWEB_API int mg_send_http_redirect(struct mg_connection *conn, const char *target_url, int redirect_code)
CIVETWEB_API void * mg_get_user_data(const struct mg_context *ctx)
void(* mg_websocket_close_handler)(const struct mg_connection *, void *)
void(* exit_lua)(const struct mg_connection *conn, void *lua_context, unsigned context_flags)
@ MG_FORM_FIELD_STORAGE_GET
CIVETWEB_API void mg_send_file(struct mg_connection *conn, const char *path)
CIVETWEB_API struct mg_context * mg_get_context(const struct mg_connection *conn)
CIVETWEB_API void mg_unlock_connection(struct mg_connection *conn)
CIVETWEB_API int mg_printf(struct mg_connection *, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(2
const CIVETWEB_API char * mg_version(void)
int(* init_ssl_domain)(const char *server_domain, void *ssl_ctx, void *user_data)
#define PRINTF_FORMAT_STRING(s)
const CIVETWEB_API char * mg_get_builtin_mime_type(const char *file_name)
@ MG_ERROR_DATA_CODE_INIT_ACL_FAILED
int(* log_access)(const struct mg_connection *, const char *message)
void(* connection_close)(const struct mg_connection *)
CIVETWEB_API int mg_send_digest_access_authentication_request(struct mg_connection *conn, const char *realm)
CIVETWEB_API struct mg_context * mg_start2(struct mg_init_data *init, struct mg_error_data *error)
CIVETWEB_API 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)
CIVETWEB_API unsigned mg_init_library(unsigned features)
CIVETWEB_API int mg_send_file_body(struct mg_connection *conn, const char *path)
CIVETWEB_API int mg_base64_decode(const char *src, size_t src_len, unsigned char *dst, size_t *dst_len)
#define MG_MATCH_CONTEXT_MAX_MATCHES
@ MG_FORM_FIELD_HANDLE_ABORT
const struct mg_callbacks * callbacks
const CIVETWEB_API char * mg_get_option(const struct mg_context *ctx, const char *name)
CIVETWEB_API int mg_get_var2(const char *data, size_t data_len, const char *var_name, char *dst, size_t dst_len, size_t occurrence)
int(* log_message)(const struct mg_connection *, const char *message)
@ MG_WEBSOCKET_OPCODE_CONTINUATION
void(* init_context)(const struct mg_context *ctx)
const char * http_version
@ MG_WEBSOCKET_OPCODE_PONG
int(* mg_request_handler)(struct mg_connection *conn, void *cbdata)
CIVETWEB_API void * mg_get_thread_pointer(const struct mg_connection *conn)
CIVETWEB_API long long mg_store_body(struct mg_connection *conn, const char *path)
@ MG_ERROR_DATA_CODE_DUPLICATE_DOMAIN
int(* mg_authorization_handler)(struct mg_connection *conn, void *cbdata)
CIVETWEB_API void mg_send_mime_file2(struct mg_connection *conn, const char *path, const char *mime_type, const char *additional_headers)
CIVETWEB_API void mg_set_user_connection_data(const struct mg_connection *conn, void *data)
CIVETWEB_API unsigned mg_check_feature(unsigned feature)
struct mg_match_element match[MG_MATCH_CONTEXT_MAX_MATCHES]
CIVETWEB_API int mg_get_system_info(char *buffer, int buflen)
CIVETWEB_API int mg_split_form_urlencoded(char *data, struct mg_header *form_fields, unsigned num_form_fields)
int(* mg_websocket_connect_handler)(const struct mg_connection *, void *)
CIVETWEB_API void mg_cry(const struct mg_connection *conn, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(2
@ MG_ERROR_DATA_CODE_INVALID_OPTION
CIVETWEB_API void * mg_get_user_connection_data(const struct mg_connection *conn)
CIVETWEB_API int mg_websocket_write(struct mg_connection *conn, int opcode, const char *data, size_t data_len)
void(* init_lua)(const struct mg_connection *conn, void *lua_context, unsigned context_flags)
void(* connection_closed)(const struct mg_connection *)
CIVETWEB_API int mg_response_header_send(struct mg_connection *conn)
@ MG_ERROR_DATA_CODE_INVALID_PASS_FILE
@ MG_CONFIG_TYPE_EXT_PATTERN