From 58b8acd68a6cf45ba8641ad2b2b980062dfd408c Mon Sep 17 00:00:00 2001
From: Alexander Alashkin <alexander.alashkin@cesanta.com>
Date: Thu, 26 May 2016 12:30:13 +0200
Subject: [PATCH] Check malloc results, Contribute to cesanta/dev#3726

PUBLISHED_FROM=309be4a56754250406dd48f1abd30b68776f5c7e
---
 docs/c-api/coap.h/intro.md          |  10 +++
 docs/c-api/coap.h/items.json        |  44 ----------
 docs/c-api/dns-server.h/intro.md    |   4 +
 docs/c-api/dns-server.h/items.json  |  20 -----
 docs/c-api/dns.h/intro.md           |  11 +++
 docs/c-api/dns.h/items.json         |  48 ----------
 docs/c-api/http.h/intro.md          |  32 +++++++
 docs/c-api/http.h/items.json        | 132 ----------------------------
 docs/c-api/intro.md                 |  13 +++
 docs/c-api/items.json               |  44 ----------
 docs/c-api/json-rpc.h/intro.md      |  10 +++
 docs/c-api/json-rpc.h/items.json    |  44 ----------
 docs/c-api/mbuf.h/intro.md          |   9 ++
 docs/c-api/mbuf.h/items.json        |  40 ---------
 docs/c-api/mqtt-broker.h/intro.md   |   6 ++
 docs/c-api/mqtt-broker.h/items.json |  28 ------
 docs/c-api/mqtt.h/intro.md          |  19 ++++
 docs/c-api/mqtt.h/items.json        |  80 -----------------
 docs/c-api/net.h/intro.md           |  29 ++++++
 docs/c-api/net.h/items.json         | 120 -------------------------
 docs/c-api/util.h/intro.md          |  23 +++++
 docs/c-api/util.h/items.json        |  96 --------------------
 22 files changed, 166 insertions(+), 696 deletions(-)
 delete mode 100644 docs/c-api/coap.h/items.json
 delete mode 100644 docs/c-api/dns-server.h/items.json
 delete mode 100644 docs/c-api/dns.h/items.json
 delete mode 100644 docs/c-api/http.h/items.json
 create mode 100644 docs/c-api/intro.md
 delete mode 100644 docs/c-api/items.json
 delete mode 100644 docs/c-api/json-rpc.h/items.json
 delete mode 100644 docs/c-api/mbuf.h/items.json
 delete mode 100644 docs/c-api/mqtt-broker.h/items.json
 delete mode 100644 docs/c-api/mqtt.h/items.json
 delete mode 100644 docs/c-api/net.h/items.json
 delete mode 100644 docs/c-api/util.h/items.json

diff --git a/docs/c-api/coap.h/intro.md b/docs/c-api/coap.h/intro.md
index 764f07775..8f3f30841 100644
--- a/docs/c-api/coap.h/intro.md
+++ b/docs/c-api/coap.h/intro.md
@@ -2,6 +2,16 @@
 title: "CoAP"
 symbol_kind: "intro"
 decl_name: "coap.h"
+items:
+  - { type: file, name: mg_set_protocol_coap.md }
+  - { type: file, name: mg_coap_add_option.md }
+  - { type: file, name: mg_coap_free_options.md }
+  - { type: file, name: mg_coap_send_message.md }
+  - { type: file, name: mg_coap_send_ack.md }
+  - { type: file, name: mg_coap_parse.md }
+  - { type: file, name: mg_coap_compose.md }
+  - { type: file, name: struct_mg_coap_option.md }
+  - { type: file, name: struct_mg_coap_message.md }
 ---
 
 CoAP message format:
diff --git a/docs/c-api/coap.h/items.json b/docs/c-api/coap.h/items.json
deleted file mode 100644
index de1889c40..000000000
--- a/docs/c-api/coap.h/items.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_set_protocol_coap.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_coap_add_option.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_coap_free_options.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_coap_send_message.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_coap_send_ack.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_coap_parse.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_coap_compose.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_coap_option.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_coap_message.md"
-        }
-    ]
-}
diff --git a/docs/c-api/dns-server.h/intro.md b/docs/c-api/dns-server.h/intro.md
index 8ac224dd1..50f967958 100644
--- a/docs/c-api/dns-server.h/intro.md
+++ b/docs/c-api/dns-server.h/intro.md
@@ -2,6 +2,10 @@
 title: "DNS server"
 symbol_kind: "intro"
 decl_name: "dns-server.h"
