mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Apply Mongoose docs edits by Ev
PUBLISHED_FROM=5cd78790a03580aa23dd3d2d8b825ad449083cc2
This commit is contained in:
1 parent
4f210cd8eb
commit
849ec1684a
94 files changed
+509
-491
No files matched your search
@@ -6,9 +6,9 @@ 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.
|
||||
Prints message to the buffer. If the buffer is large enough to hold the
|
||||
message, it returns buffer. If buffer is to small, it allocates a large
|
||||
enough buffer on heap and returns allocated buffer.
|
||||
This is a supposed use case:
|
||||
|
||||
char buf[5], *p = buf;
|
||||
|
||||
@@ -6,11 +6,12 @@ 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
|
||||
Decodes base64-encoded string `s`, `len` into the destination `dst`.
|
||||
The destination has to have enough space to hold the decoded buffer.
|
||||
Decoding stops either when all strings have been decoded or invalid an
|
||||
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`.
|
||||
Returns the number of decoded characters. On success, that should be equal
|
||||
to `len`. On error (invalid character) the return value is smaller then
|
||||
`len`.
|
||||
|
||||
@@ -7,9 +7,9 @@ signature: |
|
||||
int flags);
|
||||
---
|
||||
|
||||
Convert connection's local or remote address into string.
|
||||
Converts a connection's local or remote address into string.
|
||||
|
||||
The `flags` parameter is a bit mask that controls the behavior,
|
||||
The `flags` parameter is a bit mask that controls the behaviour,
|
||||
see `MG_SOCK_STRINGIFY_*` definitions.
|
||||
|
||||
- MG_SOCK_STRINGIFY_IP - print IP address
|
||||
|
||||
@@ -6,7 +6,7 @@ signature: |
|
||||
FILE *mg_fopen(const char *path, const char *mode);
|
||||
---
|
||||
|
||||
Open the given file and return a file stream.
|
||||
Opens the given file and returns a file stream.
|
||||
|
||||
`path` and `mode` should be UTF8 encoded.
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ signature: |
|
||||
int mg_hexdump(const void *buf, int len, char *dst, int dst_len);
|
||||
---
|
||||
|
||||
Generates human-readable hexdump of memory chunk.
|
||||
Generates a 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.
|
||||
buffer in `dst`. The generated output is a-la hexdump(1).
|
||||
Returns the length of generated string, excluding terminating `\0`. If
|
||||
returned length is bigger than `dst_len`, the overflow bytes are discarded.
|
||||
|
||||
@@ -7,9 +7,9 @@ signature: |
|
||||
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.
|
||||
Generates human-readable hexdump of the data sent or received by the
|
||||
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.
|
||||
|
||||
@@ -6,5 +6,5 @@ signature: |
|
||||
int mg_is_big_endian(void);
|
||||
---
|
||||
|
||||
Return true if target platform is big endian.
|
||||
Returns true if target platform is big endian.
|
||||
|
||||
@@ -6,7 +6,9 @@ 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
|
||||
Matches 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.
|
||||
|
||||
Match is case-insensitive. Returns number of bytes matched, or -1 if no
|
||||
match.
|
||||
|
||||
@@ -8,12 +8,12 @@ signature: |
|
||||
---
|
||||
|
||||
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
|
||||
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
|
||||
The value is stored in a val vector. If the value has a form "x=y", then
|
||||
eq_val vector is initialised 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
|
||||
If the 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
|
||||
|
||||
@@ -6,7 +6,7 @@ signature: |
|
||||
int mg_open(const char *path, int flag, int mode);
|
||||
---
|
||||
|
||||
Open the given file and return a file stream.
|
||||
Opens the given file and returns a file stream.
|
||||
|
||||
`path` should be UTF8 encoded.
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ signature: |
|
||||
const char *delimiters, struct mg_str *v);
|
||||
---
|
||||
|
||||
Fetch substring from input string `s`, `end` into `v`.
|
||||
Fetches 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
|
||||
at 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.
|
||||
Returns an `s` pointer, advanced forward where parsing has stopped.
|
||||
|
||||
@@ -7,7 +7,7 @@ signature: |
|
||||
int flags);
|
||||
---
|
||||
|
||||
Convert socket's address into string.
|
||||
Convert the socket's address into string.
|
||||
|
||||
`flags` is MG_SOCK_STRINGIFY_IP and/or MG_SOCK_STRINGIFY_PORT.
|
||||
|
||||
@@ -6,8 +6,8 @@ signature: |
|
||||
void *mg_start_thread(void *(*thread_func);
|
||||
---
|
||||
|
||||
Start a new detached thread.
|
||||
Arguments and semantic is the same as pthead's `pthread_create()`.
|
||||
Starts a new detached thread.
|
||||
Arguments and semantics are 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.
|
||||
|
||||
@@ -6,7 +6,7 @@ signature: |
|
||||
int mg_stat(const char *path, cs_stat_t *st);
|
||||
---
|
||||
|
||||
Perform a 64-bit `stat()` call against given file.
|
||||
Performs a 64-bit `stat()` call against a given file.
|
||||
|
||||
`path` should be UTF8 encoded.
|
||||
|
||||
|
||||
Reference in new issue
Block a user