ROOT  6.06/09
Reference Guide
Classes | Macros | Typedefs | Enumerations | Functions
civetweb.h File Reference
#include <stdio.h>
#include <stddef.h>
+ Include dependency graph for civetweb.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mg_request_info
 
struct  mg_request_info::mg_header
 
struct  mg_callbacks
 

Macros

#define CIVETWEB_VERSION   "1.6"
 
#define PRINTF_FORMAT_STRING(s)   s
 
#define PRINTF_ARGS(x, y)
 

Typedefs

typedef int(* mg_request_handler) (struct mg_connection *conn, void *cbdata)
 
typedef void *(* mg_thread_func_t) (void *)
 

Enumerations

enum  {
  WEBSOCKET_OPCODE_CONTINUATION = 0x0, WEBSOCKET_OPCODE_TEXT = 0x1, WEBSOCKET_OPCODE_BINARY = 0x2, WEBSOCKET_OPCODE_CONNECTION_CLOSE = 0x8,
  WEBSOCKET_OPCODE_PING = 0x9, WEBSOCKET_OPCODE_PONG = 0xa
}
 

Functions

struct mg_context * mg_start (const struct mg_callbacks *callbacks, void *user_data, const char **configuration_options)
 
void mg_stop (struct mg_context *)
 
void mg_set_request_handler (struct mg_context *ctx, const char *uri, mg_request_handler handler, void *cbdata)
 
const char * mg_get_option (const struct mg_context *ctx, const char *name)
 
const char ** mg_get_valid_option_names (void)
 
size_t mg_get_ports (const struct mg_context *ctx, size_t size, int *ports, int *ssl)
 
int mg_modify_passwords_file (const char *passwords_file_name, const char *domain, const char *user, const char *password)
 
struct mg_request_infomg_get_request_info (struct mg_connection *)
 
const struct mg_context * mg_get_context (const struct mg_connection *conn)
 
voidmg_get_user_data (const struct mg_context *ctx)
 
int mg_write (struct mg_connection *, const void *buf, size_t len)
 
int mg_websocket_write (struct mg_connection *conn, int opcode, const char *data, size_t data_len)
 
void mg_lock (struct mg_connection *conn)
 
void mg_unlock (struct mg_connection *conn)
 