+items:
+  - { type: file, name: mg_dns_create_reply.md }
+  - { type: file, name: mg_dns_reply_record.md }
+  - { type: file, name: mg_dns_send_reply.md }
 ---
 
 Disabled by default; enable with `-DMG_ENABLE_DNS_SERVER`.
diff --git a/docs/c-api/dns-server.h/items.json b/docs/c-api/dns-server.h/items.json
deleted file mode 100644
index feea0c960..000000000
--- a/docs/c-api/dns-server.h/items.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_create_reply.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_reply_record.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_send_reply.md"
-        }
-    ]
-}
diff --git a/docs/c-api/dns.h/intro.md b/docs/c-api/dns.h/intro.md
index d9522b18e..c36f5b75f 100644
--- a/docs/c-api/dns.h/intro.md
+++ b/docs/c-api/dns.h/intro.md
@@ -2,6 +2,17 @@
 title: "DNS"
 symbol_kind: "intro"
 decl_name: "dns.h"
+items:
+  - { type: file, name: mg_dns_parse_record_data.md }
+  - { type: file, name: mg_send_dns_query.md }
+  - { type: file, name: mg_dns_insert_header.md }
+  - { type: file, name: mg_dns_copy_questions.md }
+  - { type: file, name: mg_dns_encode_record.md }
+  - { type: file, name: mg_parse_dns.md }
+  - { type: file, name: mg_dns_uncompress_name.md }
+  - { type: file, name: mg_set_protocol_dns.md }
+  - { type: file, name: struct_mg_dns_resource_record.md }
+  - { type: file, name: struct_mg_dns_message.md }
 ---
 
 
diff --git a/docs/c-api/dns.h/items.json b/docs/c-api/dns.h/items.json
deleted file mode 100644
index 8d21dd80d..000000000
--- a/docs/c-api/dns.h/items.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_parse_record_data.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_dns_query.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_insert_header.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_copy_questions.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_encode_record.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_parse_dns.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_dns_uncompress_name.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_set_protocol_dns.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_dns_resource_record.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_dns_message.md"
-        }
-    ]
-}
diff --git a/docs/c-api/http.h/intro.md b/docs/c-api/http.h/intro.md
index 730204713..c8f196638 100644
--- a/docs/c-api/http.h/intro.md
+++ b/docs/c-api/http.h/intro.md
@@ -2,6 +2,38 @@
 title: "HTTP + Websocket"
 symbol_kind: "intro"
 decl_name: "http.h"
+items:
+  - { type: file, name: mg_set_protocol_http_websocket.md }
+  - { type: file, name: mg_send_websocket_handshake.md }
+  - { type: file, name: mg_send_websocket_handshake2.md }
+  - { type: file, name: mg_connect_ws.md }
+  - { type: file, name: mg_connect_ws_opt.md }
+  - { type: file, name: mg_send_websocket_frame.md }
+  - { type: file, name: mg_send_websocket_framev.md }
+  - { type: file, name: mg_printf_websocket_frame.md }
+  - { type: file, name: mg_send_http_chunk.md }
+  - { type: file, name: mg_printf_http_chunk.md }
+  - { type: file, name: mg_send_response_line.md }
+  - { type: file, name: mg_send_head.md }
+  - { type: file, name: mg_printf_html_escape.md }
+  - { type: file, name: mg_parse_http.md }
+  - { type: file, name: mg_get_http_header.md }
+  - { type: file, name: mg_http_parse_header.md }
+  - { type: file, name: mg_parse_multipart.md }
+  - { type: file, name: mg_get_http_var.md }
+  - { type: file, name: mg_url_decode.md }
+  - { type: file, name: mg_http_create_digest_auth_header.md }
+  - { type: file, name: mg_connect_http.md }
+  - { type: file, name: mg_connect_http_opt.md }
+  - { type: file, name: mg_serve_http.md }
+  - { type: file, name: mg_register_http_endpoint.md }
+  - { type: file, name: mg_file_upload_handler.md }
+  - { type: file, name: mg_http_check_digest_auth.md }
+  - { type: file, name: mg_fu_fname_fn.md }
+  - { type: file, name: struct_http_message.md }
+  - { type: file, name: struct_websocket_message.md }
+  - { type: file, name: struct_mg_http_multipart_part.md }
+  - { type: file, name: struct_mg_serve_http_opts.md }
 ---
 
 
