Fix mongoose docs generation

PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
This commit is contained in:
Dmitry Frank committed 2018-02-03 01:20:48 +02:00
1 parent ab000c684a
commit 3eb4eb8074
166 files changed
+3125

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
---
title: "API reference"
symbol_kind: "intro"
decl_name: "mg_resolv.h"
items:
- { name: mg_resolve_async.md }
- { name: mg_resolve_async_opt.md }
- { name: mg_resolve_from_hosts_file.md }
- { name: mg_set_nameserver.md }
- { name: struct_mg_resolve_async_opts.md }
---
@@ -0,0 +1,11 @@
---
title: "mg_resolve_async()"
decl_name: "mg_resolve_async"
symbol_kind: "func"
signature: |
int mg_resolve_async(struct mg_mgr *mgr, const char *name, int query,
mg_resolve_callback_t cb, void *data);
---
See `mg_resolve_async_opt()`
@@ -0,0 +1,30 @@
---
title: "mg_resolve_async_opt()"
decl_name: "mg_resolve_async_opt"
symbol_kind: "func"
signature: |
int mg_resolve_async_opt(struct mg_mgr *mgr, const char *name, int query,
mg_resolve_callback_t cb, void *data,
struct mg_resolve_async_opts opts);
---
Resolved a DNS name asynchronously.
Upon successful resolution, the user callback will be invoked
with the full DNS response message and a pointer to the user's
context `data`.
In case of timeout while performing the resolution the callback
will receive a NULL `msg`.
The DNS answers can be extracted with `mg_next_record` and
`mg_dns_parse_record_data`:
[source,c]
----
struct in_addr ina;
struct mg_dns_resource_record *rr = mg_next_record(msg, MG_DNS_A_RECORD,
NULL);
mg_dns_parse_record_data(msg, rr, &ina, sizeof(ina));
----
@@ -0,0 +1,12 @@
---
title: "mg_resolve_from_hosts_file()"
decl_name: "mg_resolve_from_hosts_file"
symbol_kind: "func"
signature: |
int mg_resolve_from_hosts_file(const char *host, union socket_address *usa);
---
Resolve a name from `/etc/hosts`.
Returns 0 on success, -1 on failure.
@@ -0,0 +1,10 @@
---
title: "mg_set_nameserver()"
decl_name: "mg_set_nameserver"
symbol_kind: "func"
signature: |
void mg_set_nameserver(struct mg_mgr *mgr, const char *nameserver);
---
Set default DNS server
@@ -0,0 +1,17 @@
---
title: "struct mg_resolve_async_opts"
decl_name: "struct mg_resolve_async_opts"
symbol_kind: "struct"
signature: |
struct mg_resolve_async_opts {
const char *nameserver;
int max_retries; /* defaults to 2 if zero */
int timeout; /* in seconds; defaults to 5 if zero */
int accept_literal; /* pseudo-resolve literal ipv4 and ipv6 addrs */
int only_literal; /* only resolves literal addrs; sync cb invocation */
struct mg_connection **dns_conn; /* return DNS connection */
};
---
Options for `mg_resolve_async_opt`.