int mg_printf (struct mg_connection *, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(2
 
int void mg_send_file (struct mg_connection *conn, const char *path)
 
int mg_read (struct mg_connection *, void *buf, size_t len)
 
const char * mg_get_header (const struct mg_connection *, const char *name)
 
int mg_get_var (const char *data, size_t data_len, const char *var_name, char *dst, size_t dst_len)
 
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 mg_get_cookie (const char *cookie, const char *var_name, char *buf, size_t buf_len)
 
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
 
struct mg_connection void mg_close_connection (struct mg_connection *conn)
 
int mg_upload (struct mg_connection *conn, const char *destination_dir)
 
int mg_start_thread (mg_thread_func_t f, void *p)
 
const char * mg_get_builtin_mime_type (const char *file_name)
 
const char * mg_version (void)
 
int mg_url_decode (const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded)
 
int mg_url_encode (const char *src, char *dst, size_t dst_len)
 
char * mg_md5 (char buf[33],...)
 
void mg_cry (struct mg_connection *conn, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(2
 
void int mg_strncasecmp (const char *s1, const char *s2, size_t len)
 

Macro Definition Documentation

#define CIVETWEB_VERSION   "1.6"

Definition at line 26 of file civetweb.h.

Referenced by mg_version().

#define PRINTF_ARGS (   x,
  y 
)

Definition at line 322 of file civetweb.h.

#define PRINTF_FORMAT_STRING (   s)    s

Definition at line 316 of file civetweb.h.

Typedef Documentation

typedef int(* mg_request_handler) (struct mg_connection *conn, void *cbdata)

Definition at line 191 of file civetweb.h.

typedef void*(* mg_thread_func_t) (void *)

Definition at line 450 of file civetweb.h.

Enumeration Type Documentation

anonymous enum
Enumerator
WEBSOCKET_OPCODE_CONTINUATION 
WEBSOCKET_OPCODE_TEXT 
WEBSOCKET_OPCODE_BINARY 
WEBSOCKET_OPCODE_CONNECTION_CLOSE 
WEBSOCKET_OPCODE_PING 
WEBSOCKET_OPCODE_PONG 

Definition at line 296 of file civetweb.h.

Function Documentation

struct mg_connection void mg_close_connection ( struct mg_connection *  conn)

Definition at line 5805 of file civetweb.c.

Referenced by mg_download().

void mg_cry ( mg_connection *  conn,
PRINTF_FORMAT_STRING(const char *fmt)  ,
  ... 
)
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)  ,
  ... 
)
const char* mg_get_builtin_mime_type ( const char *  file_name)

Definition at line 2556 of file civetweb.c.

Referenced by get_mime_type().

const struct mg_context* mg_get_context ( const struct mg_connection *  conn)

Definition at line 696 of file civetweb.c.

Referenced by log_message_handler().

int mg_get_cookie ( const char *  cookie,
const char *  var_name,
char *  buf,
size_t  buf_len 
)

Definition at line 2244 of file civetweb.c.

const char* mg_get_header ( const struct mg_connection *  ,
const char *  name 
)
const char* mg_get_option ( const struct mg_context *  ctx,
const char *  name 
)

Definition at line 743 of file civetweb.c.

size_t mg_get_ports ( const struct mg_context *  ctx,
size_t  size,
int *  ports,
int *  ssl 
)

Definition at line 755 of file civetweb.c.

struct mg_request_info* mg_get_request_info ( struct mg_connection *  )

Definition at line 851 of file civetweb.c.

Referenced by begin_request_handler(), and use_request_handler().

void* mg_get_user_data ( const struct mg_context *  ctx)

Definition at line 701 of file civetweb.c.

Referenced by log_message_handler().

const char** mg_get_valid_option_names ( void  )

Definition at line 673 of file civetweb.c.

int mg_get_var ( const char *  data,
size_t  data_len,
const char *  var_name,
char *  dst,
size_t  dst_len 
)

Definition at line 2189 of file civetweb.c.

int mg_get_var2 ( const char *  data,
size_t  data_len,
const char *  var_name,
char *  dst,
size_t  dst_len,
size_t  occurrence 
)

Definition at line 2195 of file civetweb.c.

Referenced by mg_get_var().

void mg_lock ( struct mg_connection *  conn)

Definition at line 4366 of file civetweb.c.

Referenced by close_connection().

char* mg_md5 ( char  buf[33],
  ... 
)

Definition at line 2615 of file civetweb.c.

Referenced by check_password(), and mg_modify_passwords_file().

int mg_modify_passwords_file ( const char *  passwords_file_name,
const char *  domain,
const char *  user,
const char *  password 
)

Definition at line 2900 of file civetweb.c.

int mg_printf ( mg_connection *  ,
PRINTF_FORMAT_STRING(const char *fmt)  ,
  ... 
)
int mg_read ( struct mg_connection *  ,
void buf,
size_t  len 
)

Definition at line 1996 of file civetweb.c.

Referenced by begin_request_handler(), and mg_upload().

int void mg_send_file ( struct mg_connection *  conn,
const char *  path 
)

Definition at line 3435 of file civetweb.c.

Referenced by begin_request_handler().

void mg_set_request_handler ( struct mg_context *  ctx,
const char *  uri,
mg_request_handler  handler,
void cbdata 
)

Definition at line 5092 of file civetweb.c.

struct mg_context* mg_start ( const struct mg_callbacks callbacks,
void user_data,
const char **  configuration_options 
)

Definition at line 6357 of file civetweb.c.

Referenced by TCivetweb::Create().

int mg_start_thread ( mg_thread_func_t  f,
void p 
)

Definition at line 1797 of file civetweb.c.

void mg_stop ( struct mg_context *  )

Definition at line 6341 of file civetweb.c.

Referenced by TCivetweb::~TCivetweb().

void int mg_strncasecmp ( const char *  s1,
const char *  s2,
size_t  len 
)

Definition at line 869 of file civetweb.c.

Referenced by get_mime_type(), mg_get_var2(), mg_strcasestr(), and parse_auth_header().

void mg_unlock ( struct mg_connection *  conn)

Definition at line 4371 of file civetweb.c.

Referenced by close_connection().

int mg_upload ( struct mg_connection *  conn,
const char *  destination_dir 
)

Definition at line 4928 of file civetweb.c.

int mg_url_decode ( const char *  src,
int  src_len,
char *  dst,
int  dst_len,
int  is_form_url_encoded 
)

Definition at line 2163 of file civetweb.c.

Referenced by handle_request(), and mg_get_var2().

int mg_url_encode ( const char *  src,
char *  dst,
size_t  dst_len 
)

Definition at line 2997 of file civetweb.c.

Referenced by print_dav_dir_entry(), and print_dir_entry().

const char* mg_version ( void  )

Definition at line 846 of file civetweb.c.

Referenced by prepare_cgi_environment().

int mg_websocket_write ( struct mg_connection *  conn,
int  opcode,
const char *  data,
size_t  data_len 
)
int mg_write ( struct mg_connection *  ,
const void buf,
size_t  len 
)