diff --git a/docs/c-api/http.h/items.json b/docs/c-api/http.h/items.json
deleted file mode 100644
index f509ed319..000000000
--- a/docs/c-api/http.h/items.json
+++ /dev/null
@@ -1,132 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_set_protocol_http_websocket.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_websocket_handshake.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_websocket_handshake2.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_connect_ws.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_connect_ws_opt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_websocket_frame.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_websocket_framev.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_printf_websocket_frame.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_http_chunk.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_printf_http_chunk.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_response_line.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_head.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_printf_html_escape.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_parse_http.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_get_http_header.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_http_parse_header.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_parse_multipart.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_get_http_var.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_url_decode.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_http_create_digest_auth_header.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_connect_http.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_connect_http_opt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_serve_http.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_register_http_endpoint.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_file_upload_handler.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_http_check_digest_auth.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_fu_fname_fn.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_http_message.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_websocket_message.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_http_multipart_part.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_serve_http_opts.md"
-        }
-    ]
-}
diff --git a/docs/c-api/intro.md b/docs/c-api/intro.md
new file mode 100644
index 000000000..cadbb453d
--- /dev/null
+++ b/docs/c-api/intro.md
@@ -0,0 +1,13 @@
+---
+items:
+  - { type: dir, name: mbuf.h }
+  - { type: dir, name: net.h }
+  - { type: dir, name: http.h }
+  - { type: dir, name: json-rpc.h }
+  - { type: dir, name: dns.h }
+  - { type: dir, name: dns-server.h }
+  - { type: dir, name: mqtt.h }
+  - { type: dir, name: mqtt-broker.h }
+  - { type: dir, name: coap.h }
+  - { type: dir, name: util.h }
+---
diff --git a/docs/c-api/items.json b/docs/c-api/items.json
deleted file mode 100644
index 1133954a5..000000000
--- a/docs/c-api/items.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "items": [
-        {
-            "type": "section",
-            "name": "mbuf.h"
-        },
-        {
-            "type": "section",
-            "name": "net.h"
-        },
-        {
-            "type": "section",
-            "name": "http.h"
-        },
-        {
-            "type": "section",
-            "name": "json-rpc.h"
-        },
-        {
-            "type": "section",
-            "name": "dns.h"
-        },
-        {
-            "type": "section",
-            "name": "dns-server.h"
-        },
-        {
-            "type": "section",
-            "name": "mqtt.h"
-        },
-        {
-            "type": "section",
-            "name": "mqtt-broker.h"
-        },
-        {
-            "type": "section",
-            "name": "coap.h"
-        },
-        {
-            "type": "section",
-            "name": "util.h"
-        }
-    ]
-}
diff --git a/docs/c-api/json-rpc.h/intro.md b/docs/c-api/json-rpc.h/intro.md
index 8d04b6232..6cd9a81f1 100644
--- a/docs/c-api/json-rpc.h/intro.md
+++ b/docs/c-api/json-rpc.h/intro.md
@@ -2,6 +2,16 @@
 title: "JSON-RPC"
 symbol_kind: "intro"
 decl_name: "json-rpc.h"
+items:
+  - { type: file, name: mg_rpc_parse_reply.md }
+  - { type: file, name: mg_rpc_create_request.md }
+  - { type: file, name: mg_rpc_create_reply.md }
+  - { type: file, name: mg_rpc_create_error.md }
+  - { type: file, name: mg_rpc_create_std_error.md }
+  - { type: file, name: mg_rpc_dispatch.md }
+  - { type: file, name: struct_mg_rpc_request.md }
+  - { type: file, name: struct_mg_rpc_reply.md }
+  - { type: file, name: struct_mg_rpc_error.md }
 ---
 
 
diff --git a/docs/c-api/json-rpc.h/items.json b/docs/c-api/json-rpc.h/items.json
deleted file mode 100644
index 6fc301768..000000000
--- a/docs/c-api/json-rpc.h/items.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_rpc_parse_reply.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_rpc_create_request.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_rpc_create_reply.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_rpc_create_error.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_rpc_create_std_error.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_rpc_dispatch.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_rpc_request.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_rpc_reply.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_rpc_error.md"
-        }
-    ]
-}
diff --git a/docs/c-api/mbuf.h/intro.md b/docs/c-api/mbuf.h/intro.md
index 49c6b7fc8..4c366d00c 100644
--- a/docs/c-api/mbuf.h/intro.md
+++ b/docs/c-api/mbuf.h/intro.md
@@ -2,6 +2,15 @@
 title: "Memory Buffers"
 symbol_kind: "intro"
 decl_name: "mbuf.h"
