Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
e406de7e
Commit
e406de7e
authored
Jul 25, 2016
by
Alexander Alashkin
Committed by
Cesanta Bot
Jul 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra error message
PUBLISHED_FROM=8b7fcfc1bc32ff9ff38e2904ddb730c83bf9fae4
parent
53ed8502
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
87 additions
and
87 deletions
+87
-87
mg_coap_add_option.md
docs/c-api/coap.h/mg_coap_add_option.md
+1
-1
mg_coap_free_options.md
docs/c-api/coap.h/mg_coap_free_options.md
+2
-2
mg_coap_parse.md
docs/c-api/coap.h/mg_coap_parse.md
+4
-4
mg_coap_send_ack.md
docs/c-api/coap.h/mg_coap_send_ack.md
+2
-2
mg_coap_send_message.md
docs/c-api/coap.h/mg_coap_send_message.md
+3
-3
mg_set_protocol_coap.md
docs/c-api/coap.h/mg_set_protocol_coap.md
+1
-1
mg_dns_create_reply.md
docs/c-api/dns-server.h/mg_dns_create_reply.md
+4
-4
mg_dns_reply_record.md
docs/c-api/dns-server.h/mg_dns_reply_record.md
+3
-3
mg_dns_send_reply.md
docs/c-api/dns-server.h/mg_dns_send_reply.md
+2
-2
mg_dns_copy_questions.md
docs/c-api/dns.h/mg_dns_copy_questions.md
+2
-2
mg_dns_encode_record.md
docs/c-api/dns.h/mg_dns_encode_record.md
+3
-3
mg_dns_insert_header.md
docs/c-api/dns.h/mg_dns_insert_header.md
+2
-2
mg_dns_parse_record_data.md
docs/c-api/dns.h/mg_dns_parse_record_data.md
+1
-1
mg_dns_uncompress_name.md
docs/c-api/dns.h/mg_dns_uncompress_name.md
+5
-5
mg_send_dns_query.md
docs/c-api/dns.h/mg_send_dns_query.md
+1
-1
mg_set_protocol_dns.md
docs/c-api/dns.h/mg_set_protocol_dns.md
+4
-4
mg_mqtt_broker.md
docs/c-api/mqtt-broker.h/mg_mqtt_broker.md
+2
-2
mg_mqtt_broker_init.md
docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md
+1
-1
mg_mqtt_next.md
docs/c-api/mqtt-broker.h/mg_mqtt_next.md
+1
-1
mg_mqtt_connack.md
docs/c-api/mqtt.h/mg_mqtt_connack.md
+1
-1
mg_mqtt_disconnect.md
docs/c-api/mqtt.h/mg_mqtt_disconnect.md
+1
-1
mg_mqtt_next_subscribe_topic.md
docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md
+3
-3
mg_mqtt_ping.md
docs/c-api/mqtt.h/mg_mqtt_ping.md
+1
-1
mg_mqtt_pong.md
docs/c-api/mqtt.h/mg_mqtt_pong.md
+1
-1
mg_mqtt_puback.md
docs/c-api/mqtt.h/mg_mqtt_puback.md
+1
-1
mg_mqtt_pubcomp.md
docs/c-api/mqtt.h/mg_mqtt_pubcomp.md
+1
-1
mg_mqtt_publish.md
docs/c-api/mqtt.h/mg_mqtt_publish.md
+1
-1
mg_mqtt_pubrec.md
docs/c-api/mqtt.h/mg_mqtt_pubrec.md
+1
-1
mg_mqtt_pubrel.md
docs/c-api/mqtt.h/mg_mqtt_pubrel.md
+1
-1
mg_mqtt_suback.md
docs/c-api/mqtt.h/mg_mqtt_suback.md
+1
-1
mg_mqtt_subscribe.md
docs/c-api/mqtt.h/mg_mqtt_subscribe.md
+1
-1
mg_mqtt_unsuback.md
docs/c-api/mqtt.h/mg_mqtt_unsuback.md
+1
-1
mg_mqtt_unsubscribe.md
docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md
+1
-1
mg_send_mqtt_handshake.md
docs/c-api/mqtt.h/mg_send_mqtt_handshake.md
+1
-1
mg_send_mqtt_handshake_opt.md
docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md
+1
-1
mg_set_protocol_mqtt.md
docs/c-api/mqtt.h/mg_set_protocol_mqtt.md
+1
-1
mg_avprintf.md
docs/c-api/util.h/mg_avprintf.md
+3
-3
mg_base64_decode.md
docs/c-api/util.h/mg_base64_decode.md
+4
-4
mg_conn_addr_to_str.md
docs/c-api/util.h/mg_conn_addr_to_str.md
+2
-2
mg_fopen.md
docs/c-api/util.h/mg_fopen.md
+1
-1
mg_hexdump.md
docs/c-api/util.h/mg_hexdump.md
+4
-4
mg_hexdump_connection.md
docs/c-api/util.h/mg_hexdump_connection.md
+1
-1
mg_is_big_endian.md
docs/c-api/util.h/mg_is_big_endian.md
+1
-1
mg_open.md
docs/c-api/util.h/mg_open.md
+1
-1
mg_skip.md
docs/c-api/util.h/mg_skip.md
+3
-3
mg_sock_addr_to_str.md
docs/c-api/util.h/mg_sock_addr_to_str.md
+1
-1
mg_start_thread.md
docs/c-api/util.h/mg_start_thread.md
+2
-2
mg_stat.md
docs/c-api/util.h/mg_stat.md
+1
-1
No files found.
docs/c-api/coap.h/mg_coap_add_option.md
View file @
e406de7e
...
@@ -8,6 +8,6 @@ signature: |
...
@@ -8,6 +8,6 @@ signature: |
size_t len);
size_t len);
---
---
Add
s a
new option to mg_coap_message structure.
Add new option to mg_coap_message structure.
Returns pointer to the newly created option.
Returns pointer to the newly created option.
docs/c-api/coap.h/mg_coap_free_options.md
View file @
e406de7e
...
@@ -6,6 +6,6 @@ signature: |
...
@@ -6,6 +6,6 @@ signature: |
void mg_coap_free_options(struct mg_coap_message *cm);
void mg_coap_free_options(struct mg_coap_message *cm);
---
---
Free
s the memory allocated for options.
Free
the memory allocated for options,
If the cm paramater doesn't contain any option it
does nothing.
if cm paramater doesn't contain any option
does nothing.
docs/c-api/coap.h/mg_coap_parse.md
View file @
e406de7e
...
@@ -6,13 +6,13 @@ signature: |
...
@@ -6,13 +6,13 @@ signature: |
uint32_t mg_coap_parse(struct mbuf *io, struct mg_coap_message *cm);
uint32_t mg_coap_parse(struct mbuf *io, struct mg_coap_message *cm);
---
---
Parse
s Co
AP message and fills mg_coap_message and returns cm->flags.
Parse
CO
AP message and fills mg_coap_message and returns cm->flags.
This is a helper function.
This is a helper function.
NOTE: usually CoAP work
s over UDP, so lack of data means format error.
NOTE: usually CoAP work
over UDP, so lack of data means format error,
But, in theory,
it is possible to use CoAP over TCP (according to RFC)
but in theory
it is possible to use CoAP over TCP (according to RFC)
The caller ha
s
to check results and treat COAP_NOT_ENOUGH_DATA according to
The caller ha
ve
to check results and treat COAP_NOT_ENOUGH_DATA according to
underlying protocol:
underlying protocol:
-
in case of UDP COAP_NOT_ENOUGH_DATA means COAP_FORMAT_ERROR,
-
in case of UDP COAP_NOT_ENOUGH_DATA means COAP_FORMAT_ERROR,
...
...
docs/c-api/coap.h/mg_coap_send_ack.md
View file @
e406de7e
...
@@ -6,7 +6,7 @@ signature: |
...
@@ -6,7 +6,7 @@ signature: |
uint32_t mg_coap_send_ack(struct mg_connection *nc, uint16_t msg_id);
uint32_t mg_coap_send_ack(struct mg_connection *nc, uint16_t msg_id);
---
---
Compose
s
CoAP acknowledgement from
`mg_coap_message`
Compose CoAP acknowledgement from
`mg_coap_message`
and send
s
it into
`nc`
connection.
and send it into
`nc`
connection.
Return value: see
`mg_coap_send_message()`
Return value: see
`mg_coap_send_message()`
docs/c-api/coap.h/mg_coap_send_message.md
View file @
e406de7e
...
@@ -7,9 +7,9 @@ signature: |
...
@@ -7,9 +7,9 @@ signature: |
struct mg_coap_message *cm);
struct mg_coap_message *cm);
---
---
Compose
s a
CoAP message from
`mg_coap_message`
Compose CoAP message from
`mg_coap_message`
and send
s
it into
`nc`
connection.
and send it into
`nc`
connection.
Return
s
0 on success. On error, it is a bitmask:
Return 0 on success. On error, it is a bitmask:
-
`#define MG_COAP_ERROR 0x10000`
-
`#define MG_COAP_ERROR 0x10000`
-
`#define MG_COAP_FORMAT_ERROR (MG_COAP_ERROR | 0x20000)`
-
`#define MG_COAP_FORMAT_ERROR (MG_COAP_ERROR | 0x20000)`
...
...
docs/c-api/coap.h/mg_set_protocol_coap.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
int mg_set_protocol_coap(struct mg_connection *nc);
int mg_set_protocol_coap(struct mg_connection *nc);
---
---
Set
s CoAP protocol handler - triggers CoAP specific events.
Set
CoAP protocol handler - trigger CoAP specific events
docs/c-api/dns-server.h/mg_dns_create_reply.md
View file @
e406de7e
...
@@ -7,18 +7,18 @@ signature: |
...
@@ -7,18 +7,18 @@ signature: |
struct mg_dns_message *msg);
struct mg_dns_message *msg);
---
---
Create
s
a DNS reply.
Create a DNS reply.
The reply will be based on an existing query message
`msg`
.
The reply will be based on an existing query message
`msg`
.
The query body will be appended to the output buffer.
The query body will be appended to the output buffer.
"reply + recursion allowed" will be added to the message flags and
the
"reply + recursion allowed" will be added to the message flags and
message's num_answers will be set to 0.
message's num_answers will be set to 0.
Answer records can be appended with
`mg_dns_send_reply`
or by lower
Answer records can be appended with
`mg_dns_send_reply`
or by lower
level function defined in the DNS API.
level function defined in the DNS API.
In order to send
a
reply use
`mg_dns_send_reply`
.
In order to send
the
reply use
`mg_dns_send_reply`
.
It's possible to use a connection's send buffer as reply buffer,
It's possible to use a connection's send buffer as reply buffer
s
,
and it will work for both UDP and TCP connections.
and it will work for both UDP and TCP connections.
Example:
Example:
...
...
docs/c-api/dns-server.h/mg_dns_reply_record.md
View file @
e406de7e
...
@@ -9,10 +9,10 @@ signature: |
...
@@ -9,10 +9,10 @@ signature: |
size_t rdata_len);
size_t rdata_len);
---
---
Append
s
a DNS reply record to the IO buffer and to the DNS message.
Append a DNS reply record to the IO buffer and to the DNS message.
The message
's num_answers field will be incremented. It's the
caller's duty
The message
num_answers field will be incremented. It's
caller's duty
to ensure num_answers is proper
ly initialis
ed.
to ensure num_answers is proper
tly initializ
ed.
Returns -1 on error.
Returns -1 on error.
docs/c-api/dns-server.h/mg_dns_send_reply.md
View file @
e406de7e
...
@@ -6,11 +6,11 @@ signature: |
...
@@ -6,11 +6,11 @@ signature: |
void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r);
void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r);
---
---
Send
s
a DNS reply through a connection.
Send a DNS reply through a connection.
The DNS data is stored in an IO buffer pointed by reply structure in
`r`
.
The DNS data is stored in an IO buffer pointed by reply structure in
`r`
.
This function mutates the content of that buffer in order to ensure that
This function mutates the content of that buffer in order to ensure that
the DNS header reflects
the size and flags of the me
ssage, that might have been
the DNS header reflects
size and flags of the m
ssage, that might have been
updated either with
`mg_dns_reply_record`
or by direct manipulation of
updated either with
`mg_dns_reply_record`
or by direct manipulation of
`r->message`
.
`r->message`
.
...
...
docs/c-api/dns.h/mg_dns_copy_questions.md
View file @
e406de7e
...
@@ -6,10 +6,10 @@ signature: |
...
@@ -6,10 +6,10 @@ signature: |
int mg_dns_copy_questions(struct mbuf *io, struct mg_dns_message *msg);
int mg_dns_copy_questions(struct mbuf *io, struct mg_dns_message *msg);
---
---
Append
s
already encoded questions from an existing message.
Append already encoded questions from an existing message.
This is useful when generating a DNS reply message which includes
This is useful when generating a DNS reply message which includes
all question records.
all question records.
Return
s the
number of appened bytes.
Return number of appened bytes.
docs/c-api/dns.h/mg_dns_encode_record.md
View file @
e406de7e
...
@@ -8,11 +8,11 @@ signature: |
...
@@ -8,11 +8,11 @@ signature: |
size_t rlen);
size_t rlen);
---
---
Encode
s and appends
a DNS resource record to an IO buffer.
Encode
and append
a DNS resource record to an IO buffer.
The record metadata is taken from the
`rr`
parameter, while the name and data
The record metadata is taken from the
`rr`
parameter, while the name and data
are taken from the parameters, encoded in the appropriate format depending on
are taken from the parameters, encoded in the appropriate format depending on
record type and stored in the IO buffer. The encoded values might contain
record type
,
and stored in the IO buffer. The encoded values might contain
offsets within the IO buffer. It's thus important that the IO buffer doesn't
offsets within the IO buffer. It's thus important that the IO buffer doesn't
get trimmed while a sequence of records are encoded while preparing a DNS
get trimmed while a sequence of records are encoded while preparing a DNS
*
reply.
*
reply.
...
@@ -21,5 +21,5 @@ This function doesn't update the `name` and `rdata` pointers in the `rr`
...
@@ -21,5 +21,5 @@ This function doesn't update the `name` and `rdata` pointers in the `rr`
*
struct
*
struct
because they might be invalidated as soon as the IO buffer grows again.
because they might be invalidated as soon as the IO buffer grows again.
Return
s
the number of bytes appened or -1 in case of error.
Return the number of bytes appened or -1 in case of error.
docs/c-api/dns.h/mg_dns_insert_header.md
View file @
e406de7e
...
@@ -7,7 +7,7 @@ signature: |
...
@@ -7,7 +7,7 @@ signature: |
struct mg_dns_message *msg);
struct mg_dns_message *msg);
---
---
Insert
s
a DNS header to an IO buffer.
Insert a DNS header to an IO buffer.
Return
s the
number of bytes inserted.
Return number of bytes inserted.
docs/c-api/dns.h/mg_dns_parse_record_data.md
View file @
e406de7e
...
@@ -8,7 +8,7 @@ signature: |
...
@@ -8,7 +8,7 @@ signature: |
size_t data_len);
size_t data_len);
---
---
Parse
s
the record data from a DNS resource record.
Parse the record data from a DNS resource record.
-
A: struct in_addr
*
ina
-
A: struct in_addr
*
ina
-
AAAA: struct in6_addr
*
ina
-
AAAA: struct in6_addr
*
ina
...
...
docs/c-api/dns.h/mg_dns_uncompress_name.md
View file @
e406de7e
...
@@ -7,15 +7,15 @@ signature: |
...
@@ -7,15 +7,15 @@ signature: |
char *dst, int dst_len);
char *dst, int dst_len);
---
---
Uncompress
es
a DNS compressed name.
Uncompress a DNS compressed name.
The containing
DNS message is required because of
the compressed encoding
The containing
dns message is required because
the compressed encoding
and reference suffixes present elsewhere in the packet.
and reference suffixes present elsewhere in the packet.
If
the
name is less than
`dst_len`
characters long, the remainder
If name is less than
`dst_len`
characters long, the remainder
of
`dst`
is terminated with
`\0
`
characters. Otherwise,
`dst`
is not
of
`dst`
is terminated with
`\0
'
characters. Otherwise, `
dst
` is not
*terminated.
*terminated.
If `
dst_len
` is 0 `
dst
`
can be NULL.
If `
dst_len
` is 0 `
dst
`
can be NULL.
Return
s
the uncompressed name length.
Return the uncompressed name length.
docs/c-api/dns.h/mg_send_dns_query.md
View file @
e406de7e
...
@@ -7,5 +7,5 @@ signature: |
...
@@ -7,5 +7,5 @@ signature: |
int query_type);
int query_type);
---
---
Send
s
a DNS query to the remote end.
Send a DNS query to the remote end.
docs/c-api/dns.h/mg_set_protocol_dns.md
View file @
e406de7e
...
@@ -6,11 +6,11 @@ signature: |
...
@@ -6,11 +6,11 @@ signature: |
void mg_set_protocol_dns(struct mg_connection *nc);
void mg_set_protocol_dns(struct mg_connection *nc);
---
---
Attach
es a
built-in DNS event handler to the given listening connection.
Attach built-in DNS event handler to the given listening connection.
The DNS event handler parses the
incoming UDP packets, treating them as DNS
DNS event handler parses
incoming UDP packets, treating them as DNS
requests. If
an
incoming packet gets successfully parsed by the DNS event
requests. If incoming packet gets successfully parsed by the DNS event
handler, a user event handler will receive
an
`MG_DNS_REQUEST`
event, with
handler, a user event handler will receive
`MG_DNS_REQUEST`
event, with
`ev_data`
pointing to the parsed
`struct mg_dns_message`
.
`ev_data`
pointing to the parsed
`struct mg_dns_message`
.
See
See
...
...
docs/c-api/mqtt-broker.h/mg_mqtt_broker.md
View file @
e406de7e
...
@@ -6,9 +6,9 @@ signature: |
...
@@ -6,9 +6,9 @@ signature: |
void mg_mqtt_broker(struct mg_connection *brk, int ev, void *data);
void mg_mqtt_broker(struct mg_connection *brk, int ev, void *data);
---
---
Process
es
a MQTT broker message.
Process a MQTT broker message.
The listening connection expects a pointer to an initialis
ed
`mg_mqtt_broker`
Listening connection expects a pointer to an initializ
ed
`mg_mqtt_broker`
structure in the
`user_data`
field.
structure in the
`user_data`
field.
Basic usage:
Basic usage:
...
...
docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_broker_init(struct mg_mqtt_broker *brk, void *user_data);
void mg_mqtt_broker_init(struct mg_mqtt_broker *brk, void *user_data);
---
---
Initiali
ses
a MQTT broker.
Initiali
ze
a MQTT broker.
docs/c-api/mqtt-broker.h/mg_mqtt_next.md
View file @
e406de7e
...
@@ -7,7 +7,7 @@ signature: |
...
@@ -7,7 +7,7 @@ signature: |
struct mg_mqtt_session *s);
struct mg_mqtt_session *s);
---
---
Iterate
s over all MQTT session
connections. Example:
Iterate
over all mqtt sessions
connections. Example:
```
c
```
c
struct
mg_mqtt_session
*
s
;
struct
mg_mqtt_session
*
s
;
...
...
docs/c-api/mqtt.h/mg_mqtt_connack.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_connack(struct mg_connection *nc, uint8_t return_code);
void mg_mqtt_connack(struct mg_connection *nc, uint8_t return_code);
---
---
Send
s
a CONNACK command with a given
`return_code`
.
Send a CONNACK command with a given
`return_code`
.
docs/c-api/mqtt.h/mg_mqtt_disconnect.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_disconnect(struct mg_connection *nc);
void mg_mqtt_disconnect(struct mg_connection *nc);
---
---
Send
s
a DISCONNECT command.
Send a DISCONNECT command.
docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md
View file @
e406de7e
...
@@ -7,9 +7,9 @@ signature: |
...
@@ -7,9 +7,9 @@ signature: |
struct mg_str *topic, uint8_t *qos, int pos);
struct mg_str *topic, uint8_t *qos, int pos);
---
---
Extract
s
the next topic expression from a SUBSCRIBE command payload.
Extract the next topic expression from a SUBSCRIBE command payload.
T
he t
opic expression name will point to a string in the payload buffer.
Topic expression name will point to a string in the payload buffer.
Return
s
the pos of the next topic expression or -1 when the list
Return the pos of the next topic expression or -1 when the list
of topics is exhausted.
of topics is exhausted.
docs/c-api/mqtt.h/mg_mqtt_ping.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_ping(struct mg_connection *nc);
void mg_mqtt_ping(struct mg_connection *nc);
---
---
Send
s
a PINGREQ command.
Send a PINGREQ command.
docs/c-api/mqtt.h/mg_mqtt_pong.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_pong(struct mg_connection *nc);
void mg_mqtt_pong(struct mg_connection *nc);
---
---
Send
s
a PINGRESP command.
Send a PINGRESP command.
docs/c-api/mqtt.h/mg_mqtt_puback.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_puback(struct mg_connection *nc, uint16_t message_id);
void mg_mqtt_puback(struct mg_connection *nc, uint16_t message_id);
---
---
Send
s
a PUBACK command with a given
`message_id`
.
Send a PUBACK command with a given
`message_id`
.
docs/c-api/mqtt.h/mg_mqtt_pubcomp.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_pubcomp(struct mg_connection *nc, uint16_t message_id);
void mg_mqtt_pubcomp(struct mg_connection *nc, uint16_t message_id);
---
---
Send
s
a PUBCOMP command with a given
`message_id`
.
Send a PUBCOMP command with a given
`message_id`
.
docs/c-api/mqtt.h/mg_mqtt_publish.md
View file @
e406de7e
...
@@ -8,5 +8,5 @@ signature: |
...
@@ -8,5 +8,5 @@ signature: |
size_t len);
size_t len);
---
---
Publish
es
a message to a given topic.
Publish a message to a given topic.
docs/c-api/mqtt.h/mg_mqtt_pubrec.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_pubrec(struct mg_connection *nc, uint16_t message_id);
void mg_mqtt_pubrec(struct mg_connection *nc, uint16_t message_id);
---
---
Send
s
a PUBREC command with a given
`message_id`
.
Send a PUBREC command with a given
`message_id`
.
docs/c-api/mqtt.h/mg_mqtt_pubrel.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_pubrel(struct mg_connection *nc, uint16_t message_id);
void mg_mqtt_pubrel(struct mg_connection *nc, uint16_t message_id);
---
---
Send
s
a PUBREL command with a given
`message_id`
.
Send a PUBREL command with a given
`message_id`
.
docs/c-api/mqtt.h/mg_mqtt_suback.md
View file @
e406de7e
...
@@ -7,6 +7,6 @@ signature: |
...
@@ -7,6 +7,6 @@ signature: |
uint16_t message_id);
uint16_t message_id);
---
---
Send
s
a SUBACK command with a given
`message_id`
Send a SUBACK command with a given
`message_id`
and a sequence of granted QoSs.
and a sequence of granted QoSs.
docs/c-api/mqtt.h/mg_mqtt_subscribe.md
View file @
e406de7e
...
@@ -8,5 +8,5 @@ signature: |
...
@@ -8,5 +8,5 @@ signature: |
size_t topics_len, uint16_t message_id);
size_t topics_len, uint16_t message_id);
---
---
Subscribe
s
to a bunch of topics.
Subscribe to a bunch of topics.
docs/c-api/mqtt.h/mg_mqtt_unsuback.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_mqtt_unsuback(struct mg_connection *nc, uint16_t message_id);
void mg_mqtt_unsuback(struct mg_connection *nc, uint16_t message_id);
---
---
Send
s
a UNSUBACK command with a given
`message_id`
.
Send a UNSUBACK command with a given
`message_id`
.
docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md
View file @
e406de7e
...
@@ -7,5 +7,5 @@ signature: |
...
@@ -7,5 +7,5 @@ signature: |
size_t topics_len, uint16_t message_id);
size_t topics_len, uint16_t message_id);
---
---
Unsubscribe
s
from a bunch of topics.
Unsubscribe from a bunch of topics.
docs/c-api/mqtt.h/mg_send_mqtt_handshake.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
void mg_send_mqtt_handshake(struct mg_connection *nc, const char *client_id);
void mg_send_mqtt_handshake(struct mg_connection *nc, const char *client_id);
---
---
Send
s an
MQTT handshake.
Send MQTT handshake.
docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md
View file @
e406de7e
...
@@ -7,5 +7,5 @@ signature: |
...
@@ -7,5 +7,5 @@ signature: |
struct mg_send_mqtt_handshake_opts);
struct mg_send_mqtt_handshake_opts);
---
---
Send
s an
MQTT handshake with optional parameters.
Send MQTT handshake with optional parameters.
docs/c-api/mqtt.h/mg_set_protocol_mqtt.md
View file @
e406de7e
...
@@ -6,7 +6,7 @@ signature: |
...
@@ -6,7 +6,7 @@ signature: |
void mg_set_protocol_mqtt(struct mg_connection *nc);
void mg_set_protocol_mqtt(struct mg_connection *nc);
---
---
Attach
es a
built-in MQTT event handler to the given connection.
Attach built-in MQTT event handler to the given connection.
The user-defined event handler will receive following extra events:
The user-defined event handler will receive following extra events:
...
...
docs/c-api/util.h/mg_avprintf.md
View file @
e406de7e
...
@@ -6,9 +6,9 @@ signature: |
...
@@ -6,9 +6,9 @@ signature: |
int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap);
int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap);
---
---
Print
s message to the buffer. If the
buffer is large enough to hold the message,
Print
message to buffer. If
buffer is large enough to hold the message,
it returns buffer. If buffer is to small, it allocates a large enough buffer on heap
return buffer. If buffer is to small, allocate large enough buffer on heap,
and return
s
allocated buffer.
and return allocated buffer.
This is a supposed use case:
This is a supposed use case:
char buf
[
5
]
,
*
p = buf;
char buf
[
5
]
,
*
p = buf;
...
...
docs/c-api/util.h/mg_base64_decode.md
View file @
e406de7e
...
@@ -6,11 +6,11 @@ signature: |
...
@@ -6,11 +6,11 @@ signature: |
int mg_base64_decode(const unsigned char *s, int len, char *dst);
int mg_base64_decode(const unsigned char *s, int len, char *dst);
---
---
Decode
s
base64-encoded string
`s`
,
`len`
into the destination
`dst`
.
Decode base64-encoded string
`s`
,
`len`
into the destination
`dst`
.
The destination has to have enough space to hold the
decoded buffer.
Destination has to have enough space to hold
decoded buffer.
Decoding stops either when all string
s have been decoded or invalid an
Decoding stops either when all string
has been decoded, or invalid
character appeared.
character appeared.
Destination is '
\0
'-terminated.
Destination is '
\0
'-terminated.
Return
s the
number of decoded characters. On success, that should be equal to
Return number of decoded characters. On success, that should be equal to
`len`
. On error (invalid character) the return value is smaller then
`len`
.
`len`
. On error (invalid character) the return value is smaller then
`len`
.
docs/c-api/util.h/mg_conn_addr_to_str.md
View file @
e406de7e
...
@@ -7,9 +7,9 @@ signature: |
...
@@ -7,9 +7,9 @@ signature: |
int flags);
int flags);
---
---
Convert
s a
connection's local or remote address into string.
Convert connection's local or remote address into string.
The
`flags`
parameter is a bit mask that controls the behavio
ur;
The
`flags`
parameter is a bit mask that controls the behavio
r,
see
`MG_SOCK_STRINGIFY_*`
definitions.
see
`MG_SOCK_STRINGIFY_*`
definitions.
-
MG_SOCK_STRINGIFY_IP - print IP address
-
MG_SOCK_STRINGIFY_IP - print IP address
...
...
docs/c-api/util.h/mg_fopen.md
View file @
e406de7e
...
@@ -6,7 +6,7 @@ signature: |
...
@@ -6,7 +6,7 @@ signature: |
FILE *mg_fopen(const char *path, const char *mode);
FILE *mg_fopen(const char *path, const char *mode);
---
---
Open
s the given file and returns
a file stream.
Open
the given file and return
a file stream.
`path`
and
`mode`
should be UTF8 encoded.
`path`
and
`mode`
should be UTF8 encoded.
...
...
docs/c-api/util.h/mg_hexdump.md
View file @
e406de7e
...
@@ -6,10 +6,10 @@ signature: |
...
@@ -6,10 +6,10 @@ signature: |
int mg_hexdump(const void *buf, int len, char *dst, int dst_len);
int mg_hexdump(const void *buf, int len, char *dst, int dst_len);
---
---
Generates
a
human-readable hexdump of memory chunk.
Generates human-readable hexdump of memory chunk.
Takes a memory buffer
`buf`
of length
`len`
and creates a hex dump of that
Takes a memory buffer
`buf`
of length
`len`
and creates a hex dump of that
buffer in
`dst`
.
The g
enerated output is a-la hexdump(1).
buffer in
`dst`
.
G
enerated output is a-la hexdump(1).
Return
s the
length of generated string, excluding terminating
`\0`
. If returned
Return length of generated string, excluding terminating
`\0`
. If returned
length is bigger than
`dst_len`
,
the
overflow bytes are discarded.
length is bigger than
`dst_len`
, overflow bytes are discarded.
docs/c-api/util.h/mg_hexdump_connection.md
View file @
e406de7e
...
@@ -7,7 +7,7 @@ signature: |
...
@@ -7,7 +7,7 @@ signature: |
const void *buf, int num_bytes, int ev);
const void *buf, int num_bytes, int ev);
---
---
Generates human-readable hexdump of the data sent or received by
the
connection.
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
`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
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
an event handler. This function is supposed to be called from the
...
...
docs/c-api/util.h/mg_is_big_endian.md
View file @
e406de7e
...
@@ -6,5 +6,5 @@ signature: |
...
@@ -6,5 +6,5 @@ signature: |
int mg_is_big_endian(void);
int mg_is_big_endian(void);
---
---
Return
s true if the
target platform is big endian.
Return
true if
target platform is big endian.
docs/c-api/util.h/mg_open.md
View file @
e406de7e
...
@@ -6,7 +6,7 @@ signature: |
...
@@ -6,7 +6,7 @@ signature: |
int mg_open(const char *path, int flag, int mode);
int mg_open(const char *path, int flag, int mode);
---
---
Open
s the given file and returns
a file stream.
Open
the given file and return
a file stream.
`path`
should be UTF8 encoded.
`path`
should be UTF8 encoded.
...
...
docs/c-api/util.h/mg_skip.md
View file @
e406de7e
...
@@ -7,11 +7,11 @@ signature: |
...
@@ -7,11 +7,11 @@ signature: |
const char *delimiters, struct mg_str *v);
const char *delimiters, struct mg_str *v);
---
---
Fetch
es
substring from input string
`s`
,
`end`
into
`v`
.
Fetch substring from input string
`s`
,
`end`
into
`v`
.
Skips initial delimiter characters. Records first non-delimiter character
Skips initial delimiter characters. Records first non-delimiter character
a
t
the beginning of substring
`v`
. Then scans the rest of the string
a
s
the beginning of substring
`v`
. Then scans the rest of the string
until a delimiter character or end-of-string is found.
until a delimiter character or end-of-string is found.
`delimiters`
is a 0-terminated string containing delimiter characters.
`delimiters`
is a 0-terminated string containing delimiter characters.
Either one of
`delimiters`
or
`end_string`
terminates the search.
Either one of
`delimiters`
or
`end_string`
terminates the search.
Return
s an
`s`
pointer, advanced forward where parsing has
stopped.
Return
an
`s`
pointer, advanced forward where parsing
stopped.
docs/c-api/util.h/mg_sock_addr_to_str.md
View file @
e406de7e
...
@@ -7,7 +7,7 @@ signature: |
...
@@ -7,7 +7,7 @@ signature: |
int flags);
int flags);
---
---
Convert
s the
socket's address into string.
Convert socket's address into string.
`flags`
is MG_SOCK_STRINGIFY_IP and/or MG_SOCK_STRINGIFY_PORT.
`flags`
is MG_SOCK_STRINGIFY_IP and/or MG_SOCK_STRINGIFY_PORT.
docs/c-api/util.h/mg_start_thread.md
View file @
e406de7e
...
@@ -6,8 +6,8 @@ signature: |
...
@@ -6,8 +6,8 @@ signature: |
void *mg_start_thread(void *(*thread_func);
void *mg_start_thread(void *(*thread_func);
---
---
Start
s
a new detached thread.
Start a new detached thread.
Arguments and semantic
s are
the same as pthead's
`pthread_create()`
.
Arguments and semantic
is
the same as pthead's
`pthread_create()`
.
`thread_func`
is a thread function,
`thread_func_param`
is a parameter
`thread_func`
is a thread function,
`thread_func_param`
is a parameter
that is passed to the thread function.
that is passed to the thread function.
docs/c-api/util.h/mg_stat.md
View file @
e406de7e
...
@@ -6,7 +6,7 @@ signature: |
...
@@ -6,7 +6,7 @@ signature: |
int mg_stat(const char *path, cs_stat_t *st);
int mg_stat(const char *path, cs_stat_t *st);
---
---
Perform
s a 64-bit
`stat()`
call against a
given file.
Perform
a 64-bit
`stat()`
call against
given file.
`path`
should be UTF8 encoded.
`path`
should be UTF8 encoded.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment