mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Remove old docs, rename docs_new to docs
It would be probably good idea to also remove tools/docgen.py and asciidoc.mk, but asciidoc.mk is still mentioned under `cloud/doc`, which may contain some useful info which we'll need at least to review before removing. PUBLISHED_FROM=faf454d4c52a2f07ea8ac084cf0bd11a0c9c9b3b
This commit is contained in:
1 parent
f443c64341
commit
23122b327c
182 files changed
+3592
-263
No files matched your search
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "MG_MK_STR()"
|
||||
decl_name: "MG_MK_STR"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
#define MG_MK_STR(str_literal);
|
||||
---
|
||||
|
||||
Macro for initializing mg_str.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "Utilities"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "util.h"
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "intro.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_skip.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_ncasecmp.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_casecmp.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_vcmp.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_vcasecmp.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_base64_decode.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_base64_encode.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_stat.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_fopen.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_open.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_start_thread.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_conn_addr_to_str.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_sock_to_str.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_sock_addr_to_str.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_hexdump.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_hexdump_connection.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_avprintf.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_is_big_endian.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_next_comma_list_entry.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_match_prefix.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_mk_str.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "MG_MK_STR.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "mg_avprintf()"
|
||||
decl_name: "mg_avprintf"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap);
|
||||
---
|
||||
|
||||
Print message to buffer. If buffer is large enough to hold the message,
|
||||
return buffer. If buffer is to small, allocate large enough buffer on heap,
|
||||
and return allocated buffer.
|
||||
This is a supposed use case:
|
||||
|
||||
char buf[5], *p = buf;
|
||||
p = mg_avprintf(&p, sizeof(buf), "%s", "hi there");
|
||||
use_p_somehow(p);
|
||||
if (p != buf) {
|
||||
free(p);
|
||||
}
|
||||
|
||||
The purpose of this is to avoid malloc-ing if generated strings are small.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "mg_base64_decode()"
|
||||
decl_name: "mg_base64_decode"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_base64_decode(const unsigned char *s, int len, char *dst);
|
||||
---
|
||||
|
||||
Decode base64-encoded string `s`, `len` into the destination `dst`.
|
||||
Destination has to have enough space to hold decoded buffer.
|
||||
Decoding stops either when all string has been decoded, or invalid
|
||||
character appeared.
|
||||
Destination is '\0'-terminated.
|
||||
Return number of decoded characters. On success, that should be equal to
|
||||
`len`. On error (invalid character) the return value is smaller then `len`.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "mg_base64_encode()"
|
||||
decl_name: "mg_base64_encode"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_base64_encode(const unsigned char *src, int src_len, char *dst);
|
||||
---
|
||||
|
||||
Base64-encode chunk of memory `src`, `src_len` into the destination `dst`.
|
||||
Destination has to have enough space to hold encoded buffer.
|
||||
Destination is '\0'-terminated.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_casecmp()"
|
||||
decl_name: "mg_casecmp"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_casecmp(const char *s1, const char *s2);
|
||||
---
|
||||
|
||||
Cross-platform version of `strcasecmp()`.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "mg_conn_addr_to_str()"
|
||||
decl_name: "mg_conn_addr_to_str"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_conn_addr_to_str(struct mg_connection *nc, char *buf, size_t len,
|
||||
int flags);
|
||||
---
|
||||
|
||||
Convert connection's local or remote address into string.
|
||||
|
||||
The `flags` parameter is a bit mask that controls the behavior,
|
||||
see `MG_SOCK_STRINGIFY_*` definitions.
|
||||
|
||||
- MG_SOCK_STRINGIFY_IP - print IP address
|
||||
- MG_SOCK_STRINGIFY_PORT - print port number
|
||||
- MG_SOCK_STRINGIFY_REMOTE - print remote peer's IP/port, not local address
|
||||
|
||||
If both port number and IP address are printed, they are separated by `:`.
|
||||
If compiled with `-DMG_ENABLE_IPV6`, IPv6 addresses are supported.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "mg_fopen()"
|
||||
decl_name: "mg_fopen"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
FILE *mg_fopen(const char *path, const char *mode);
|
||||
---
|
||||
|
||||
Open the given file and return a file stream.
|
||||
|
||||
`path` and `mode` should be UTF8 encoded.
|
||||
|
||||
Return value is the same as for the `fopen()` call.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "mg_hexdump()"
|
||||
decl_name: "mg_hexdump"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_hexdump(const void *buf, int len, char *dst, int dst_len);
|
||||
---
|
||||
|
||||
Generates human-readable hexdump of memory chunk.
|
||||
|
||||
Takes a memory buffer `buf` of length `len` and creates a hex dump of that
|
||||
buffer in `dst`. Generated output is a-la hexdump(1).
|
||||
Return length of generated string, excluding terminating `\0`. If returned
|
||||
length is bigger than `dst_len`, overflow bytes are discarded.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "mg_hexdump_connection()"
|
||||
decl_name: "mg_hexdump_connection"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_hexdump_connection(struct mg_connection *nc, const char *path,
|
||||
const void *buf, int num_bytes, int ev);
|
||||
---
|
||||
|
||||
Generates human-readable hexdump of the data sent or received by connection.
|
||||
`path` is a file name where hexdump should be written. `num_bytes` is
|
||||
a number of bytes sent/received. `ev` is one of the `MG_*` events sent to
|
||||
an event handler. This function is supposed to be called from the
|
||||
event handler.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_is_big_endian()"
|
||||
decl_name: "mg_is_big_endian"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_is_big_endian(void);
|
||||
---
|
||||
|
||||
Return true if target platform is big endian.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "mg_match_prefix()"
|
||||
decl_name: "mg_match_prefix"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_match_prefix(const char *pattern, int pattern_len, const char *str);
|
||||
---
|
||||
|
||||
Match 0-terminated string (mg_match_prefix) or string with given length
|
||||
mg_match_prefix_n against a glob pattern.
|
||||
Match is case-insensitive. Return number of bytes matched, or -1 if no match.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_mk_str()"
|
||||
decl_name: "mg_mk_str"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
struct mg_str mg_mk_str(const char *s);
|
||||
---
|
||||
|
||||
A helper function for creating mg_str struct from plain C string.
|
||||
`NULL` is allowed and becomes `{NULL, 0}`.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_ncasecmp()"
|
||||
decl_name: "mg_ncasecmp"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_ncasecmp(const char *s1, const char *s2, size_t len);
|
||||
---
|
||||
|
||||
Cross-platform version of `strncasecmp()`.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "mg_next_comma_list_entry()"
|
||||
decl_name: "mg_next_comma_list_entry"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
const char *mg_next_comma_list_entry(const char *list, struct mg_str *val,
|
||||
struct mg_str *eq_val);
|
||||
---
|
||||
|
||||
A helper function for traversing a comma separated list of values.
|
||||
It returns a list pointer shifted to the next value, or NULL if the end
|
||||
of the list found.
|
||||
Value is stored in val vector. If value has form "x=y", then eq_val
|
||||
vector is initialized to point to the "y" part, and val vector length
|
||||
is adjusted to point only to "x".
|
||||
If list is just a comma separated list of entries, like "aa,bb,cc" then
|
||||
`eq_val` will contain zero-length string.
|
||||
|
||||
The purpose of this function is to parse comma separated string without
|
||||
any copying/memory allocation.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "mg_open()"
|
||||
decl_name: "mg_open"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_open(const char *path, int flag, int mode);
|
||||
---
|
||||
|
||||
Open the given file and return a file stream.
|
||||
|
||||
`path` should be UTF8 encoded.
|
||||
|
||||
Return value is the same as for the `open()` syscall.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "mg_skip()"
|
||||
decl_name: "mg_skip"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
const char *mg_skip(const char *s, const char *end_string,
|
||||
const char *delimiters, struct mg_str *v);
|
||||
---
|
||||
|
||||
Fetch substring from input string `s`, `end` into `v`.
|
||||
Skips initial delimiter characters. Records first non-delimiter character
|
||||
as the beginning of substring `v`. Then scans the rest of the string
|
||||
until a delimiter character or end-of-string is found.
|
||||
`delimiters` is a 0-terminated string containing delimiter characters.
|
||||
Either one of `delimiters` or `end_string` terminates the search.
|
||||
Return an `s` pointer, advanced forward where parsing stopped.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "mg_sock_addr_to_str()"
|
||||
decl_name: "mg_sock_addr_to_str"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_sock_addr_to_str(const union socket_address *sa, char *buf, size_t len,
|
||||
int flags);
|
||||
---
|
||||
|
||||
Convert socket's address into string.
|
||||
|
||||
`flags` is MG_SOCK_STRINGIFY_IP and/or MG_SOCK_STRINGIFY_PORT.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_sock_to_str()"
|
||||
decl_name: "mg_sock_to_str"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_sock_to_str(sock_t sock, char *buf, size_t len, int flags);
|
||||
---
|
||||
|
||||
Legacy interface.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "mg_start_thread()"
|
||||
decl_name: "mg_start_thread"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void *mg_start_thread(void *(*thread_func);
|
||||
---
|
||||
|
||||
Start a new detached thread.
|
||||
Arguments and semantic is the same as pthead's `pthread_create()`.
|
||||
`thread_func` is a thread function, `thread_func_param` is a parameter
|
||||
that is passed to the thread function.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "mg_stat()"
|
||||
decl_name: "mg_stat"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_stat(const char *path, cs_stat_t *st);
|
||||
---
|
||||
|
||||
Perform a 64-bit `stat()` call against given file.
|
||||
|
||||
`path` should be UTF8 encoded.
|
||||
|
||||
Return value is the same as for `stat()` syscall.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_vcasecmp()"
|
||||
decl_name: "mg_vcasecmp"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_vcasecmp(const struct mg_str *str2, const char *str1);
|
||||
---
|
||||
|
||||
Cross-platform version of `strncasecmp()` where first string is
|
||||
specified by `struct mg_str`.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_vcmp()"
|
||||
decl_name: "mg_vcmp"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_vcmp(const struct mg_str *str2, const char *str1);
|
||||
---
|
||||
|
||||
Cross-platform version of `strcmp()` where where first string is
|
||||
specified by `struct mg_str`.
|
||||
|
||||
Reference in new issue
Block a user