+items:
+  - { type: file, name: mbuf_init.md }
+  - { type: file, name: mbuf_free.md }
+  - { type: file, name: mbuf_append.md }
+  - { type: file, name: mbuf_insert.md }
+  - { type: file, name: mbuf_remove.md }
+  - { type: file, name: mbuf_resize.md }
+  - { type: file, name: mbuf_trim.md }
+  - { type: file, name: struct_mbuf.md }
 ---
 
 Mbufs are mutable/growing memory buffers, like C++ strings.
diff --git a/docs/c-api/mbuf.h/items.json b/docs/c-api/mbuf.h/items.json
deleted file mode 100644
index 9f5f2123a..000000000
--- a/docs/c-api/mbuf.h/items.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_init.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_free.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_append.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_insert.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_remove.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_resize.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mbuf_trim.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mbuf.md"
-        }
-    ]
-}
diff --git a/docs/c-api/mqtt-broker.h/intro.md b/docs/c-api/mqtt-broker.h/intro.md
index 592ccbc4b..621b3f640 100644
--- a/docs/c-api/mqtt-broker.h/intro.md
+++ b/docs/c-api/mqtt-broker.h/intro.md
@@ -2,6 +2,12 @@
 title: "MQTT Broker"
 symbol_kind: "intro"
 decl_name: "mqtt-broker.h"
+items:
+  - { type: file, name: mg_mqtt_broker_init.md }
+  - { type: file, name: mg_mqtt_broker.md }
+  - { type: file, name: mg_mqtt_next.md }
+  - { type: file, name: struct_mg_mqtt_session.md }
+  - { type: file, name: struct_mg_mqtt_broker.md }
 ---
 
 
diff --git a/docs/c-api/mqtt-broker.h/items.json b/docs/c-api/mqtt-broker.h/items.json
deleted file mode 100644
index 2908ffbb4..000000000
--- a/docs/c-api/mqtt-broker.h/items.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_broker_init.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_broker.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_next.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_mqtt_session.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_mqtt_broker.md"
-        }
-    ]
-}
diff --git a/docs/c-api/mqtt.h/intro.md b/docs/c-api/mqtt.h/intro.md
index 55117eee2..d8a6aba8a 100644
--- a/docs/c-api/mqtt.h/intro.md
+++ b/docs/c-api/mqtt.h/intro.md
@@ -2,6 +2,25 @@
 title: "MQTT"
 symbol_kind: "intro"
 decl_name: "mqtt.h"
+items:
+  - { type: file, name: mg_set_protocol_mqtt.md }
+  - { type: file, name: mg_send_mqtt_handshake.md }
+  - { type: file, name: mg_send_mqtt_handshake_opt.md }
+  - { type: file, name: mg_mqtt_publish.md }
+  - { type: file, name: mg_mqtt_subscribe.md }
+  - { type: file, name: mg_mqtt_unsubscribe.md }
+  - { type: file, name: mg_mqtt_disconnect.md }
+  - { type: file, name: mg_mqtt_connack.md }
+  - { type: file, name: mg_mqtt_puback.md }
+  - { type: file, name: mg_mqtt_pubrec.md }
+  - { type: file, name: mg_mqtt_pubrel.md }
+  - { type: file, name: mg_mqtt_pubcomp.md }
+  - { type: file, name: mg_mqtt_suback.md }
+  - { type: file, name: mg_mqtt_unsuback.md }
+  - { type: file, name: mg_mqtt_ping.md }
+  - { type: file, name: mg_mqtt_pong.md }
+  - { type: file, name: mg_mqtt_next_subscribe_topic.md }
+  - { type: file, name: struct_mg_mqtt_topic_expression.md }
 ---
 
 
diff --git a/docs/c-api/mqtt.h/items.json b/docs/c-api/mqtt.h/items.json
deleted file mode 100644
index b77926f70..000000000
--- a/docs/c-api/mqtt.h/items.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_set_protocol_mqtt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_mqtt_handshake.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send_mqtt_handshake_opt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_publish.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_subscribe.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_unsubscribe.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_disconnect.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_connack.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_puback.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_pubrec.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_pubrel.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_pubcomp.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_suback.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_unsuback.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_ping.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_pong.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mqtt_next_subscribe_topic.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_mqtt_topic_expression.md"
-        }
-    ]
-}
diff --git a/docs/c-api/net.h/intro.md b/docs/c-api/net.h/intro.md
index bb03baccc..bad4f7fd8 100644
--- a/docs/c-api/net.h/intro.md
+++ b/docs/c-api/net.h/intro.md
@@ -2,6 +2,35 @@
 title: "Core: TCP/UDP/SSL"
 symbol_kind: "intro"
 decl_name: "net.h"
