From e406de7e0087398d4244404689db385995ee1a19 Mon Sep 17 00:00:00 2001 From: Alexander Alashkin Date: Mon, 25 Jul 2016 18:28:34 +0200 Subject: [PATCH] Remove extra error message PUBLISHED_FROM=8b7fcfc1bc32ff9ff38e2904ddb730c83bf9fae4 --- docs/c-api/coap.h/mg_coap_add_option.md | 2 +- docs/c-api/coap.h/mg_coap_free_options.md | 4 ++-- docs/c-api/coap.h/mg_coap_parse.md | 8 ++++---- docs/c-api/coap.h/mg_coap_send_ack.md | 4 ++-- docs/c-api/coap.h/mg_coap_send_message.md | 6 +++--- docs/c-api/coap.h/mg_set_protocol_coap.md | 2 +- docs/c-api/dns-server.h/mg_dns_create_reply.md | 8 ++++---- docs/c-api/dns-server.h/mg_dns_reply_record.md | 6 +++--- docs/c-api/dns-server.h/mg_dns_send_reply.md | 4 ++-- docs/c-api/dns.h/mg_dns_copy_questions.md | 4 ++-- docs/c-api/dns.h/mg_dns_encode_record.md | 6 +++--- docs/c-api/dns.h/mg_dns_insert_header.md | 4 ++-- docs/c-api/dns.h/mg_dns_parse_record_data.md | 2 +- docs/c-api/dns.h/mg_dns_uncompress_name.md | 10 +++++----- docs/c-api/dns.h/mg_send_dns_query.md | 2 +- docs/c-api/dns.h/mg_set_protocol_dns.md | 8 ++++---- docs/c-api/mqtt-broker.h/mg_mqtt_broker.md | 4 ++-- docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md | 2 +- docs/c-api/mqtt-broker.h/mg_mqtt_next.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_connack.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_disconnect.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md | 6 +++--- docs/c-api/mqtt.h/mg_mqtt_ping.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_pong.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_puback.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_pubcomp.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_publish.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_pubrec.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_pubrel.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_suback.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_subscribe.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_unsuback.md | 2 +- docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md | 2 +- docs/c-api/mqtt.h/mg_send_mqtt_handshake.md | 2 +- docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md | 2 +- docs/c-api/mqtt.h/mg_set_protocol_mqtt.md | 2 +- docs/c-api/util.h/mg_avprintf.md | 6 +++--- docs/c-api/util.h/mg_base64_decode.md | 8 ++++---- docs/c-api/util.h/mg_conn_addr_to_str.md | 4 ++-- docs/c-api/util.h/mg_fopen.md | 2 +- docs/c-api/util.h/mg_hexdump.md | 8 ++++---- docs/c-api/util.h/mg_hexdump_connection.md | 2 +- docs/c-api/util.h/mg_is_big_endian.md | 2 +- docs/c-api/util.h/mg_open.md | 2 +- docs/c-api/util.h/mg_skip.md | 6 +++--- docs/c-api/util.h/mg_sock_addr_to_str.md | 2 +- docs/c-api/util.h/mg_start_thread.md | 4 ++-- docs/c-api/util.h/mg_stat.md | 2 +- 48 files changed, 87 insertions(+), 87 deletions(-) diff --git a/docs/c-api/coap.h/mg_coap_add_option.md b/docs/c-api/coap.h/mg_coap_add_option.md index 5867b7b7..f56887e5 100644 --- a/docs/c-api/coap.h/mg_coap_add_option.md +++ b/docs/c-api/coap.h/mg_coap_add_option.md @@ -8,6 +8,6 @@ signature: | size_t len); --- -Adds a new option to mg_coap_message structure. +Add new option to mg_coap_message structure. Returns pointer to the newly created option. diff --git a/docs/c-api/coap.h/mg_coap_free_options.md b/docs/c-api/coap.h/mg_coap_free_options.md index 9dcc816f..39d07d44 100644 --- a/docs/c-api/coap.h/mg_coap_free_options.md +++ b/docs/c-api/coap.h/mg_coap_free_options.md @@ -6,6 +6,6 @@ signature: | void mg_coap_free_options(struct mg_coap_message *cm); --- -Frees the memory allocated for options. -If the cm paramater doesn't contain any option it does nothing. +Free the memory allocated for options, +if cm paramater doesn't contain any option does nothing. diff --git a/docs/c-api/coap.h/mg_coap_parse.md b/docs/c-api/coap.h/mg_coap_parse.md index 86885229..2f3bc0c6 100644 --- a/docs/c-api/coap.h/mg_coap_parse.md +++ b/docs/c-api/coap.h/mg_coap_parse.md @@ -6,13 +6,13 @@ signature: | uint32_t mg_coap_parse(struct mbuf *io, struct mg_coap_message *cm); --- -Parses CoAP message and fills mg_coap_message and returns cm->flags. +Parse COAP message and fills mg_coap_message and returns cm->flags. This is a helper function. -NOTE: usually CoAP works over UDP, so lack of data means format error. -But, in theory, it is possible to use CoAP over TCP (according to RFC) +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) -The caller has to check results and treat COAP_NOT_ENOUGH_DATA according to +The caller have to check results and treat COAP_NOT_ENOUGH_DATA according to underlying protocol: - in case of UDP COAP_NOT_ENOUGH_DATA means COAP_FORMAT_ERROR, diff --git a/docs/c-api/coap.h/mg_coap_send_ack.md b/docs/c-api/coap.h/mg_coap_send_ack.md index 1475a9c5..5cdd0c1d 100644 --- a/docs/c-api/coap.h/mg_coap_send_ack.md +++ b/docs/c-api/coap.h/mg_coap_send_ack.md @@ -6,7 +6,7 @@ signature: | uint32_t mg_coap_send_ack(struct mg_connection *nc, uint16_t msg_id); --- -Composes CoAP acknowledgement from `mg_coap_message` -and sends it into `nc` connection. +Compose CoAP acknowledgement from `mg_coap_message` +and send it into `nc` connection. Return value: see `mg_coap_send_message()` diff --git a/docs/c-api/coap.h/mg_coap_send_message.md b/docs/c-api/coap.h/mg_coap_send_message.md index a1acc01e..34bf3c87 100644 --- a/docs/c-api/coap.h/mg_coap_send_message.md +++ b/docs/c-api/coap.h/mg_coap_send_message.md @@ -7,9 +7,9 @@ signature: | struct mg_coap_message *cm); --- -Composes a CoAP message from `mg_coap_message` -and sends it into `nc` connection. -Returns 0 on success. On error, it is a bitmask: +Compose CoAP message from `mg_coap_message` +and send it into `nc` connection. +Return 0 on success. On error, it is a bitmask: - `#define MG_COAP_ERROR 0x10000` - `#define MG_COAP_FORMAT_ERROR (MG_COAP_ERROR | 0x20000)` diff --git a/docs/c-api/coap.h/mg_set_protocol_coap.md b/docs/c-api/coap.h/mg_set_protocol_coap.md index 523ae7cb..60981fb6 100644 --- a/docs/c-api/coap.h/mg_set_protocol_coap.md +++ b/docs/c-api/coap.h/mg_set_protocol_coap.md @@ -6,5 +6,5 @@ signature: | int mg_set_protocol_coap(struct mg_connection *nc); --- -Sets CoAP protocol handler - triggers CoAP specific events. +Set CoAP protocol handler - trigger CoAP specific events diff --git a/docs/c-api/dns-server.h/mg_dns_create_reply.md b/docs/c-api/dns-server.h/mg_dns_create_reply.md index 40c6f225..b616c925 100644 --- a/docs/c-api/dns-server.h/mg_dns_create_reply.md +++ b/docs/c-api/dns-server.h/mg_dns_create_reply.md @@ -7,18 +7,18 @@ signature: | struct mg_dns_message *msg); --- -Creates a DNS reply. +Create a DNS reply. The reply will be based on an existing query message `msg`. 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. Answer records can be appended with `mg_dns_send_reply` or by lower level function defined in the DNS API. -In order to send a reply use `mg_dns_send_reply`. -It's possible to use a connection's send buffer as reply buffer, +In order to send the reply use `mg_dns_send_reply`. +It's possible to use a connection's send buffer as reply buffers, and it will work for both UDP and TCP connections. Example: diff --git a/docs/c-api/dns-server.h/mg_dns_reply_record.md b/docs/c-api/dns-server.h/mg_dns_reply_record.md index 408f705f..a247c8ec 100644 --- a/docs/c-api/dns-server.h/mg_dns_reply_record.md +++ b/docs/c-api/dns-server.h/mg_dns_reply_record.md @@ -9,10 +9,10 @@ signature: | size_t rdata_len); --- -Appends 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 -to ensure num_answers is properly initialised. +The message num_answers field will be incremented. It's caller's duty +to ensure num_answers is propertly initialized. Returns -1 on error. diff --git a/docs/c-api/dns-server.h/mg_dns_send_reply.md b/docs/c-api/dns-server.h/mg_dns_send_reply.md index 30877faf..d5b15de4 100644 --- a/docs/c-api/dns-server.h/mg_dns_send_reply.md +++ b/docs/c-api/dns-server.h/mg_dns_send_reply.md @@ -6,11 +6,11 @@ signature: | void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r); --- -Sends 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`. This function mutates the content of that buffer in order to ensure that -the DNS header reflects the size and flags of the message, that might have been +the DNS header reflects size and flags of the mssage, that might have been updated either with `mg_dns_reply_record` or by direct manipulation of `r->message`. diff --git a/docs/c-api/dns.h/mg_dns_copy_questions.md b/docs/c-api/dns.h/mg_dns_copy_questions.md index c7501eff..9fc2091f 100644 --- a/docs/c-api/dns.h/mg_dns_copy_questions.md +++ b/docs/c-api/dns.h/mg_dns_copy_questions.md @@ -6,10 +6,10 @@ signature: | int mg_dns_copy_questions(struct mbuf *io, struct mg_dns_message *msg); --- -Appends 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 all question records. -Returns the number of appened bytes. +Return number of appened bytes. diff --git a/docs/c-api/dns.h/mg_dns_encode_record.md b/docs/c-api/dns.h/mg_dns_encode_record.md index a892e5de..4b8a9850 100644 --- a/docs/c-api/dns.h/mg_dns_encode_record.md +++ b/docs/c-api/dns.h/mg_dns_encode_record.md @@ -8,11 +8,11 @@ signature: | size_t rlen); --- -Encodes 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 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 get trimmed while a sequence of records are encoded while preparing a DNS *reply. @@ -21,5 +21,5 @@ This function doesn't update the `name` and `rdata` pointers in the `rr` *struct because they might be invalidated as soon as the IO buffer grows again. -Returns the number of bytes appened or -1 in case of error. +Return the number of bytes appened or -1 in case of error. diff --git a/docs/c-api/dns.h/mg_dns_insert_header.md b/docs/c-api/dns.h/mg_dns_insert_header.md index 52b2ac3e..0a9d7dae 100644 --- a/docs/c-api/dns.h/mg_dns_insert_header.md +++ b/docs/c-api/dns.h/mg_dns_insert_header.md @@ -7,7 +7,7 @@ signature: | struct mg_dns_message *msg); --- -Inserts a DNS header to an IO buffer. +Insert a DNS header to an IO buffer. -Returns the number of bytes inserted. +Return number of bytes inserted. diff --git a/docs/c-api/dns.h/mg_dns_parse_record_data.md b/docs/c-api/dns.h/mg_dns_parse_record_data.md index efe56ef4..d8239bef 100644 --- a/docs/c-api/dns.h/mg_dns_parse_record_data.md +++ b/docs/c-api/dns.h/mg_dns_parse_record_data.md @@ -8,7 +8,7 @@ signature: | size_t data_len); --- -Parses the record data from a DNS resource record. +Parse the record data from a DNS resource record. - A: struct in_addr *ina - AAAA: struct in6_addr *ina diff --git a/docs/c-api/dns.h/mg_dns_uncompress_name.md b/docs/c-api/dns.h/mg_dns_uncompress_name.md index b58f2fdd..3db03df8 100644 --- a/docs/c-api/dns.h/mg_dns_uncompress_name.md +++ b/docs/c-api/dns.h/mg_dns_uncompress_name.md @@ -7,15 +7,15 @@ signature: | char *dst, int dst_len); --- -Uncompresses 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. -If the name is less than `dst_len` characters long, the remainder -of `dst` is terminated with `\0` characters. Otherwise, `dst` is not +If name is less than `dst_len` characters long, the remainder +of `dst` is terminated with `\0' characters. Otherwise, `dst` is not *terminated. If `dst_len` is 0 `dst` can be NULL. -Returns the uncompressed name length. +Return the uncompressed name length. diff --git a/docs/c-api/dns.h/mg_send_dns_query.md b/docs/c-api/dns.h/mg_send_dns_query.md index a6b15da9..5dd22c36 100644 --- a/docs/c-api/dns.h/mg_send_dns_query.md +++ b/docs/c-api/dns.h/mg_send_dns_query.md @@ -7,5 +7,5 @@ signature: | int query_type); --- -Sends a DNS query to the remote end. +Send a DNS query to the remote end. diff --git a/docs/c-api/dns.h/mg_set_protocol_dns.md b/docs/c-api/dns.h/mg_set_protocol_dns.md index fdf5ab59..7d7d0dc4 100644 --- a/docs/c-api/dns.h/mg_set_protocol_dns.md +++ b/docs/c-api/dns.h/mg_set_protocol_dns.md @@ -6,11 +6,11 @@ signature: | void mg_set_protocol_dns(struct mg_connection *nc); --- -Attaches 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 -requests. If an incoming packet gets successfully parsed by the DNS event -handler, a user event handler will receive an `MG_DNS_REQUEST` event, with +DNS event handler parses incoming UDP packets, treating them as DNS +requests. If incoming packet gets successfully parsed by the DNS event +handler, a user event handler will receive `MG_DNS_REQUEST` event, with `ev_data` pointing to the parsed `struct mg_dns_message`. See diff --git a/docs/c-api/mqtt-broker.h/mg_mqtt_broker.md b/docs/c-api/mqtt-broker.h/mg_mqtt_broker.md index d2501369..2532bc6f 100644 --- a/docs/c-api/mqtt-broker.h/mg_mqtt_broker.md +++ b/docs/c-api/mqtt-broker.h/mg_mqtt_broker.md @@ -6,9 +6,9 @@ signature: | void mg_mqtt_broker(struct mg_connection *brk, int ev, void *data); --- -Processes a MQTT broker message. +Process a MQTT broker message. -The listening connection expects a pointer to an initialised `mg_mqtt_broker` +Listening connection expects a pointer to an initialized `mg_mqtt_broker` structure in the `user_data` field. Basic usage: diff --git a/docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md b/docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md index 9c19bd89..74b7e5db 100644 --- a/docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md +++ b/docs/c-api/mqtt-broker.h/mg_mqtt_broker_init.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_broker_init(struct mg_mqtt_broker *brk, void *user_data); --- -Initialises a MQTT broker. +Initialize a MQTT broker. diff --git a/docs/c-api/mqtt-broker.h/mg_mqtt_next.md b/docs/c-api/mqtt-broker.h/mg_mqtt_next.md index 17a2472b..5c4eab9d 100644 --- a/docs/c-api/mqtt-broker.h/mg_mqtt_next.md +++ b/docs/c-api/mqtt-broker.h/mg_mqtt_next.md @@ -7,7 +7,7 @@ signature: | struct mg_mqtt_session *s); --- -Iterates over all MQTT session connections. Example: +Iterate over all mqtt sessions connections. Example: ```c struct mg_mqtt_session *s; diff --git a/docs/c-api/mqtt.h/mg_mqtt_connack.md b/docs/c-api/mqtt.h/mg_mqtt_connack.md index 7daaf5b4..3b22d0a0 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_connack.md +++ b/docs/c-api/mqtt.h/mg_mqtt_connack.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_connack(struct mg_connection *nc, uint8_t return_code); --- -Sends a CONNACK command with a given `return_code`. +Send a CONNACK command with a given `return_code`. diff --git a/docs/c-api/mqtt.h/mg_mqtt_disconnect.md b/docs/c-api/mqtt.h/mg_mqtt_disconnect.md index c727cad0..2437c21d 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_disconnect.md +++ b/docs/c-api/mqtt.h/mg_mqtt_disconnect.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_disconnect(struct mg_connection *nc); --- -Sends a DISCONNECT command. +Send a DISCONNECT command. diff --git a/docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md b/docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md index ccb96e62..3e7eeab5 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md +++ b/docs/c-api/mqtt.h/mg_mqtt_next_subscribe_topic.md @@ -7,9 +7,9 @@ signature: | struct mg_str *topic, uint8_t *qos, int pos); --- -Extracts the next topic expression from a SUBSCRIBE command payload. +Extract the next topic expression from a SUBSCRIBE command payload. -The topic expression name will point to a string in the payload buffer. -Returns the pos of the next topic expression or -1 when the list +Topic expression name will point to a string in the payload buffer. +Return the pos of the next topic expression or -1 when the list of topics is exhausted. diff --git a/docs/c-api/mqtt.h/mg_mqtt_ping.md b/docs/c-api/mqtt.h/mg_mqtt_ping.md index 757a825e..acaa11ac 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_ping.md +++ b/docs/c-api/mqtt.h/mg_mqtt_ping.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_ping(struct mg_connection *nc); --- -Sends a PINGREQ command. +Send a PINGREQ command. diff --git a/docs/c-api/mqtt.h/mg_mqtt_pong.md b/docs/c-api/mqtt.h/mg_mqtt_pong.md index c79253e3..da353b57 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_pong.md +++ b/docs/c-api/mqtt.h/mg_mqtt_pong.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_pong(struct mg_connection *nc); --- -Sends a PINGRESP command. +Send a PINGRESP command. diff --git a/docs/c-api/mqtt.h/mg_mqtt_puback.md b/docs/c-api/mqtt.h/mg_mqtt_puback.md index a29a352d..aad96f66 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_puback.md +++ b/docs/c-api/mqtt.h/mg_mqtt_puback.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_puback(struct mg_connection *nc, uint16_t message_id); --- -Sends a PUBACK command with a given `message_id`. +Send a PUBACK command with a given `message_id`. diff --git a/docs/c-api/mqtt.h/mg_mqtt_pubcomp.md b/docs/c-api/mqtt.h/mg_mqtt_pubcomp.md index bc3228ca..aab320f6 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_pubcomp.md +++ b/docs/c-api/mqtt.h/mg_mqtt_pubcomp.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_pubcomp(struct mg_connection *nc, uint16_t message_id); --- -Sends a PUBCOMP command with a given `message_id`. +Send a PUBCOMP command with a given `message_id`. diff --git a/docs/c-api/mqtt.h/mg_mqtt_publish.md b/docs/c-api/mqtt.h/mg_mqtt_publish.md index b2a7b013..8b28c57b 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_publish.md +++ b/docs/c-api/mqtt.h/mg_mqtt_publish.md @@ -8,5 +8,5 @@ signature: | size_t len); --- -Publishes a message to a given topic. +Publish a message to a given topic. diff --git a/docs/c-api/mqtt.h/mg_mqtt_pubrec.md b/docs/c-api/mqtt.h/mg_mqtt_pubrec.md index 16cdc7d0..e5173f77 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_pubrec.md +++ b/docs/c-api/mqtt.h/mg_mqtt_pubrec.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_pubrec(struct mg_connection *nc, uint16_t message_id); --- -Sends a PUBREC command with a given `message_id`. +Send a PUBREC command with a given `message_id`. diff --git a/docs/c-api/mqtt.h/mg_mqtt_pubrel.md b/docs/c-api/mqtt.h/mg_mqtt_pubrel.md index 18a6c581..899e8b9d 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_pubrel.md +++ b/docs/c-api/mqtt.h/mg_mqtt_pubrel.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_pubrel(struct mg_connection *nc, uint16_t message_id); --- -Sends a PUBREL command with a given `message_id`. +Send a PUBREL command with a given `message_id`. diff --git a/docs/c-api/mqtt.h/mg_mqtt_suback.md b/docs/c-api/mqtt.h/mg_mqtt_suback.md index 55cf5e3a..943fd65e 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_suback.md +++ b/docs/c-api/mqtt.h/mg_mqtt_suback.md @@ -7,6 +7,6 @@ signature: | uint16_t message_id); --- -Sends a SUBACK command with a given `message_id` +Send a SUBACK command with a given `message_id` and a sequence of granted QoSs. diff --git a/docs/c-api/mqtt.h/mg_mqtt_subscribe.md b/docs/c-api/mqtt.h/mg_mqtt_subscribe.md index 0168db41..0978b071 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_subscribe.md +++ b/docs/c-api/mqtt.h/mg_mqtt_subscribe.md @@ -8,5 +8,5 @@ signature: | size_t topics_len, uint16_t message_id); --- -Subscribes to a bunch of topics. +Subscribe to a bunch of topics. diff --git a/docs/c-api/mqtt.h/mg_mqtt_unsuback.md b/docs/c-api/mqtt.h/mg_mqtt_unsuback.md index a86fffc5..e3f6e6ea 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_unsuback.md +++ b/docs/c-api/mqtt.h/mg_mqtt_unsuback.md @@ -6,5 +6,5 @@ signature: | void mg_mqtt_unsuback(struct mg_connection *nc, uint16_t message_id); --- -Sends a UNSUBACK command with a given `message_id`. +Send a UNSUBACK command with a given `message_id`. diff --git a/docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md b/docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md index b4c1f783..73a283e3 100644 --- a/docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md +++ b/docs/c-api/mqtt.h/mg_mqtt_unsubscribe.md @@ -7,5 +7,5 @@ signature: | size_t topics_len, uint16_t message_id); --- -Unsubscribes from a bunch of topics. +Unsubscribe from a bunch of topics. diff --git a/docs/c-api/mqtt.h/mg_send_mqtt_handshake.md b/docs/c-api/mqtt.h/mg_send_mqtt_handshake.md index 0e75c4e3..1e903f90 100644 --- a/docs/c-api/mqtt.h/mg_send_mqtt_handshake.md +++ b/docs/c-api/mqtt.h/mg_send_mqtt_handshake.md @@ -6,5 +6,5 @@ signature: | void mg_send_mqtt_handshake(struct mg_connection *nc, const char *client_id); --- -Sends an MQTT handshake. +Send MQTT handshake. diff --git a/docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md b/docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md index 2c7a93ca..c1d3fd4c 100644 --- a/docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md +++ b/docs/c-api/mqtt.h/mg_send_mqtt_handshake_opt.md @@ -7,5 +7,5 @@ signature: | struct mg_send_mqtt_handshake_opts); --- -Sends an MQTT handshake with optional parameters. +Send MQTT handshake with optional parameters. diff --git a/docs/c-api/mqtt.h/mg_set_protocol_mqtt.md b/docs/c-api/mqtt.h/mg_set_protocol_mqtt.md index 8c65d385..a559eae8 100644 --- a/docs/c-api/mqtt.h/mg_set_protocol_mqtt.md +++ b/docs/c-api/mqtt.h/mg_set_protocol_mqtt.md @@ -6,7 +6,7 @@ signature: | void mg_set_protocol_mqtt(struct mg_connection *nc); --- -Attaches 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: diff --git a/docs/c-api/util.h/mg_avprintf.md b/docs/c-api/util.h/mg_avprintf.md index 2491db02..efc424d0 100644 --- a/docs/c-api/util.h/mg_avprintf.md +++ b/docs/c-api/util.h/mg_avprintf.md @@ -6,9 +6,9 @@ signature: | int mg_avprintf(char **buf, size_t size, const char *fmt, va_list ap); --- -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. +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; diff --git a/docs/c-api/util.h/mg_base64_decode.md b/docs/c-api/util.h/mg_base64_decode.md index aae831a6..3fa77428 100644 --- a/docs/c-api/util.h/mg_base64_decode.md +++ b/docs/c-api/util.h/mg_base64_decode.md @@ -6,11 +6,11 @@ signature: | int mg_base64_decode(const unsigned char *s, int len, char *dst); --- -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 +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. -Returns 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`. diff --git a/docs/c-api/util.h/mg_conn_addr_to_str.md b/docs/c-api/util.h/mg_conn_addr_to_str.md index e379ff3f..f17bfb70 100644 --- a/docs/c-api/util.h/mg_conn_addr_to_str.md +++ b/docs/c-api/util.h/mg_conn_addr_to_str.md @@ -7,9 +7,9 @@ signature: | int flags); --- -Converts 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 behaviour; +The `flags` parameter is a bit mask that controls the behavior, see `MG_SOCK_STRINGIFY_*` definitions. - MG_SOCK_STRINGIFY_IP - print IP address diff --git a/docs/c-api/util.h/mg_fopen.md b/docs/c-api/util.h/mg_fopen.md index 3cb8568a..3446670c 100644 --- a/docs/c-api/util.h/mg_fopen.md +++ b/docs/c-api/util.h/mg_fopen.md @@ -6,7 +6,7 @@ signature: | FILE *mg_fopen(const char *path, const char *mode); --- -Opens the given file and returns a file stream. +Open the given file and return a file stream. `path` and `mode` should be UTF8 encoded. diff --git a/docs/c-api/util.h/mg_hexdump.md b/docs/c-api/util.h/mg_hexdump.md index 8eb53c35..ed02068a 100644 --- a/docs/c-api/util.h/mg_hexdump.md +++ b/docs/c-api/util.h/mg_hexdump.md @@ -6,10 +6,10 @@ signature: | 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 -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. +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. diff --git a/docs/c-api/util.h/mg_hexdump_connection.md b/docs/c-api/util.h/mg_hexdump_connection.md index 7b340cd5..2e6d520d 100644 --- a/docs/c-api/util.h/mg_hexdump_connection.md +++ b/docs/c-api/util.h/mg_hexdump_connection.md @@ -7,7 +7,7 @@ signature: | 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 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 diff --git a/docs/c-api/util.h/mg_is_big_endian.md b/docs/c-api/util.h/mg_is_big_endian.md index 3adcbdba..ba33f4d7 100644 --- a/docs/c-api/util.h/mg_is_big_endian.md +++ b/docs/c-api/util.h/mg_is_big_endian.md @@ -6,5 +6,5 @@ signature: | int mg_is_big_endian(void); --- -Returns true if the target platform is big endian. +Return true if target platform is big endian. diff --git a/docs/c-api/util.h/mg_open.md b/docs/c-api/util.h/mg_open.md index aaa8e56e..38544670 100644 --- a/docs/c-api/util.h/mg_open.md +++ b/docs/c-api/util.h/mg_open.md @@ -6,7 +6,7 @@ signature: | int mg_open(const char *path, int flag, int mode); --- -Opens the given file and returns a file stream. +Open the given file and return a file stream. `path` should be UTF8 encoded. diff --git a/docs/c-api/util.h/mg_skip.md b/docs/c-api/util.h/mg_skip.md index cc7b2fd1..858dc1d7 100644 --- a/docs/c-api/util.h/mg_skip.md +++ b/docs/c-api/util.h/mg_skip.md @@ -7,11 +7,11 @@ signature: | const char *delimiters, struct mg_str *v); --- -Fetches 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 -at the beginning of substring `v`. Then scans the rest of the string +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. -Returns an `s` pointer, advanced forward where parsing has stopped. +Return an `s` pointer, advanced forward where parsing stopped. diff --git a/docs/c-api/util.h/mg_sock_addr_to_str.md b/docs/c-api/util.h/mg_sock_addr_to_str.md index 6fd70529..0563630b 100644 --- a/docs/c-api/util.h/mg_sock_addr_to_str.md +++ b/docs/c-api/util.h/mg_sock_addr_to_str.md @@ -7,7 +7,7 @@ signature: | int flags); --- -Converts the socket's address into string. +Convert socket's address into string. `flags` is MG_SOCK_STRINGIFY_IP and/or MG_SOCK_STRINGIFY_PORT. diff --git a/docs/c-api/util.h/mg_start_thread.md b/docs/c-api/util.h/mg_start_thread.md index 4a3c809f..11b66d30 100644 --- a/docs/c-api/util.h/mg_start_thread.md +++ b/docs/c-api/util.h/mg_start_thread.md @@ -6,8 +6,8 @@ signature: | void *mg_start_thread(void *(*thread_func); --- -Starts a new detached thread. -Arguments and semantics are the same as pthead's `pthread_create()`. +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. diff --git a/docs/c-api/util.h/mg_stat.md b/docs/c-api/util.h/mg_stat.md index 5bd3b0eb..66c3d75f 100644 --- a/docs/c-api/util.h/mg_stat.md +++ b/docs/c-api/util.h/mg_stat.md @@ -6,7 +6,7 @@ signature: | int mg_stat(const char *path, cs_stat_t *st); --- -Performs a 64-bit `stat()` call against a given file. +Perform a 64-bit `stat()` call against given file. `path` should be UTF8 encoded.