+items:
+  - { type: file, name: mg_mgr_init.md }
+  - { type: file, name: mg_mgr_free.md }
+  - { type: file, name: mg_mgr_poll.md }
+  - { type: file, name: mg_broadcast.md }
+  - { type: file, name: mg_next.md }
+  - { type: file, name: mg_add_sock.md }
+  - { type: file, name: mg_add_sock_opt.md }
+  - { type: file, name: mg_bind.md }
+  - { type: file, name: mg_bind_opt.md }
+  - { type: file, name: mg_connect.md }
+  - { type: file, name: mg_connect_opt.md }
+  - { type: file, name: mg_set_ssl.md }
+  - { type: file, name: mg_send.md }
+  - { type: file, name: mg_printf.md }
+  - { type: file, name: mg_vprintf.md }
+  - { type: file, name: mg_socketpair.md }
+  - { type: file, name: mg_check_ip_acl.md }
+  - { type: file, name: mg_enable_multithreading.md }
+  - { type: file, name: mg_enable_javascript.md }
+  - { type: file, name: mg_set_timer.md }
+  - { type: file, name: mg_time.md }
+  - { type: file, name: mg_event_handler_t.md }
+  - { type: file, name: struct_mg_str.md }
+  - { type: file, name: struct_mg_mgr.md }
+  - { type: file, name: struct_mg_connection.md }
+  - { type: file, name: struct_mg_add_sock_opts.md }
+  - { type: file, name: struct_mg_bind_opts.md }
+  - { type: file, name: struct_mg_connect_opts.md }
 ---
 
 NOTE: Mongoose manager is single threaded. It does not protect
diff --git a/docs/c-api/net.h/items.json b/docs/c-api/net.h/items.json
deleted file mode 100644
index 8a8e54689..000000000
--- a/docs/c-api/net.h/items.json
+++ /dev/null
@@ -1,120 +0,0 @@
-{
-    "items": [
-        {
-            "type": "markdown",
-            "name": "intro.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mgr_init.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mgr_free.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_mgr_poll.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_broadcast.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_next.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_add_sock.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_add_sock_opt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_bind.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_bind_opt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_connect.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_connect_opt.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_set_ssl.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_send.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_printf.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_vprintf.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_socketpair.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_check_ip_acl.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_enable_multithreading.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_enable_javascript.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_set_timer.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_time.md"
-        },
-        {
-            "type": "markdown",
-            "name": "mg_event_handler_t.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_str.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_mgr.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_connection.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_add_sock_opts.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_bind_opts.md"
-        },
-        {
-            "type": "markdown",
-            "name": "struct_mg_connect_opts.md"
-        }
-    ]
-}
diff --git a/docs/c-api/util.h/intro.md b/docs/c-api/util.h/intro.md
index 3b516c8a7..a3237a11e 100644
--- a/docs/c-api/util.h/intro.md
+++ b/docs/c-api/util.h/intro.md
@@ -2,6 +2,29 @@
 title: "Utilities"
 symbol_kind: "intro"
 decl_name: "util.h"
+items:
+  - { type: file, name: mg_skip.md }
+  - { type: file, name: mg_ncasecmp.md }
+  - { type: file, name: mg_casecmp.md }
+  - { type: file, name: mg_vcmp.md }
+  - { type: file, name: mg_vcasecmp.md }
+  - { type: file, name: mg_base64_decode.md }
+  - { type: file, name: mg_base64_encode.md }
+  - { type: file, name: mg_stat.md }
+  - { type: file, name: mg_fopen.md }
+  - { type: file, name: mg_open.md }
+  - { type: file, name: mg_start_thread.md }
+  - { type: file, name: mg_conn_addr_to_str.md }
+  - { type: file, name: mg_sock_to_str.md }
+  - { type: file, name: mg_sock_addr_to_str.md }
+  - { type: file, name: mg_hexdump.md }
+  - { type: file, name: mg_hexdump_connection.md }
+  - { type: file, name: mg_avprintf.md }
+  - { type: file, name: mg_is_big_endian.md }
+  - { type: file, name: mg_next_comma_list_entry.md }
+  - { type: file, name: mg_match_prefix.md }
+  - { type: file, name: mg_mk_str.md }
+  - { type: file, name: MG_MK_STR.md }
 ---
 
 
diff --git a/docs/c-api/util.h/items.json b/docs/c-api/util.h/items.json
deleted file mode 100644
index 4b5b52e01..000000000
--- a/docs/c-api/util.h/items.json
+++ /dev/null
@@ -1,96 +0,0 @@
-{
-    "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"
-        }
-    ]
-}
-- 
GitLab