فهرست منبع

Merge topic 'update-nghttp2'

cda59e2c78 nghttp2: Update build within CMake to account for 1.68.0
2fed08224c Merge branch 'upstream-nghttp2' into update-nghttp2
797e3062b7 nghttp2 2025-10-25 (534b74b7)
c201fec766 nghttp2: Update script to get nghttp2 1.68.0

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !11689
Brad King 1 هفته پیش
والد
کامیت
91db2be3a1
53فایلهای تغییر یافته به همراه9515 افزوده شده و 8525 حذف شده
  1. 2 2
      Utilities/Scripts/update-nghttp2.bash
  2. 4 1
      Utilities/cmnghttp2/CMakeLists.txt
  3. 483 93
      Utilities/cmnghttp2/lib/includes/nghttp2/nghttp2.h
  4. 2 2
      Utilities/cmnghttp2/lib/includes/nghttp2/nghttp2ver.h
  5. 21 8
      Utilities/cmnghttp2/lib/nghttp2_alpn.c
  6. 4 4
      Utilities/cmnghttp2/lib/nghttp2_alpn.h
  7. 4 4
      Utilities/cmnghttp2/lib/nghttp2_buf.c
  8. 3 3
      Utilities/cmnghttp2/lib/nghttp2_buf.h
  9. 75 42
      Utilities/cmnghttp2/lib/nghttp2_callbacks.c
  10. 41 9
      Utilities/cmnghttp2/lib/nghttp2_callbacks.h
  11. 5 5
      Utilities/cmnghttp2/lib/nghttp2_debug.c
  12. 4 4
      Utilities/cmnghttp2/lib/nghttp2_debug.h
  13. 6 0
      Utilities/cmnghttp2/lib/nghttp2_extpri.c
  14. 3 3
      Utilities/cmnghttp2/lib/nghttp2_extpri.h
  15. 22 39
      Utilities/cmnghttp2/lib/nghttp2_frame.c
  16. 17 49
      Utilities/cmnghttp2/lib/nghttp2_frame.h
  17. 173 142
      Utilities/cmnghttp2/lib/nghttp2_hd.c
  18. 13 11
      Utilities/cmnghttp2/lib/nghttp2_hd.h
  19. 8 6
      Utilities/cmnghttp2/lib/nghttp2_hd_huffman.c
  20. 2 2
      Utilities/cmnghttp2/lib/nghttp2_hd_huffman.h
  21. 4948 4948
      Utilities/cmnghttp2/lib/nghttp2_hd_huffman_data.c
  22. 389 387
      Utilities/cmnghttp2/lib/nghttp2_helper.c
  23. 28 5
      Utilities/cmnghttp2/lib/nghttp2_helper.h
  24. 112 695
      Utilities/cmnghttp2/lib/nghttp2_http.c
  25. 2 50
      Utilities/cmnghttp2/lib/nghttp2_http.h
  26. 7 3
      Utilities/cmnghttp2/lib/nghttp2_int.h
  27. 139 138
      Utilities/cmnghttp2/lib/nghttp2_map.c
  28. 31 44
      Utilities/cmnghttp2/lib/nghttp2_map.h
  29. 2 2
      Utilities/cmnghttp2/lib/nghttp2_mem.h
  30. 8 8
      Utilities/cmnghttp2/lib/nghttp2_net.h
  31. 22 3
      Utilities/cmnghttp2/lib/nghttp2_option.c
  32. 19 2
      Utilities/cmnghttp2/lib/nghttp2_option.h
  33. 26 0
      Utilities/cmnghttp2/lib/nghttp2_outbound_item.c
  34. 27 4
      Utilities/cmnghttp2/lib/nghttp2_outbound_item.h
  35. 1 1
      Utilities/cmnghttp2/lib/nghttp2_pq.c
  36. 2 2
      Utilities/cmnghttp2/lib/nghttp2_pq.h
  37. 2 2
      Utilities/cmnghttp2/lib/nghttp2_priority_spec.h
  38. 1 1
      Utilities/cmnghttp2/lib/nghttp2_queue.c
  39. 2 2
      Utilities/cmnghttp2/lib/nghttp2_queue.h
  40. 75 0
      Utilities/cmnghttp2/lib/nghttp2_ratelim.c
  41. 57 0
      Utilities/cmnghttp2/lib/nghttp2_ratelim.h
  42. 2 2
      Utilities/cmnghttp2/lib/nghttp2_rcbuf.h
  43. 147 504
      Utilities/cmnghttp2/lib/nghttp2_session.c
  44. 50 119
      Utilities/cmnghttp2/lib/nghttp2_session.h
  45. 34 827
      Utilities/cmnghttp2/lib/nghttp2_stream.c
  46. 18 174
      Utilities/cmnghttp2/lib/nghttp2_stream.h
  47. 134 170
      Utilities/cmnghttp2/lib/nghttp2_submit.c
  48. 8 2
      Utilities/cmnghttp2/lib/nghttp2_submit.h
  49. 62 0
      Utilities/cmnghttp2/lib/nghttp2_time.c
  50. 38 0
      Utilities/cmnghttp2/lib/nghttp2_time.h
  51. 1 1
      Utilities/cmnghttp2/lib/nghttp2_version.c
  52. 1787 0
      Utilities/cmnghttp2/lib/sfparse.c
  53. 442 0
      Utilities/cmnghttp2/lib/sfparse.h

+ 2 - 2
Utilities/Scripts/update-nghttp2.bash

@@ -8,7 +8,7 @@ readonly name="nghttp2"
 readonly ownership="nghttp2 upstream <[email protected]>"
 readonly subtree="Utilities/cmnghttp2"
 readonly repo="https://github.com/nghttp2/nghttp2.git"
-readonly tag="v1.52.0" # When updating, sync PACKAGE_VERSION below!
+readonly tag="v1.68.0" # When updating, sync PACKAGE_VERSION below!
 readonly shortlog=false
 readonly exact_tree_match=false
 readonly paths="
@@ -24,7 +24,7 @@ extract_source () {
     pushd "${extractdir}/${name}-reduced"
     echo "* -whitespace" > .gitattributes
     mv lib/includes/nghttp2/nghttp2ver.h.in lib/includes/nghttp2/nghttp2ver.h
-    sed -i 's/@PACKAGE_VERSION@/1.52.0/;s/@PACKAGE_VERSION_NUM@/0x013400/' lib/includes/nghttp2/nghttp2ver.h
+    sed -i 's/@PACKAGE_VERSION@/1.68.0/;s/@PACKAGE_VERSION_NUM@/0x014400/' lib/includes/nghttp2/nghttp2ver.h
     popd
 }
 

+ 4 - 1
Utilities/cmnghttp2/CMakeLists.txt

@@ -16,6 +16,7 @@ endif()
 configure_file(cmakeconfig.h.in config.h)
 
 add_library(cmnghttp2 STATIC
+  lib/nghttp2_alpn.c
   lib/nghttp2_buf.c
   lib/nghttp2_callbacks.c
   lib/nghttp2_debug.c
@@ -28,17 +29,19 @@ add_library(cmnghttp2 STATIC
   lib/nghttp2_http.c
   lib/nghttp2_map.c
   lib/nghttp2_mem.c
-  lib/nghttp2_npn.c
   lib/nghttp2_option.c
   lib/nghttp2_outbound_item.c
   lib/nghttp2_pq.c
   lib/nghttp2_priority_spec.c
   lib/nghttp2_queue.c
+  lib/nghttp2_ratelim.c
   lib/nghttp2_rcbuf.c
   lib/nghttp2_session.c
   lib/nghttp2_stream.c
   lib/nghttp2_submit.c
+  lib/nghttp2_time.c
   lib/nghttp2_version.c
+  lib/sfparse.c
   )
 
 target_compile_definitions(cmnghttp2

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 483 - 93
Utilities/cmnghttp2/lib/includes/nghttp2/nghttp2.h


+ 2 - 2
Utilities/cmnghttp2/lib/includes/nghttp2/nghttp2ver.h

@@ -29,7 +29,7 @@
  * @macro
  * Version number of the nghttp2 library release
  */
-#define NGHTTP2_VERSION "1.52.0"
+#define NGHTTP2_VERSION "1.68.0"
 
 /**
  * @macro
@@ -37,6 +37,6 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define NGHTTP2_VERSION_NUM 0x013400
+#define NGHTTP2_VERSION_NUM 0x014400
 
 #endif /* NGHTTP2VER_H */

+ 21 - 8
Utilities/cmnghttp2/lib/nghttp2_npn.c → Utilities/cmnghttp2/lib/nghttp2_alpn.c

@@ -22,13 +22,13 @@
  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "nghttp2_npn.h"
+#include "nghttp2_alpn.h"
 
 #include <string.h>
 
-static int select_next_protocol(unsigned char **out, unsigned char *outlen,
-                                const unsigned char *in, unsigned int inlen,
-                                const char *key, unsigned int keylen) {
+static int select_alpn(const unsigned char **out, unsigned char *outlen,
+                       const unsigned char *in, unsigned int inlen,
+                       const char *key, unsigned int keylen) {
   unsigned int i;
   for (i = 0; i + keylen <= inlen; i += (unsigned int)(in[i] + 1)) {
     if (memcmp(&in[i], key, keylen) == 0) {
@@ -45,12 +45,25 @@ static int select_next_protocol(unsigned char **out, unsigned char *outlen,
 
 int nghttp2_select_next_protocol(unsigned char **out, unsigned char *outlen,
                                  const unsigned char *in, unsigned int inlen) {
-  if (select_next_protocol(out, outlen, in, inlen, NGHTTP2_PROTO_ALPN,
-                           NGHTTP2_PROTO_ALPN_LEN) == 0) {
+  if (select_alpn((const unsigned char **)out, outlen, in, inlen,
+                  NGHTTP2_PROTO_ALPN, NGHTTP2_PROTO_ALPN_LEN) == 0) {
     return 1;
   }
-  if (select_next_protocol(out, outlen, in, inlen, NGHTTP2_HTTP_1_1_ALPN,
-                           NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) {
+  if (select_alpn((const unsigned char **)out, outlen, in, inlen,
+                  NGHTTP2_HTTP_1_1_ALPN, NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) {
+    return 0;
+  }
+  return -1;
+}
+
+int nghttp2_select_alpn(const unsigned char **out, unsigned char *outlen,
+                        const unsigned char *in, unsigned int inlen) {
+  if (select_alpn(out, outlen, in, inlen, NGHTTP2_PROTO_ALPN,
+                  NGHTTP2_PROTO_ALPN_LEN) == 0) {
+    return 1;
+  }
+  if (select_alpn(out, outlen, in, inlen, NGHTTP2_HTTP_1_1_ALPN,
+                  NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) {
     return 0;
   }
   return -1;

+ 4 - 4
Utilities/cmnghttp2/lib/nghttp2_npn.h → Utilities/cmnghttp2/lib/nghttp2_alpn.h

@@ -22,13 +22,13 @@
  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-#ifndef NGHTTP2_NPN_H
-#define NGHTTP2_NPN_H
+#ifndef NGHTTP2_ALPN_H
+#define NGHTTP2_ALPN_H
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
-#endif /* NGHTTP2_NPN_H */
+#endif /* !defined(NGHTTP2_ALPN_H) */

+ 4 - 4
Utilities/cmnghttp2/lib/nghttp2_buf.c

@@ -65,7 +65,7 @@ int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap, nghttp2_mem *mem) {
     return 0;
   }
 
-  new_cap = nghttp2_max(new_cap, cap * 2);
+  new_cap = nghttp2_max_size(new_cap, cap * 2);
 
   ptr = nghttp2_mem_realloc(mem, buf->begin, new_cap);
   if (ptr == NULL) {
@@ -347,7 +347,7 @@ int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len) {
   while (len) {
     buf = &bufs->cur->buf;
 
-    nwrite = nghttp2_min(nghttp2_buf_avail(buf), len);
+    nwrite = nghttp2_min_size(nghttp2_buf_avail(buf), len);
     if (nwrite == 0) {
       rv = bufs_alloc_chain(bufs);
       if (rv != 0) {
@@ -446,7 +446,7 @@ int nghttp2_bufs_orb_hold(nghttp2_bufs *bufs, uint8_t b) {
   return 0;
 }
 
-ssize_t nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out) {
+nghttp2_ssize nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out) {
   size_t len;
   nghttp2_buf_chain *chain;
   nghttp2_buf *buf;
@@ -478,7 +478,7 @@ ssize_t nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out) {
 
   *out = res;
 
-  return (ssize_t)len;
+  return (nghttp2_ssize)len;
 }
 
 size_t nghttp2_bufs_remove_copy(nghttp2_bufs *bufs, uint8_t *out) {

+ 3 - 3
Utilities/cmnghttp2/lib/nghttp2_buf.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -349,7 +349,7 @@ int nghttp2_bufs_orb_hold(nghttp2_bufs *bufs, uint8_t b);
  * NGHTTP2_ERR_NOMEM
  *     Out of memory
  */
-ssize_t nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out);
+nghttp2_ssize nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out);
 
 /*
  * Copies all data stored in |bufs| to |out|.  This function assumes
@@ -409,4 +409,4 @@ int nghttp2_bufs_next_present(nghttp2_bufs *bufs);
  */
 size_t nghttp2_bufs_len(nghttp2_bufs *bufs);
 
-#endif /* NGHTTP2_BUF_H */
+#endif /* !defined(NGHTTP2_BUF_H) */

+ 75 - 42
Utilities/cmnghttp2/lib/nghttp2_callbacks.c

@@ -41,135 +41,168 @@ void nghttp2_session_callbacks_del(nghttp2_session_callbacks *callbacks) {
 }
 
 void nghttp2_session_callbacks_set_send_callback(
-    nghttp2_session_callbacks *cbs, nghttp2_send_callback send_callback) {
+  nghttp2_session_callbacks *cbs, nghttp2_send_callback send_callback) {
   cbs->send_callback = send_callback;
 }
 
+void nghttp2_session_callbacks_set_send_callback2(
+  nghttp2_session_callbacks *cbs, nghttp2_send_callback2 send_callback) {
+  cbs->send_callback2 = send_callback;
+}
+
 void nghttp2_session_callbacks_set_recv_callback(
-    nghttp2_session_callbacks *cbs, nghttp2_recv_callback recv_callback) {
+  nghttp2_session_callbacks *cbs, nghttp2_recv_callback recv_callback) {
   cbs->recv_callback = recv_callback;
 }
 
+void nghttp2_session_callbacks_set_recv_callback2(
+  nghttp2_session_callbacks *cbs, nghttp2_recv_callback2 recv_callback) {
+  cbs->recv_callback2 = recv_callback;
+}
+
 void nghttp2_session_callbacks_set_on_frame_recv_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_frame_recv_callback on_frame_recv_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_frame_recv_callback on_frame_recv_callback) {
   cbs->on_frame_recv_callback = on_frame_recv_callback;
 }
 
 void nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback) {
   cbs->on_invalid_frame_recv_callback = on_invalid_frame_recv_callback;
 }
 
 void nghttp2_session_callbacks_set_on_data_chunk_recv_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_data_chunk_recv_callback on_data_chunk_recv_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_data_chunk_recv_callback on_data_chunk_recv_callback) {
   cbs->on_data_chunk_recv_callback = on_data_chunk_recv_callback;
 }
 
 void nghttp2_session_callbacks_set_before_frame_send_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_before_frame_send_callback before_frame_send_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_before_frame_send_callback before_frame_send_callback) {
   cbs->before_frame_send_callback = before_frame_send_callback;
 }
 
 void nghttp2_session_callbacks_set_on_frame_send_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_frame_send_callback on_frame_send_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_frame_send_callback on_frame_send_callback) {
   cbs->on_frame_send_callback = on_frame_send_callback;
 }
 
 void nghttp2_session_callbacks_set_on_frame_not_send_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_frame_not_send_callback on_frame_not_send_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_frame_not_send_callback on_frame_not_send_callback) {
   cbs->on_frame_not_send_callback = on_frame_not_send_callback;
 }
 
 void nghttp2_session_callbacks_set_on_stream_close_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_stream_close_callback on_stream_close_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_stream_close_callback on_stream_close_callback) {
   cbs->on_stream_close_callback = on_stream_close_callback;
 }
 
 void nghttp2_session_callbacks_set_on_begin_headers_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_begin_headers_callback on_begin_headers_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_begin_headers_callback on_begin_headers_callback) {
   cbs->on_begin_headers_callback = on_begin_headers_callback;
 }
 
 void nghttp2_session_callbacks_set_on_header_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_header_callback on_header_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_header_callback on_header_callback) {
   cbs->on_header_callback = on_header_callback;
 }
 
 void nghttp2_session_callbacks_set_on_header_callback2(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_header_callback2 on_header_callback2) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_header_callback2 on_header_callback2) {
   cbs->on_header_callback2 = on_header_callback2;
 }
 
 void nghttp2_session_callbacks_set_on_invalid_header_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_invalid_header_callback on_invalid_header_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_invalid_header_callback on_invalid_header_callback) {
   cbs->on_invalid_header_callback = on_invalid_header_callback;
 }
 
 void nghttp2_session_callbacks_set_on_invalid_header_callback2(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_invalid_header_callback2 on_invalid_header_callback2) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_invalid_header_callback2 on_invalid_header_callback2) {
   cbs->on_invalid_header_callback2 = on_invalid_header_callback2;
 }
 
 void nghttp2_session_callbacks_set_select_padding_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_select_padding_callback select_padding_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_select_padding_callback select_padding_callback) {
   cbs->select_padding_callback = select_padding_callback;
 }
 
+void nghttp2_session_callbacks_set_select_padding_callback2(
+  nghttp2_session_callbacks *cbs,
+  nghttp2_select_padding_callback2 select_padding_callback) {
+  cbs->select_padding_callback2 = select_padding_callback;
+}
+
 void nghttp2_session_callbacks_set_data_source_read_length_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_data_source_read_length_callback data_source_read_length_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_data_source_read_length_callback data_source_read_length_callback) {
   cbs->read_length_callback = data_source_read_length_callback;
 }
 
+void nghttp2_session_callbacks_set_data_source_read_length_callback2(
+  nghttp2_session_callbacks *cbs,
+  nghttp2_data_source_read_length_callback2 data_source_read_length_callback) {
+  cbs->read_length_callback2 = data_source_read_length_callback;
+}
+
 void nghttp2_session_callbacks_set_on_begin_frame_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_begin_frame_callback on_begin_frame_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_begin_frame_callback on_begin_frame_callback) {
   cbs->on_begin_frame_callback = on_begin_frame_callback;
 }
 
 void nghttp2_session_callbacks_set_send_data_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_send_data_callback send_data_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_send_data_callback send_data_callback) {
   cbs->send_data_callback = send_data_callback;
 }
 
 void nghttp2_session_callbacks_set_pack_extension_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_pack_extension_callback pack_extension_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_pack_extension_callback pack_extension_callback) {
   cbs->pack_extension_callback = pack_extension_callback;
 }
 
+void nghttp2_session_callbacks_set_pack_extension_callback2(
+  nghttp2_session_callbacks *cbs,
+  nghttp2_pack_extension_callback2 pack_extension_callback) {
+  cbs->pack_extension_callback2 = pack_extension_callback;
+}
+
 void nghttp2_session_callbacks_set_unpack_extension_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_unpack_extension_callback unpack_extension_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_unpack_extension_callback unpack_extension_callback) {
   cbs->unpack_extension_callback = unpack_extension_callback;
 }
 
 void nghttp2_session_callbacks_set_on_extension_chunk_recv_callback(
-    nghttp2_session_callbacks *cbs,
-    nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback) {
+  nghttp2_session_callbacks *cbs,
+  nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback) {
   cbs->on_extension_chunk_recv_callback = on_extension_chunk_recv_callback;
 }
 
 void nghttp2_session_callbacks_set_error_callback(
-    nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback) {
+  nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback) {
   cbs->error_callback = error_callback;
 }
 
 void nghttp2_session_callbacks_set_error_callback2(
-    nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2) {
+  nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2) {
   cbs->error_callback2 = error_callback2;
 }
+
+void nghttp2_session_callbacks_set_rand_callback(
+  nghttp2_session_callbacks *cbs, nghttp2_rand_callback rand_callback) {
+  cbs->rand_callback = rand_callback;
+}

+ 41 - 9
Utilities/cmnghttp2/lib/nghttp2_callbacks.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -35,20 +35,34 @@
  * Callback functions.
  */
 struct nghttp2_session_callbacks {
+  /**
+   * Deprecated.  Use send_callback2 instead.  Callback function
+   * invoked when the session wants to send data to the remote peer.
+   * This callback is not necessary if the application uses solely
+   * `nghttp2_session_mem_send()` to serialize data to transmit.
+   */
+  nghttp2_send_callback send_callback;
   /**
    * Callback function invoked when the session wants to send data to
    * the remote peer.  This callback is not necessary if the
-   * application uses solely `nghttp2_session_mem_send()` to serialize
-   * data to transmit.
+   * application uses solely `nghttp2_session_mem_send2()` to
+   * serialize data to transmit.
    */
-  nghttp2_send_callback send_callback;
+  nghttp2_send_callback2 send_callback2;
+  /**
+   * Deprecated.  Use recv_callback2 instead.  Callback function
+   * invoked when the session wants to receive data from the remote
+   * peer.  This callback is not necessary if the application uses
+   * solely `nghttp2_session_mem_recv()` to process received data.
+   */
+  nghttp2_recv_callback recv_callback;
   /**
    * Callback function invoked when the session wants to receive data
    * from the remote peer.  This callback is not necessary if the
-   * application uses solely `nghttp2_session_mem_recv()` to process
+   * application uses solely `nghttp2_session_mem_recv2()` to process
    * received data.
    */
-  nghttp2_recv_callback recv_callback;
+  nghttp2_recv_callback2 recv_callback2;
   /**
    * Callback function invoked by `nghttp2_session_recv()` when a
    * frame is received.
@@ -99,27 +113,45 @@ struct nghttp2_session_callbacks {
    */
   nghttp2_on_invalid_header_callback on_invalid_header_callback;
   nghttp2_on_invalid_header_callback2 on_invalid_header_callback2;
+  /**
+   * Deprecated.  Use select_padding_callback2 instead.  Callback
+   * function invoked when the library asks application how many
+   * padding bytes are required for the transmission of the given
+   * frame.
+   */
+  nghttp2_select_padding_callback select_padding_callback;
   /**
    * Callback function invoked when the library asks application how
    * many padding bytes are required for the transmission of the given
    * frame.
    */
-  nghttp2_select_padding_callback select_padding_callback;
+  nghttp2_select_padding_callback2 select_padding_callback2;
   /**
-   * The callback function used to determine the length allowed in
+   * Deprecated.  Use read_length_callback2 instead.  The callback
+   * function used to determine the length allowed in
    * `nghttp2_data_source_read_callback()`
    */
   nghttp2_data_source_read_length_callback read_length_callback;
+  /**
+   * The callback function used to determine the length allowed in
+   * `nghttp2_data_source_read_callback2()`
+   */
+  nghttp2_data_source_read_length_callback2 read_length_callback2;
   /**
    * Sets callback function invoked when a frame header is received.
    */
   nghttp2_on_begin_frame_callback on_begin_frame_callback;
   nghttp2_send_data_callback send_data_callback;
+  /**
+   * Deprecated.  Use pack_extension_callback2 instead.
+   */
   nghttp2_pack_extension_callback pack_extension_callback;
+  nghttp2_pack_extension_callback2 pack_extension_callback2;
   nghttp2_unpack_extension_callback unpack_extension_callback;
   nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback;
   nghttp2_error_callback error_callback;
   nghttp2_error_callback2 error_callback2;
+  nghttp2_rand_callback rand_callback;
 };
 
-#endif /* NGHTTP2_CALLBACKS_H */
+#endif /* !defined(NGHTTP2_CALLBACKS_H) */

+ 5 - 5
Utilities/cmnghttp2/lib/nghttp2_debug.c

@@ -34,7 +34,7 @@ static void nghttp2_default_debug_vfprintf_callback(const char *fmt,
 }
 
 static nghttp2_debug_vprintf_callback static_debug_vprintf_callback =
-    nghttp2_default_debug_vfprintf_callback;
+  nghttp2_default_debug_vfprintf_callback;
 
 void nghttp2_debug_vprintf(const char *format, ...) {
   if (static_debug_vprintf_callback) {
@@ -46,15 +46,15 @@ void nghttp2_debug_vprintf(const char *format, ...) {
 }
 
 void nghttp2_set_debug_vprintf_callback(
-    nghttp2_debug_vprintf_callback debug_vprintf_callback) {
+  nghttp2_debug_vprintf_callback debug_vprintf_callback) {
   static_debug_vprintf_callback = debug_vprintf_callback;
 }
 
-#else /* !DEBUGBUILD */
+#else /* !defined(DEBUGBUILD) */
 
 void nghttp2_set_debug_vprintf_callback(
-    nghttp2_debug_vprintf_callback debug_vprintf_callback) {
+  nghttp2_debug_vprintf_callback debug_vprintf_callback) {
   (void)debug_vprintf_callback;
 }
 
-#endif /* !DEBUGBUILD */
+#endif /* !defined(DEBUGBUILD) */

+ 4 - 4
Utilities/cmnghttp2/lib/nghttp2_debug.h

@@ -27,17 +27,17 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
 #ifdef DEBUGBUILD
 #  define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__)
 void nghttp2_debug_vprintf(const char *format, ...);
-#else
+#else /* !defined(DEBUGBUILD) */
 #  define DEBUGF(...)                                                          \
     do {                                                                       \
     } while (0)
-#endif
+#endif /* !defined(DEBUGBUILD) */
 
-#endif /* NGHTTP2_DEBUG_H */
+#endif /* !defined(NGHTTP2_DEBUG_H) */

+ 6 - 0
Utilities/cmnghttp2/lib/nghttp2_extpri.c

@@ -24,6 +24,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "nghttp2_extpri.h"
+#include "nghttp2_http.h"
 
 uint8_t nghttp2_extpri_to_uint8(const nghttp2_extpri *extpri) {
   return (uint8_t)((uint32_t)extpri->inc << 7 | extpri->urgency);
@@ -33,3 +34,8 @@ void nghttp2_extpri_from_uint8(nghttp2_extpri *extpri, uint8_t u8extpri) {
   extpri->urgency = nghttp2_extpri_uint8_urgency(u8extpri);
   extpri->inc = nghttp2_extpri_uint8_inc(u8extpri);
 }
+
+int nghttp2_extpri_parse_priority(nghttp2_extpri *extpri, const uint8_t *value,
+                                  size_t len) {
+  return nghttp2_http_parse_priority(extpri, value, len);
+}

+ 3 - 3
Utilities/cmnghttp2/lib/nghttp2_extpri.h

@@ -28,7 +28,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -60,6 +60,6 @@ void nghttp2_extpri_from_uint8(nghttp2_extpri *extpri, uint8_t u8extpri);
  * nghttp2_extpri_uint8_inc extracts inc from |PRI| which is supposed to
  * be constructed by nghttp2_extpri_to_uint8.
  */
-#define nghttp2_extpri_uint8_inc(PRI) (((PRI)&NGHTTP2_EXTPRI_INC_MASK) != 0)
+#define nghttp2_extpri_uint8_inc(PRI) (((PRI) & NGHTTP2_EXTPRI_INC_MASK) != 0)
 
-#endif /* NGHTTP2_EXTPRI_H */
+#endif /* !defined(NGHTTP2_EXTPRI_H) */

+ 22 - 39
Utilities/cmnghttp2/lib/nghttp2_frame.c

@@ -418,8 +418,8 @@ void nghttp2_frame_unpack_priority_spec(nghttp2_priority_spec *pri_spec,
   nghttp2_priority_spec_init(pri_spec, dep_stream_id, weight, exclusive);
 }
 
-int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
-                                         const uint8_t *payload) {
+void nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
+                                          const uint8_t *payload) {
   if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) {
     nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload);
   } else {
@@ -428,11 +428,9 @@ int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
 
   frame->nva = NULL;
   frame->nvlen = 0;
-
-  return 0;
 }
 
-int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) {
+void nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) {
   nghttp2_buf *buf;
 
   assert(bufs->head == bufs->cur);
@@ -448,8 +446,6 @@ int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame) {
   nghttp2_frame_pack_priority_spec(buf->last, &frame->pri_spec);
 
   buf->last += NGHTTP2_PRIORITY_SPECLEN;
-
-  return 0;
 }
 
 void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame,
@@ -457,8 +453,8 @@ void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame,
   nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload);
 }
 
-int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
-                                  nghttp2_rst_stream *frame) {
+void nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
+                                   nghttp2_rst_stream *frame) {
   nghttp2_buf *buf;
 
   assert(bufs->head == bufs->cur);
@@ -473,8 +469,6 @@ int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
 
   nghttp2_put_uint32be(buf->last, frame->error_code);
   buf->last += 4;
-
-  return 0;
 }
 
 void nghttp2_frame_unpack_rst_stream_payload(nghttp2_rst_stream *frame,
@@ -498,7 +492,7 @@ int nghttp2_frame_pack_settings(nghttp2_bufs *bufs, nghttp2_settings *frame) {
   nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
 
   buf->last +=
-      nghttp2_frame_pack_settings_payload(buf->last, frame->iv, frame->niv);
+    nghttp2_frame_pack_settings_payload(buf->last, frame->iv, frame->niv);
 
   return 0;
 }
@@ -543,7 +537,7 @@ int nghttp2_frame_unpack_settings_payload2(nghttp2_settings_entry **iv_ptr,
   }
 
   *iv_ptr =
-      nghttp2_mem_malloc(mem, (*niv_ptr) * sizeof(nghttp2_settings_entry));
+    nghttp2_mem_malloc(mem, (*niv_ptr) * sizeof(nghttp2_settings_entry));
 
   if (*iv_ptr == NULL) {
     return NGHTTP2_ERR_NOMEM;
@@ -592,16 +586,15 @@ int nghttp2_frame_pack_push_promise(nghttp2_bufs *bufs,
   return frame_pack_headers_shared(bufs, &frame->hd);
 }
 
-int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
-                                              const uint8_t *payload) {
+void nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
+                                               const uint8_t *payload) {
   frame->promised_stream_id =
-      nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
+    nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
   frame->nva = NULL;
   frame->nvlen = 0;
-  return 0;
 }
 
-int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
+void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
   nghttp2_buf *buf;
 
   assert(bufs->head == bufs->cur);
@@ -615,9 +608,7 @@ int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
   nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
 
   buf->last =
-      nghttp2_cpymem(buf->last, frame->opaque_data, sizeof(frame->opaque_data));
-
-  return 0;
+    nghttp2_cpymem(buf->last, frame->opaque_data, sizeof(frame->opaque_data));
 }
 
 void nghttp2_frame_unpack_ping_payload(nghttp2_ping *frame,
@@ -697,8 +688,8 @@ int nghttp2_frame_unpack_goaway_payload2(nghttp2_goaway *frame,
   return 0;
 }
 
-int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
-                                     nghttp2_window_update *frame) {
+void nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
+                                      nghttp2_window_update *frame) {
   nghttp2_buf *buf;
 
   assert(bufs->head == bufs->cur);
@@ -713,17 +704,15 @@ int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
 
   nghttp2_put_uint32be(buf->last, (uint32_t)frame->window_size_increment);
   buf->last += 4;
-
-  return 0;
 }
 
 void nghttp2_frame_unpack_window_update_payload(nghttp2_window_update *frame,
                                                 const uint8_t *payload) {
   frame->window_size_increment =
-      nghttp2_get_uint32(payload) & NGHTTP2_WINDOW_SIZE_INCREMENT_MASK;
+    nghttp2_get_uint32(payload) & NGHTTP2_WINDOW_SIZE_INCREMENT_MASK;
 }
 
-int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) {
+void nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) {
   int rv;
   nghttp2_buf *buf;
   nghttp2_ext_altsvc *altsvc;
@@ -752,8 +741,6 @@ int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *frame) {
   rv = nghttp2_bufs_add(bufs, altsvc->field_value, altsvc->field_value_len);
 
   assert(rv == 0);
-
-  return 0;
 }
 
 void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame,
@@ -901,8 +888,8 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
   return 0;
 }
 
-int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
-                                       nghttp2_extension *frame) {
+void nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
+                                        nghttp2_extension *frame) {
   int rv;
   nghttp2_buf *buf;
   nghttp2_ext_priority_update *priority_update;
@@ -927,8 +914,6 @@ int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
                         priority_update->field_value_len);
 
   assert(rv == 0);
-
-  return 0;
 }
 
 void nghttp2_frame_unpack_priority_update_payload(nghttp2_extension *frame,
@@ -941,7 +926,7 @@ void nghttp2_frame_unpack_priority_update_payload(nghttp2_extension *frame,
   priority_update = frame->payload;
 
   priority_update->stream_id =
-      nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
+    nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
 
   if (payloadlen > 4) {
     priority_update->field_value = payload + 4;
@@ -1186,14 +1171,14 @@ static void frame_set_pad(nghttp2_buf *buf, size_t padlen, int framehd_only) {
   buf->last += trail_padlen;
 }
 
-int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
-                          size_t padlen, int framehd_only) {
+void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
+                           size_t padlen, int framehd_only) {
   nghttp2_buf *buf;
 
   if (padlen == 0) {
     DEBUGF("send: padlen = 0, nothing to do\n");
 
-    return 0;
+    return;
   }
 
   /*
@@ -1226,6 +1211,4 @@ int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
   hd->flags |= NGHTTP2_FLAG_PADDED;
 
   DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen);
-
-  return 0;
 }

+ 17 - 49
Utilities/cmnghttp2/lib/nghttp2_frame.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_hd.h"
@@ -143,11 +143,9 @@ int nghttp2_frame_pack_headers(nghttp2_bufs *bufs, nghttp2_headers *frame,
  * Unpacks HEADERS frame byte sequence into |frame|.  This function
  * only unapcks bytes that come before name/value header block and
  * after possible Pad Length field.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
-                                         const uint8_t *payload);
+void nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
+                                          const uint8_t *payload);
 
 /*
  * Packs PRIORITY frame |frame| in wire format and store it in
@@ -155,10 +153,8 @@ int nghttp2_frame_unpack_headers_payload(nghttp2_headers *frame,
  *
  * The caller must make sure that nghttp2_bufs_reset(bufs) is called
  * before calling this function.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame);
+void nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame);
 
 /*
  * Unpacks PRIORITY wire format into |frame|.
@@ -172,11 +168,9 @@ void nghttp2_frame_unpack_priority_payload(nghttp2_priority *frame,
  *
  * The caller must make sure that nghttp2_bufs_reset(bufs) is called
  * before calling this function.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
-                                  nghttp2_rst_stream *frame);
+void nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
+                                   nghttp2_rst_stream *frame);
 
 /*
  * Unpacks RST_STREAM frame byte sequence into |frame|.
@@ -265,15 +259,9 @@ int nghttp2_frame_pack_push_promise(nghttp2_bufs *bufs,
  * Unpacks PUSH_PROMISE frame byte sequence into |frame|.  This
  * function only unapcks bytes that come before name/value header
  * block and after possible Pad Length field.
- *
- * This function returns 0 if it succeeds or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_PROTO
- *     TODO END_HEADERS flag is not set
  */
-int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
-                                              const uint8_t *payload);
+void nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
+                                               const uint8_t *payload);
 
 /*
  * Packs PING frame |frame| in wire format and store it in
@@ -281,10 +269,8 @@ int nghttp2_frame_unpack_push_promise_payload(nghttp2_push_promise *frame,
  *
  * The caller must make sure that nghttp2_bufs_reset(bufs) is called
  * before calling this function.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame);
+void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame);
 
 /*
  * Unpacks PING wire format into |frame|.
@@ -343,11 +329,9 @@ int nghttp2_frame_unpack_goaway_payload2(nghttp2_goaway *frame,
  *
  * The caller must make sure that nghttp2_bufs_reset(bufs) is called
  * before calling this function.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
-                                     nghttp2_window_update *frame);
+void nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
+                                      nghttp2_window_update *frame);
 
 /*
  * Unpacks WINDOW_UPDATE frame byte sequence into |frame|.
@@ -361,17 +345,13 @@ void nghttp2_frame_unpack_window_update_payload(nghttp2_window_update *frame,
  *
  * The caller must make sure that nghttp2_bufs_reset(bufs) is called
  * before calling this function.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *ext);
+void nghttp2_frame_pack_altsvc(nghttp2_bufs *bufs, nghttp2_extension *ext);
 
 /*
  * Unpacks ALTSVC wire format into |frame|.  The |payload| of
  * |payloadlen| bytes contains frame payload.  This function assumes
  * that frame->payload points to the nghttp2_ext_altsvc object.
- *
- * This function always succeeds and returns 0.
  */
 void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame,
                                          size_t origin_len, uint8_t *payload,
@@ -431,19 +411,15 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
  *
  * The caller must make sure that nghttp2_bufs_reset(bufs) is called
  * before calling this function.
- *
- * This function always succeeds and returns 0.
  */
-int nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
-                                       nghttp2_extension *ext);
+void nghttp2_frame_pack_priority_update(nghttp2_bufs *bufs,
+                                        nghttp2_extension *ext);
 
 /*
  * Unpacks PRIORITY_UPDATE wire format into |frame|.  The |payload| of
  * |payloadlen| bytes contains frame payload.  This function assumes
  * that frame->payload points to the nghttp2_ext_priority_update
  * object.
- *
- * This function always succeeds and returns 0.
  */
 void nghttp2_frame_unpack_priority_update_payload(nghttp2_extension *frame,
                                                   uint8_t *payload,
@@ -654,16 +630,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv);
  * |padlen| including Pad Length field.  The |hd| is the frame header
  * for the serialized data.  This function fills zeros padding region
  * unless framehd_only is nonzero.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory.
- * NGHTTP2_ERR_FRAME_SIZE_ERROR
- *     The length of the resulting frame is too large.
  */
-int nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
-                          size_t padlen, int framehd_only);
+void nghttp2_frame_add_pad(nghttp2_bufs *bufs, nghttp2_frame_hd *hd,
+                           size_t padlen, int framehd_only);
 
-#endif /* NGHTTP2_FRAME_H */
+#endif /* !defined(NGHTTP2_FRAME_H) */

+ 173 - 142
Utilities/cmnghttp2/lib/nghttp2_hd.c

@@ -36,9 +36,10 @@
 #define MAKE_STATIC_ENT(N, V, T, H)                                            \
   {                                                                            \
     {NULL, NULL, (uint8_t *)(N), sizeof((N)) - 1, -1},                         \
-        {NULL, NULL, (uint8_t *)(V), sizeof((V)) - 1, -1},                     \
-        {(uint8_t *)(N), (uint8_t *)(V), sizeof((N)) - 1, sizeof((V)) - 1, 0}, \
-        T, H                                                                   \
+    {NULL, NULL, (uint8_t *)(V), sizeof((V)) - 1, -1},                         \
+    {(uint8_t *)(N), (uint8_t *)(V), sizeof((N)) - 1, sizeof((V)) - 1, 0},     \
+    T,                                                                         \
+    H,                                                                         \
   }
 
 /* Generated by mkstatictbl.py */
@@ -46,67 +47,67 @@
    first enum value if same header names are repeated (e.g.,
    :status). */
 static const nghttp2_hd_static_entry static_table[] = {
-    MAKE_STATIC_ENT(":authority", "", 0, 3153725150u),
-    MAKE_STATIC_ENT(":method", "GET", 1, 695666056u),
-    MAKE_STATIC_ENT(":method", "POST", 1, 695666056u),
-    MAKE_STATIC_ENT(":path", "/", 3, 3292848686u),
-    MAKE_STATIC_ENT(":path", "/index.html", 3, 3292848686u),
-    MAKE_STATIC_ENT(":scheme", "http", 5, 2510477674u),
-    MAKE_STATIC_ENT(":scheme", "https", 5, 2510477674u),
-    MAKE_STATIC_ENT(":status", "200", 7, 4000288983u),
-    MAKE_STATIC_ENT(":status", "204", 7, 4000288983u),
-    MAKE_STATIC_ENT(":status", "206", 7, 4000288983u),
-    MAKE_STATIC_ENT(":status", "304", 7, 4000288983u),
-    MAKE_STATIC_ENT(":status", "400", 7, 4000288983u),
-    MAKE_STATIC_ENT(":status", "404", 7, 4000288983u),
-    MAKE_STATIC_ENT(":status", "500", 7, 4000288983u),
-    MAKE_STATIC_ENT("accept-charset", "", 14, 3664010344u),
-    MAKE_STATIC_ENT("accept-encoding", "gzip, deflate", 15, 3379649177u),
-    MAKE_STATIC_ENT("accept-language", "", 16, 1979086614u),
-    MAKE_STATIC_ENT("accept-ranges", "", 17, 1713753958u),
-    MAKE_STATIC_ENT("accept", "", 18, 136609321u),
-    MAKE_STATIC_ENT("access-control-allow-origin", "", 19, 2710797292u),
-    MAKE_STATIC_ENT("age", "", 20, 742476188u),
-    MAKE_STATIC_ENT("allow", "", 21, 2930878514u),
-    MAKE_STATIC_ENT("authorization", "", 22, 2436257726u),
-    MAKE_STATIC_ENT("cache-control", "", 23, 1355326669u),
-    MAKE_STATIC_ENT("content-disposition", "", 24, 3889184348u),
-    MAKE_STATIC_ENT("content-encoding", "", 25, 65203592u),
-    MAKE_STATIC_ENT("content-language", "", 26, 24973587u),
-    MAKE_STATIC_ENT("content-length", "", 27, 1308181789u),
-    MAKE_STATIC_ENT("content-location", "", 28, 2302364718u),
-    MAKE_STATIC_ENT("content-range", "", 29, 3555523146u),
-    MAKE_STATIC_ENT("content-type", "", 30, 4244048277u),
-    MAKE_STATIC_ENT("cookie", "", 31, 2007449791u),
-    MAKE_STATIC_ENT("date", "", 32, 3564297305u),
-    MAKE_STATIC_ENT("etag", "", 33, 113792960u),
-    MAKE_STATIC_ENT("expect", "", 34, 2530896728u),
-    MAKE_STATIC_ENT("expires", "", 35, 1049544579u),
-    MAKE_STATIC_ENT("from", "", 36, 2513272949u),
-    MAKE_STATIC_ENT("host", "", 37, 2952701295u),
-    MAKE_STATIC_ENT("if-match", "", 38, 3597694698u),
-    MAKE_STATIC_ENT("if-modified-since", "", 39, 2213050793u),
-    MAKE_STATIC_ENT("if-none-match", "", 40, 2536202615u),
-    MAKE_STATIC_ENT("if-range", "", 41, 2340978238u),
-    MAKE_STATIC_ENT("if-unmodified-since", "", 42, 3794814858u),
-    MAKE_STATIC_ENT("last-modified", "", 43, 3226950251u),
-    MAKE_STATIC_ENT("link", "", 44, 232457833u),
-    MAKE_STATIC_ENT("location", "", 45, 200649126u),
-    MAKE_STATIC_ENT("max-forwards", "", 46, 1826162134u),
-    MAKE_STATIC_ENT("proxy-authenticate", "", 47, 2709445359u),
-    MAKE_STATIC_ENT("proxy-authorization", "", 48, 2686392507u),
-    MAKE_STATIC_ENT("range", "", 49, 4208725202u),
-    MAKE_STATIC_ENT("referer", "", 50, 3969579366u),
-    MAKE_STATIC_ENT("refresh", "", 51, 3572655668u),
-    MAKE_STATIC_ENT("retry-after", "", 52, 3336180598u),
-    MAKE_STATIC_ENT("server", "", 53, 1085029842u),
-    MAKE_STATIC_ENT("set-cookie", "", 54, 1848371000u),
-    MAKE_STATIC_ENT("strict-transport-security", "", 55, 4138147361u),
-    MAKE_STATIC_ENT("transfer-encoding", "", 56, 3719590988u),
-    MAKE_STATIC_ENT("user-agent", "", 57, 606444526u),
-    MAKE_STATIC_ENT("vary", "", 58, 1085005381u),
-    MAKE_STATIC_ENT("via", "", 59, 1762798611u),
-    MAKE_STATIC_ENT("www-authenticate", "", 60, 779865858u),
+  MAKE_STATIC_ENT(":authority", "", 0, 3153725150u),
+  MAKE_STATIC_ENT(":method", "GET", 1, 695666056u),
+  MAKE_STATIC_ENT(":method", "POST", 1, 695666056u),
+  MAKE_STATIC_ENT(":path", "/", 3, 3292848686u),
+  MAKE_STATIC_ENT(":path", "/index.html", 3, 3292848686u),
+  MAKE_STATIC_ENT(":scheme", "http", 5, 2510477674u),
+  MAKE_STATIC_ENT(":scheme", "https", 5, 2510477674u),
+  MAKE_STATIC_ENT(":status", "200", 7, 4000288983u),
+  MAKE_STATIC_ENT(":status", "204", 7, 4000288983u),
+  MAKE_STATIC_ENT(":status", "206", 7, 4000288983u),
+  MAKE_STATIC_ENT(":status", "304", 7, 4000288983u),
+  MAKE_STATIC_ENT(":status", "400", 7, 4000288983u),
+  MAKE_STATIC_ENT(":status", "404", 7, 4000288983u),
+  MAKE_STATIC_ENT(":status", "500", 7, 4000288983u),
+  MAKE_STATIC_ENT("accept-charset", "", 14, 3664010344u),
+  MAKE_STATIC_ENT("accept-encoding", "gzip, deflate", 15, 3379649177u),
+  MAKE_STATIC_ENT("accept-language", "", 16, 1979086614u),
+  MAKE_STATIC_ENT("accept-ranges", "", 17, 1713753958u),
+  MAKE_STATIC_ENT("accept", "", 18, 136609321u),
+  MAKE_STATIC_ENT("access-control-allow-origin", "", 19, 2710797292u),
+  MAKE_STATIC_ENT("age", "", 20, 742476188u),
+  MAKE_STATIC_ENT("allow", "", 21, 2930878514u),
+  MAKE_STATIC_ENT("authorization", "", 22, 2436257726u),
+  MAKE_STATIC_ENT("cache-control", "", 23, 1355326669u),
+  MAKE_STATIC_ENT("content-disposition", "", 24, 3889184348u),
+  MAKE_STATIC_ENT("content-encoding", "", 25, 65203592u),
+  MAKE_STATIC_ENT("content-language", "", 26, 24973587u),
+  MAKE_STATIC_ENT("content-length", "", 27, 1308181789u),
+  MAKE_STATIC_ENT("content-location", "", 28, 2302364718u),
+  MAKE_STATIC_ENT("content-range", "", 29, 3555523146u),
+  MAKE_STATIC_ENT("content-type", "", 30, 4244048277u),
+  MAKE_STATIC_ENT("cookie", "", 31, 2007449791u),
+  MAKE_STATIC_ENT("date", "", 32, 3564297305u),
+  MAKE_STATIC_ENT("etag", "", 33, 113792960u),
+  MAKE_STATIC_ENT("expect", "", 34, 2530896728u),
+  MAKE_STATIC_ENT("expires", "", 35, 1049544579u),
+  MAKE_STATIC_ENT("from", "", 36, 2513272949u),
+  MAKE_STATIC_ENT("host", "", 37, 2952701295u),
+  MAKE_STATIC_ENT("if-match", "", 38, 3597694698u),
+  MAKE_STATIC_ENT("if-modified-since", "", 39, 2213050793u),
+  MAKE_STATIC_ENT("if-none-match", "", 40, 2536202615u),
+  MAKE_STATIC_ENT("if-range", "", 41, 2340978238u),
+  MAKE_STATIC_ENT("if-unmodified-since", "", 42, 3794814858u),
+  MAKE_STATIC_ENT("last-modified", "", 43, 3226950251u),
+  MAKE_STATIC_ENT("link", "", 44, 232457833u),
+  MAKE_STATIC_ENT("location", "", 45, 200649126u),
+  MAKE_STATIC_ENT("max-forwards", "", 46, 1826162134u),
+  MAKE_STATIC_ENT("proxy-authenticate", "", 47, 2709445359u),
+  MAKE_STATIC_ENT("proxy-authorization", "", 48, 2686392507u),
+  MAKE_STATIC_ENT("range", "", 49, 4208725202u),
+  MAKE_STATIC_ENT("referer", "", 50, 3969579366u),
+  MAKE_STATIC_ENT("refresh", "", 51, 3572655668u),
+  MAKE_STATIC_ENT("retry-after", "", 52, 3336180598u),
+  MAKE_STATIC_ENT("server", "", 53, 1085029842u),
+  MAKE_STATIC_ENT("set-cookie", "", 54, 1848371000u),
+  MAKE_STATIC_ENT("strict-transport-security", "", 55, 4138147361u),
+  MAKE_STATIC_ENT("transfer-encoding", "", 56, 3719590988u),
+  MAKE_STATIC_ENT("user-agent", "", 57, 606444526u),
+  MAKE_STATIC_ENT("vary", "", 58, 1085005381u),
+  MAKE_STATIC_ENT("via", "", 59, 1762798611u),
+  MAKE_STATIC_ENT("www-authenticate", "", 60, 779865858u),
 };
 
 static int memeq(const void *s1, const void *s2, size_t n) {
@@ -593,8 +594,19 @@ static void hd_map_remove(nghttp2_hd_map *map, nghttp2_hd_entry *ent) {
 static int hd_ringbuf_init(nghttp2_hd_ringbuf *ringbuf, size_t bufsize,
                            nghttp2_mem *mem) {
   size_t size;
+  const size_t max_size = SIZE_MAX / sizeof(nghttp2_hd_entry *);
+
+  if (bufsize > max_size) {
+    return NGHTTP2_ERR_NOMEM;
+  }
+
   for (size = 1; size < bufsize; size <<= 1)
     ;
+
+  if (size > max_size) {
+    return NGHTTP2_ERR_NOMEM;
+  }
+
   ringbuf->buffer = nghttp2_mem_malloc(mem, sizeof(nghttp2_hd_entry *) * size);
   if (ringbuf->buffer == NULL) {
     return NGHTTP2_ERR_NOMEM;
@@ -677,8 +689,8 @@ static int hd_context_init(nghttp2_hd_context *context, nghttp2_mem *mem) {
   context->bad = 0;
   context->hd_table_bufsize_max = NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE;
   rv = hd_ringbuf_init(
-      &context->hd_table,
-      context->hd_table_bufsize_max / NGHTTP2_HD_ENTRY_OVERHEAD, mem);
+    &context->hd_table,
+    context->hd_table_bufsize_max / NGHTTP2_HD_ENTRY_OVERHEAD, mem);
   if (rv != 0) {
     return rv;
   }
@@ -695,7 +707,7 @@ static void hd_context_free(nghttp2_hd_context *context) {
 
 int nghttp2_hd_deflate_init(nghttp2_hd_deflater *deflater, nghttp2_mem *mem) {
   return nghttp2_hd_deflate_init2(
-      deflater, NGHTTP2_HD_DEFAULT_MAX_DEFLATE_BUFFER_SIZE, mem);
+    deflater, NGHTTP2_HD_DEFAULT_MAX_DEFLATE_BUFFER_SIZE, mem);
 }
 
 int nghttp2_hd_deflate_init2(nghttp2_hd_deflater *deflater,
@@ -850,9 +862,10 @@ static size_t encode_length(uint8_t *buf, size_t n, size_t prefix) {
  * in the next call will be stored in |*shift_ptr|) and returns number
  * of bytes processed, or returns -1, indicating decoding error.
  */
-static ssize_t decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
-                             uint32_t initial, size_t shift, const uint8_t *in,
-                             const uint8_t *last, size_t prefix) {
+static nghttp2_ssize decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
+                                   uint32_t initial, size_t shift,
+                                   const uint8_t *in, const uint8_t *last,
+                                   size_t prefix) {
   uint32_t k = (uint8_t)((1 << prefix) - 1);
   uint32_t n = initial;
   const uint8_t *start = in;
@@ -871,7 +884,7 @@ static ssize_t decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
 
     if (++in == last) {
       *res = n;
-      return (ssize_t)(in - start);
+      return (nghttp2_ssize)(in - start);
     }
   }
 
@@ -906,12 +919,12 @@ static ssize_t decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
 
   if (in == last) {
     *res = n;
-    return (ssize_t)(in - start);
+    return (nghttp2_ssize)(in - start);
   }
 
   *res = n;
   *fin = 1;
-  return (ssize_t)(in + 1 - start);
+  return (nghttp2_ssize)(in + 1 - start);
 }
 
 static int emit_table_size(nghttp2_bufs *bufs, size_t table_size) {
@@ -1076,8 +1089,8 @@ static int emit_newname_block(nghttp2_bufs *bufs, const nghttp2_nv *nv,
   int rv;
 
   DEBUGF(
-      "deflatehd: emit newname namelen=%zu, valuelen=%zu, indexing_mode=%d\n",
-      nv->namelen, nv->valuelen, indexing_mode);
+    "deflatehd: emit newname namelen=%zu, valuelen=%zu, indexing_mode=%d\n",
+    nv->namelen, nv->valuelen, indexing_mode);
 
   rv = nghttp2_bufs_addb(bufs, pack_first_byte(indexing_mode));
   if (rv != 0) {
@@ -1110,12 +1123,11 @@ static int add_hd_table_incremental(nghttp2_hd_context *context,
 
   while (context->hd_table_bufsize + room > context->hd_table_bufsize_max &&
          context->hd_table.len > 0) {
-
     size_t idx = context->hd_table.len - 1;
     nghttp2_hd_entry *ent = hd_ringbuf_get(&context->hd_table, idx);
 
     context->hd_table_bufsize -=
-        entry_room(ent->nv.name->len, ent->nv.value->len);
+      entry_room(ent->nv.name->len, ent->nv.value->len);
 
     DEBUGF("hpack: remove item from header table: %s: %s\n",
            (char *)ent->nv.name->base, (char *)ent->nv.value->base);
@@ -1164,7 +1176,7 @@ static int add_hd_table_incremental(nghttp2_hd_context *context,
 }
 
 typedef struct {
-  ssize_t index;
+  nghttp2_ssize index;
   /* Nonzero if both name and value are matched. */
   int name_value_match;
 } search_result;
@@ -1213,8 +1225,8 @@ static search_result search_hd_table(nghttp2_hd_context *context,
     return res;
   }
 
-  res.index =
-      (ssize_t)(context->next_seq - 1 - ent->seq + NGHTTP2_STATIC_TABLE_LENGTH);
+  res.index = (nghttp2_ssize)(context->next_seq - 1 - ent->seq +
+                              NGHTTP2_STATIC_TABLE_LENGTH);
   res.name_value_match = exact_match;
 
   return res;
@@ -1231,7 +1243,7 @@ static void hd_context_shrink_table_size(nghttp2_hd_context *context,
     size_t idx = context->hd_table.len - 1;
     nghttp2_hd_entry *ent = hd_ringbuf_get(&context->hd_table, idx);
     context->hd_table_bufsize -=
-        entry_room(ent->nv.name->len, ent->nv.value->len);
+      entry_room(ent->nv.name->len, ent->nv.value->len);
     hd_ringbuf_pop_back(&context->hd_table);
     if (map) {
       hd_map_remove(map, ent);
@@ -1243,14 +1255,14 @@ static void hd_context_shrink_table_size(nghttp2_hd_context *context,
 }
 
 int nghttp2_hd_deflate_change_table_size(
-    nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size) {
-  size_t next_bufsize = nghttp2_min(settings_max_dynamic_table_size,
-                                    deflater->deflate_hd_table_bufsize_max);
+  nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size) {
+  size_t next_bufsize = nghttp2_min_size(
+    settings_max_dynamic_table_size, deflater->deflate_hd_table_bufsize_max);
 
   deflater->ctx.hd_table_bufsize_max = next_bufsize;
 
   deflater->min_hd_table_bufsize_max =
-      nghttp2_min(deflater->min_hd_table_bufsize_max, next_bufsize);
+    nghttp2_min_size(deflater->min_hd_table_bufsize_max, next_bufsize);
 
   deflater->notify_table_size_change = 1;
 
@@ -1259,7 +1271,7 @@ int nghttp2_hd_deflate_change_table_size(
 }
 
 int nghttp2_hd_inflate_change_table_size(
-    nghttp2_hd_inflater *inflater, size_t settings_max_dynamic_table_size) {
+  nghttp2_hd_inflater *inflater, size_t settings_max_dynamic_table_size) {
   switch (inflater->state) {
   case NGHTTP2_HD_STATE_EXPECT_TABLE_SIZE:
   case NGHTTP2_HD_STATE_INFLATE_START:
@@ -1302,7 +1314,7 @@ nghttp2_hd_nv nghttp2_hd_table_get(nghttp2_hd_context *context, size_t idx) {
   assert(INDEX_RANGE_VALID(context, idx));
   if (idx >= NGHTTP2_STATIC_TABLE_LENGTH) {
     return hd_ringbuf_get(&context->hd_table, idx - NGHTTP2_STATIC_TABLE_LENGTH)
-        ->nv;
+      ->nv;
   } else {
     const nghttp2_hd_static_entry *ent = &static_table[idx];
     nghttp2_hd_nv nv = {(nghttp2_rcbuf *)&ent->name,
@@ -1318,7 +1330,7 @@ static const nghttp2_nv *nghttp2_hd_table_get2(nghttp2_hd_context *context,
   if (idx >= NGHTTP2_STATIC_TABLE_LENGTH) {
     return &hd_ringbuf_get(&context->hd_table,
                            idx - NGHTTP2_STATIC_TABLE_LENGTH)
-                ->cnv;
+              ->cnv;
   }
 
   return &static_table[idx].cnv;
@@ -1332,7 +1344,7 @@ static int hd_deflate_decide_indexing(nghttp2_hd_deflater *deflater,
       token == NGHTTP2_TOKEN_IF_NONE_MATCH || token == NGHTTP2_TOKEN_LOCATION ||
       token == NGHTTP2_TOKEN_SET_COOKIE ||
       entry_room(nv->namelen, nv->valuelen) >
-          deflater->ctx.hd_table_bufsize_max * 3 / 4) {
+        deflater->ctx.hd_table_bufsize_max * 3 / 4) {
     return NGHTTP2_HD_WITHOUT_INDEXING;
   }
 
@@ -1343,7 +1355,7 @@ static int deflate_nv(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs,
                       const nghttp2_nv *nv) {
   int rv;
   search_result res;
-  ssize_t idx;
+  nghttp2_ssize idx;
   int indexing_mode;
   int32_t token;
   nghttp2_mem *mem;
@@ -1365,12 +1377,11 @@ static int deflate_nv(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs,
      entropy secret data (e.g., id/password).  Also cookie header
      field with less than 20 bytes value is also never indexed.  This
      is the same criteria used in Firefox codebase. */
-  indexing_mode =
-      token == NGHTTP2_TOKEN_AUTHORIZATION ||
-              (token == NGHTTP2_TOKEN_COOKIE && nv->valuelen < 20) ||
-              (nv->flags & NGHTTP2_NV_FLAG_NO_INDEX)
-          ? NGHTTP2_HD_NEVER_INDEXING
-          : hd_deflate_decide_indexing(deflater, nv, token);
+  indexing_mode = token == NGHTTP2_TOKEN_AUTHORIZATION ||
+                      (token == NGHTTP2_TOKEN_COOKIE && nv->valuelen < 20) ||
+                      (nv->flags & NGHTTP2_NV_FLAG_NO_INDEX)
+                    ? NGHTTP2_HD_NEVER_INDEXING
+                    : hd_deflate_decide_indexing(deflater, nv, token);
 
   res = search_hd_table(&deflater->ctx, nv, token, indexing_mode,
                         &deflater->map, hash);
@@ -1378,8 +1389,7 @@ static int deflate_nv(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs,
   idx = res.index;
 
   if (res.name_value_match) {
-
-    DEBUGF("deflatehd: name/value match index=%zd\n", idx);
+    DEBUGF("deflatehd: name/value match index=%td\n", idx);
 
     rv = emit_indexed_block(bufs, (size_t)idx);
     if (rv != 0) {
@@ -1390,7 +1400,7 @@ static int deflate_nv(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs,
   }
 
   if (res.index != -1) {
-    DEBUGF("deflatehd: name match index=%zd\n", res.index);
+    DEBUGF("deflatehd: name match index=%td\n", res.index);
   }
 
   if (indexing_mode == NGHTTP2_HD_WITH_INDEXING) {
@@ -1456,7 +1466,6 @@ int nghttp2_hd_deflate_hd_bufs(nghttp2_hd_deflater *deflater,
     deflater->min_hd_table_bufsize_max = UINT32_MAX;
 
     if (deflater->ctx.hd_table_bufsize_max > min_hd_table_bufsize_max) {
-
       rv = emit_table_size(bufs, min_hd_table_bufsize_max);
 
       if (rv != 0) {
@@ -1491,6 +1500,12 @@ fail:
 ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf,
                               size_t buflen, const nghttp2_nv *nv,
                               size_t nvlen) {
+  return (ssize_t)nghttp2_hd_deflate_hd2(deflater, buf, buflen, nv, nvlen);
+}
+
+nghttp2_ssize nghttp2_hd_deflate_hd2(nghttp2_hd_deflater *deflater,
+                                     uint8_t *buf, size_t buflen,
+                                     const nghttp2_nv *nv, size_t nvlen) {
   nghttp2_bufs bufs;
   int rv;
   nghttp2_mem *mem;
@@ -1517,12 +1532,18 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf,
     return rv;
   }
 
-  return (ssize_t)buflen;
+  return (nghttp2_ssize)buflen;
 }
 
 ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater,
                                   const nghttp2_vec *vec, size_t veclen,
                                   const nghttp2_nv *nv, size_t nvlen) {
+  return (ssize_t)nghttp2_hd_deflate_hd_vec2(deflater, vec, veclen, nv, nvlen);
+}
+
+nghttp2_ssize nghttp2_hd_deflate_hd_vec2(nghttp2_hd_deflater *deflater,
+                                         const nghttp2_vec *vec, size_t veclen,
+                                         const nghttp2_nv *nv, size_t nvlen) {
   nghttp2_bufs bufs;
   int rv;
   nghttp2_mem *mem;
@@ -1550,7 +1571,7 @@ ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater,
     return rv;
   }
 
-  return (ssize_t)buflen;
+  return (nghttp2_ssize)buflen;
 }
 
 size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater,
@@ -1643,10 +1664,11 @@ static void hd_inflate_set_huffman_encoded(nghttp2_hd_inflater *inflater,
  * NGHTTP2_ERR_HEADER_COMP
  *   Integer decoding failed
  */
-static ssize_t hd_inflate_read_len(nghttp2_hd_inflater *inflater, int *rfin,
-                                   const uint8_t *in, const uint8_t *last,
-                                   size_t prefix, size_t maxlen) {
-  ssize_t rv;
+static nghttp2_ssize hd_inflate_read_len(nghttp2_hd_inflater *inflater,
+                                         int *rfin, const uint8_t *in,
+                                         const uint8_t *last, size_t prefix,
+                                         size_t maxlen) {
+  nghttp2_ssize rv;
   uint32_t out;
 
   *rfin = 0;
@@ -1684,10 +1706,10 @@ static ssize_t hd_inflate_read_len(nghttp2_hd_inflater *inflater, int *rfin,
  * NGHTTP2_ERR_HEADER_COMP
  *   Huffman decoding failed
  */
-static ssize_t hd_inflate_read_huff(nghttp2_hd_inflater *inflater,
-                                    nghttp2_buf *buf, const uint8_t *in,
-                                    const uint8_t *last) {
-  ssize_t readlen;
+static nghttp2_ssize hd_inflate_read_huff(nghttp2_hd_inflater *inflater,
+                                          nghttp2_buf *buf, const uint8_t *in,
+                                          const uint8_t *last) {
+  nghttp2_ssize readlen;
   int fin = 0;
   if ((size_t)(last - in) >= inflater->left) {
     last = in + inflater->left;
@@ -1721,14 +1743,15 @@ static ssize_t hd_inflate_read_huff(nghttp2_hd_inflater *inflater,
  * NGHTTP2_ERR_HEADER_COMP
  *   Header decompression failed
  */
-static ssize_t hd_inflate_read(nghttp2_hd_inflater *inflater, nghttp2_buf *buf,
-                               const uint8_t *in, const uint8_t *last) {
-  size_t len = nghttp2_min((size_t)(last - in), inflater->left);
+static nghttp2_ssize hd_inflate_read(nghttp2_hd_inflater *inflater,
+                                     nghttp2_buf *buf, const uint8_t *in,
+                                     const uint8_t *last) {
+  size_t len = nghttp2_min_size((size_t)(last - in), inflater->left);
 
   buf->last = nghttp2_cpymem(buf->last, in, len);
 
   inflater->left -= len;
-  return (ssize_t)len;
+  return (nghttp2_ssize)len;
 }
 
 /*
@@ -1843,7 +1866,15 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater, nghttp2_nv *nv_out,
 ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater,
                                nghttp2_nv *nv_out, int *inflate_flags,
                                const uint8_t *in, size_t inlen, int in_final) {
-  ssize_t rv;
+  return (nghttp2_ssize)nghttp2_hd_inflate_hd3(inflater, nv_out, inflate_flags,
+                                               in, inlen, in_final);
+}
+
+nghttp2_ssize nghttp2_hd_inflate_hd3(nghttp2_hd_inflater *inflater,
+                                     nghttp2_nv *nv_out, int *inflate_flags,
+                                     const uint8_t *in, size_t inlen,
+                                     int in_final) {
+  nghttp2_ssize rv;
   nghttp2_hd_nv hd_nv;
 
   rv = nghttp2_hd_inflate_hd_nv(inflater, &hd_nv, inflate_flags, in, inlen,
@@ -1866,11 +1897,11 @@ ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater,
   return rv;
 }
 
-ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
-                                 nghttp2_hd_nv *nv_out, int *inflate_flags,
-                                 const uint8_t *in, size_t inlen,
-                                 int in_final) {
-  ssize_t rv = 0;
+nghttp2_ssize nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
+                                       nghttp2_hd_nv *nv_out,
+                                       int *inflate_flags, const uint8_t *in,
+                                       size_t inlen, int in_final) {
+  nghttp2_ssize rv = 0;
   const uint8_t *first = in;
   const uint8_t *last = in + inlen;
   int rfin = 0;
@@ -1938,9 +1969,9 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
     case NGHTTP2_HD_STATE_READ_TABLE_SIZE:
       rfin = 0;
       rv = hd_inflate_read_len(
-          inflater, &rfin, in, last, 5,
-          nghttp2_min(inflater->min_hd_table_bufsize_max,
-                      inflater->settings_hd_table_bufsize_max));
+        inflater, &rfin, in, last, 5,
+        nghttp2_min_size(inflater->min_hd_table_bufsize_max,
+                         inflater->settings_hd_table_bufsize_max));
       if (rv < 0) {
         goto fail;
       }
@@ -1992,7 +2023,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
 
         inflater->state = NGHTTP2_HD_STATE_OPCODE;
         *inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
-        return (ssize_t)(in - first);
+        return (nghttp2_ssize)(in - first);
       } else {
         inflater->index = inflater->left;
         --inflater->index;
@@ -2027,8 +2058,8 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
 
         inflater->state = NGHTTP2_HD_STATE_NEWNAME_READ_NAMEHUFF;
 
-        rv = nghttp2_rcbuf_new(&inflater->namercbuf, inflater->left * 2 + 1,
-                               mem);
+        rv =
+          nghttp2_rcbuf_new(&inflater->namercbuf, inflater->left * 2 + 1, mem);
       } else {
         inflater->state = NGHTTP2_HD_STATE_NEWNAME_READ_NAME;
         rv = nghttp2_rcbuf_new(&inflater->namercbuf, inflater->left + 1, mem);
@@ -2050,7 +2081,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
 
       in += rv;
 
-      DEBUGF("inflatehd: %zd bytes read\n", rv);
+      DEBUGF("inflatehd: %td bytes read\n", rv);
 
       if (inflater->left) {
         DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
@@ -2072,7 +2103,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
 
       in += rv;
 
-      DEBUGF("inflatehd: %zd bytes read\n", rv);
+      DEBUGF("inflatehd: %td bytes read\n", rv);
       if (inflater->left) {
         DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
 
@@ -2112,8 +2143,8 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
 
         inflater->state = NGHTTP2_HD_STATE_READ_VALUEHUFF;
 
-        rv = nghttp2_rcbuf_new(&inflater->valuercbuf, inflater->left * 2 + 1,
-                               mem);
+        rv =
+          nghttp2_rcbuf_new(&inflater->valuercbuf, inflater->left * 2 + 1, mem);
       } else {
         inflater->state = NGHTTP2_HD_STATE_READ_VALUE;
 
@@ -2138,7 +2169,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
 
       in += rv;
 
-      DEBUGF("inflatehd: %zd bytes read\n", rv);
+      DEBUGF("inflatehd: %td bytes read\n", rv);
 
       if (inflater->left) {
         DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
@@ -2162,18 +2193,18 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
       inflater->state = NGHTTP2_HD_STATE_OPCODE;
       *inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
 
-      return (ssize_t)(in - first);
+      return (nghttp2_ssize)(in - first);
     case NGHTTP2_HD_STATE_READ_VALUE:
       rv = hd_inflate_read(inflater, &inflater->valuebuf, in, last);
       if (rv < 0) {
-        DEBUGF("inflatehd: value read failure %zd: %s\n", rv,
+        DEBUGF("inflatehd: value read failure %td: %s\n", rv,
                nghttp2_strerror((int)rv));
         goto fail;
       }
 
       in += rv;
 
-      DEBUGF("inflatehd: %zd bytes read\n", rv);
+      DEBUGF("inflatehd: %td bytes read\n", rv);
 
       if (inflater->left) {
         DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
@@ -2196,7 +2227,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
       inflater->state = NGHTTP2_HD_STATE_OPCODE;
       *inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
 
-      return (ssize_t)(in - first);
+      return (nghttp2_ssize)(in - first);
     }
   }
 
@@ -2216,7 +2247,7 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
     }
     *inflate_flags |= NGHTTP2_HD_INFLATE_FINAL;
   }
-  return (ssize_t)(in - first);
+  return (nghttp2_ssize)(in - first);
 
 almost_ok:
   if (in_final) {
@@ -2226,10 +2257,10 @@ almost_ok:
 
     goto fail;
   }
-  return (ssize_t)(in - first);
+  return (nghttp2_ssize)(in - first);
 
 fail:
-  DEBUGF("inflatehd: error return %zd\n", rv);
+  DEBUGF("inflatehd: error return %td\n", rv);
 
   inflater->ctx.bad = 1;
   return rv;
@@ -2284,7 +2315,6 @@ void nghttp2_hd_inflate_del(nghttp2_hd_inflater *inflater) {
 
 int nghttp2_hd_emit_indname_block(nghttp2_bufs *bufs, size_t idx,
                                   nghttp2_nv *nv, int indexing_mode) {
-
   return emit_indname_block(bufs, idx, nv, indexing_mode);
 }
 
@@ -2297,9 +2327,10 @@ int nghttp2_hd_emit_table_size(nghttp2_bufs *bufs, size_t table_size) {
   return emit_table_size(bufs, table_size);
 }
 
-ssize_t nghttp2_hd_decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
-                                 uint32_t initial, size_t shift, uint8_t *in,
-                                 uint8_t *last, size_t prefix) {
+nghttp2_ssize nghttp2_hd_decode_length(uint32_t *res, size_t *shift_ptr,
+                                       int *fin, uint32_t initial, size_t shift,
+                                       uint8_t *in, uint8_t *last,
+                                       size_t prefix) {
   return decode_length(res, shift_ptr, fin, initial, shift, in, last, prefix);
 }
 

+ 13 - 11
Utilities/cmnghttp2/lib/nghttp2_hd.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -357,9 +357,10 @@ void nghttp2_hd_inflate_free(nghttp2_hd_inflater *inflater);
  * that return values and semantics are the same as
  * nghttp2_hd_inflate_hd().
  */
-ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
-                                 nghttp2_hd_nv *nv_out, int *inflate_flags,
-                                 const uint8_t *in, size_t inlen, int in_final);
+nghttp2_ssize nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
+                                       nghttp2_hd_nv *nv_out,
+                                       int *inflate_flags, const uint8_t *in,
+                                       size_t inlen, int in_final);
 
 /* For unittesting purpose */
 int nghttp2_hd_emit_indname_block(nghttp2_bufs *bufs, size_t index,
@@ -376,9 +377,10 @@ int nghttp2_hd_emit_table_size(nghttp2_bufs *bufs, size_t table_size);
 nghttp2_hd_nv nghttp2_hd_table_get(nghttp2_hd_context *context, size_t index);
 
 /* For unittesting purpose */
-ssize_t nghttp2_hd_decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
-                                 uint32_t initial, size_t shift, uint8_t *in,
-                                 uint8_t *last, size_t prefix);
+nghttp2_ssize nghttp2_hd_decode_length(uint32_t *res, size_t *shift_ptr,
+                                       int *fin, uint32_t initial, size_t shift,
+                                       uint8_t *in, uint8_t *last,
+                                       size_t prefix);
 
 /* Huffman encoding/decoding functions */
 
@@ -427,9 +429,9 @@ void nghttp2_hd_huff_decode_context_init(nghttp2_hd_huff_decode_context *ctx);
  * NGHTTP2_ERR_HEADER_COMP
  *     Decoding process has failed.
  */
-ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
-                               nghttp2_buf *buf, const uint8_t *src,
-                               size_t srclen, int fin);
+nghttp2_ssize nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
+                                     nghttp2_buf *buf, const uint8_t *src,
+                                     size_t srclen, int fin);
 
 /*
  * nghttp2_hd_huff_decode_failure_state returns nonzero if |ctx|
@@ -437,4 +439,4 @@ ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
  */
 int nghttp2_hd_huff_decode_failure_state(nghttp2_hd_huff_decode_context *ctx);
 
-#endif /* NGHTTP2_HD_H */
+#endif /* !defined(NGHTTP2_HD_H) */

+ 8 - 6
Utilities/cmnghttp2/lib/nghttp2_hd_huffman.c

@@ -94,7 +94,7 @@ int nghttp2_hd_huff_encode(nghttp2_bufs *bufs, const uint8_t *src,
 
   if (nbits) {
     rv = nghttp2_bufs_addb(
-        bufs, (uint8_t)((uint8_t)(code >> 56) | ((1 << (8 - nbits)) - 1)));
+      bufs, (uint8_t)((uint8_t)(code >> 56) | ((1 << (8 - nbits)) - 1)));
     if (rv != 0) {
       return rv;
     }
@@ -107,16 +107,18 @@ void nghttp2_hd_huff_decode_context_init(nghttp2_hd_huff_decode_context *ctx) {
   ctx->fstate = NGHTTP2_HUFF_ACCEPTED;
 }
 
-ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
-                               nghttp2_buf *buf, const uint8_t *src,
-                               size_t srclen, int final) {
+nghttp2_ssize nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
+                                     nghttp2_buf *buf, const uint8_t *src,
+                                     size_t srclen, int final) {
   const uint8_t *end = src + srclen;
   nghttp2_huff_decode node = {ctx->fstate, 0};
   const nghttp2_huff_decode *t = &node;
   uint8_t c;
 
   /* We use the decoding algorithm described in
-     http://graphics.ics.uci.edu/pub/Prefix.pdf */
+      - http://graphics.ics.uci.edu/pub/Prefix.pdf [!!! NO LONGER VALID !!!]
+      - https://ics.uci.edu/~dan/pubs/Prefix.pdf
+      - https://github.com/nghttp2/nghttp2/files/15141264/Prefix.pdf */
   for (; src != end;) {
     c = *src++;
     t = &huff_decode_table[t->fstate & 0x1ff][c >> 4];
@@ -136,7 +138,7 @@ ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
     return NGHTTP2_ERR_HEADER_COMP;
   }
 
-  return (ssize_t)srclen;
+  return (nghttp2_ssize)srclen;
 }
 
 int nghttp2_hd_huff_decode_failure_state(nghttp2_hd_huff_decode_context *ctx) {

+ 2 - 2
Utilities/cmnghttp2/lib/nghttp2_hd_huffman.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -69,4 +69,4 @@ typedef struct {
 extern const nghttp2_huff_sym huff_sym_table[];
 extern const nghttp2_huff_decode huff_decode_table[][16];
 
-#endif /* NGHTTP2_HD_HUFFMAN_H */
+#endif /* !defined(NGHTTP2_HD_HUFFMAN_H) */

+ 4948 - 4948
Utilities/cmnghttp2/lib/nghttp2_hd_huffman_data.c

@@ -27,4954 +27,4954 @@
 /* Generated by mkhufftbl.py */
 
 const nghttp2_huff_sym huff_sym_table[] = {
-    {13, 0xffc00000u}, {23, 0xffffb000u}, {28, 0xfffffe20u}, {28, 0xfffffe30u},
-    {28, 0xfffffe40u}, {28, 0xfffffe50u}, {28, 0xfffffe60u}, {28, 0xfffffe70u},
-    {28, 0xfffffe80u}, {24, 0xffffea00u}, {30, 0xfffffff0u}, {28, 0xfffffe90u},
-    {28, 0xfffffea0u}, {30, 0xfffffff4u}, {28, 0xfffffeb0u}, {28, 0xfffffec0u},
-    {28, 0xfffffed0u}, {28, 0xfffffee0u}, {28, 0xfffffef0u}, {28, 0xffffff00u},
-    {28, 0xffffff10u}, {28, 0xffffff20u}, {30, 0xfffffff8u}, {28, 0xffffff30u},
-    {28, 0xffffff40u}, {28, 0xffffff50u}, {28, 0xffffff60u}, {28, 0xffffff70u},
-    {28, 0xffffff80u}, {28, 0xffffff90u}, {28, 0xffffffa0u}, {28, 0xffffffb0u},
-    {6, 0x50000000u},  {10, 0xfe000000u}, {10, 0xfe400000u}, {12, 0xffa00000u},
-    {13, 0xffc80000u}, {6, 0x54000000u},  {8, 0xf8000000u},  {11, 0xff400000u},
-    {10, 0xfe800000u}, {10, 0xfec00000u}, {8, 0xf9000000u},  {11, 0xff600000u},
-    {8, 0xfa000000u},  {6, 0x58000000u},  {6, 0x5c000000u},  {6, 0x60000000u},
-    {5, 0x0u},         {5, 0x8000000u},   {5, 0x10000000u},  {6, 0x64000000u},
-    {6, 0x68000000u},  {6, 0x6c000000u},  {6, 0x70000000u},  {6, 0x74000000u},
-    {6, 0x78000000u},  {6, 0x7c000000u},  {7, 0xb8000000u},  {8, 0xfb000000u},
-    {15, 0xfff80000u}, {6, 0x80000000u},  {12, 0xffb00000u}, {10, 0xff000000u},
-    {13, 0xffd00000u}, {6, 0x84000000u},  {7, 0xba000000u},  {7, 0xbc000000u},
-    {7, 0xbe000000u},  {7, 0xc0000000u},  {7, 0xc2000000u},  {7, 0xc4000000u},
-    {7, 0xc6000000u},  {7, 0xc8000000u},  {7, 0xca000000u},  {7, 0xcc000000u},
-    {7, 0xce000000u},  {7, 0xd0000000u},  {7, 0xd2000000u},  {7, 0xd4000000u},
-    {7, 0xd6000000u},  {7, 0xd8000000u},  {7, 0xda000000u},  {7, 0xdc000000u},
-    {7, 0xde000000u},  {7, 0xe0000000u},  {7, 0xe2000000u},  {7, 0xe4000000u},
-    {8, 0xfc000000u},  {7, 0xe6000000u},  {8, 0xfd000000u},  {13, 0xffd80000u},
-    {19, 0xfffe0000u}, {13, 0xffe00000u}, {14, 0xfff00000u}, {6, 0x88000000u},
-    {15, 0xfffa0000u}, {5, 0x18000000u},  {6, 0x8c000000u},  {5, 0x20000000u},
-    {6, 0x90000000u},  {5, 0x28000000u},  {6, 0x94000000u},  {6, 0x98000000u},
-    {6, 0x9c000000u},  {5, 0x30000000u},  {7, 0xe8000000u},  {7, 0xea000000u},
-    {6, 0xa0000000u},  {6, 0xa4000000u},  {6, 0xa8000000u},  {5, 0x38000000u},
-    {6, 0xac000000u},  {7, 0xec000000u},  {6, 0xb0000000u},  {5, 0x40000000u},
-    {5, 0x48000000u},  {6, 0xb4000000u},  {7, 0xee000000u},  {7, 0xf0000000u},
-    {7, 0xf2000000u},  {7, 0xf4000000u},  {7, 0xf6000000u},  {15, 0xfffc0000u},
-    {11, 0xff800000u}, {14, 0xfff40000u}, {13, 0xffe80000u}, {28, 0xffffffc0u},
-    {20, 0xfffe6000u}, {22, 0xffff4800u}, {20, 0xfffe7000u}, {20, 0xfffe8000u},
-    {22, 0xffff4c00u}, {22, 0xffff5000u}, {22, 0xffff5400u}, {23, 0xffffb200u},
-    {22, 0xffff5800u}, {23, 0xffffb400u}, {23, 0xffffb600u}, {23, 0xffffb800u},
-    {23, 0xffffba00u}, {23, 0xffffbc00u}, {24, 0xffffeb00u}, {23, 0xffffbe00u},
-    {24, 0xffffec00u}, {24, 0xffffed00u}, {22, 0xffff5c00u}, {23, 0xffffc000u},
-    {24, 0xffffee00u}, {23, 0xffffc200u}, {23, 0xffffc400u}, {23, 0xffffc600u},
-    {23, 0xffffc800u}, {21, 0xfffee000u}, {22, 0xffff6000u}, {23, 0xffffca00u},
-    {22, 0xffff6400u}, {23, 0xffffcc00u}, {23, 0xffffce00u}, {24, 0xffffef00u},
-    {22, 0xffff6800u}, {21, 0xfffee800u}, {20, 0xfffe9000u}, {22, 0xffff6c00u},
-    {22, 0xffff7000u}, {23, 0xffffd000u}, {23, 0xffffd200u}, {21, 0xfffef000u},
-    {23, 0xffffd400u}, {22, 0xffff7400u}, {22, 0xffff7800u}, {24, 0xfffff000u},
-    {21, 0xfffef800u}, {22, 0xffff7c00u}, {23, 0xffffd600u}, {23, 0xffffd800u},
-    {21, 0xffff0000u}, {21, 0xffff0800u}, {22, 0xffff8000u}, {21, 0xffff1000u},
-    {23, 0xffffda00u}, {22, 0xffff8400u}, {23, 0xffffdc00u}, {23, 0xffffde00u},
-    {20, 0xfffea000u}, {22, 0xffff8800u}, {22, 0xffff8c00u}, {22, 0xffff9000u},
-    {23, 0xffffe000u}, {22, 0xffff9400u}, {22, 0xffff9800u}, {23, 0xffffe200u},
-    {26, 0xfffff800u}, {26, 0xfffff840u}, {20, 0xfffeb000u}, {19, 0xfffe2000u},
-    {22, 0xffff9c00u}, {23, 0xffffe400u}, {22, 0xffffa000u}, {25, 0xfffff600u},
-    {26, 0xfffff880u}, {26, 0xfffff8c0u}, {26, 0xfffff900u}, {27, 0xfffffbc0u},
-    {27, 0xfffffbe0u}, {26, 0xfffff940u}, {24, 0xfffff100u}, {25, 0xfffff680u},
-    {19, 0xfffe4000u}, {21, 0xffff1800u}, {26, 0xfffff980u}, {27, 0xfffffc00u},
-    {27, 0xfffffc20u}, {26, 0xfffff9c0u}, {27, 0xfffffc40u}, {24, 0xfffff200u},
-    {21, 0xffff2000u}, {21, 0xffff2800u}, {26, 0xfffffa00u}, {26, 0xfffffa40u},
-    {28, 0xffffffd0u}, {27, 0xfffffc60u}, {27, 0xfffffc80u}, {27, 0xfffffca0u},
-    {20, 0xfffec000u}, {24, 0xfffff300u}, {20, 0xfffed000u}, {21, 0xffff3000u},
-    {22, 0xffffa400u}, {21, 0xffff3800u}, {21, 0xffff4000u}, {23, 0xffffe600u},
-    {22, 0xffffa800u}, {22, 0xffffac00u}, {25, 0xfffff700u}, {25, 0xfffff780u},
-    {24, 0xfffff400u}, {24, 0xfffff500u}, {26, 0xfffffa80u}, {23, 0xffffe800u},
-    {26, 0xfffffac0u}, {27, 0xfffffcc0u}, {26, 0xfffffb00u}, {26, 0xfffffb40u},
-    {27, 0xfffffce0u}, {27, 0xfffffd00u}, {27, 0xfffffd20u}, {27, 0xfffffd40u},
-    {27, 0xfffffd60u}, {28, 0xffffffe0u}, {27, 0xfffffd80u}, {27, 0xfffffda0u},
-    {27, 0xfffffdc0u}, {27, 0xfffffde0u}, {27, 0xfffffe00u}, {26, 0xfffffb80u},
-    {30, 0xfffffffcu}};
+  {13, 0xffc00000u}, {23, 0xffffb000u}, {28, 0xfffffe20u}, {28, 0xfffffe30u},
+  {28, 0xfffffe40u}, {28, 0xfffffe50u}, {28, 0xfffffe60u}, {28, 0xfffffe70u},
+  {28, 0xfffffe80u}, {24, 0xffffea00u}, {30, 0xfffffff0u}, {28, 0xfffffe90u},
+  {28, 0xfffffea0u}, {30, 0xfffffff4u}, {28, 0xfffffeb0u}, {28, 0xfffffec0u},
+  {28, 0xfffffed0u}, {28, 0xfffffee0u}, {28, 0xfffffef0u}, {28, 0xffffff00u},
+  {28, 0xffffff10u}, {28, 0xffffff20u}, {30, 0xfffffff8u}, {28, 0xffffff30u},
+  {28, 0xffffff40u}, {28, 0xffffff50u}, {28, 0xffffff60u}, {28, 0xffffff70u},
+  {28, 0xffffff80u}, {28, 0xffffff90u}, {28, 0xffffffa0u}, {28, 0xffffffb0u},
+  {6, 0x50000000u},  {10, 0xfe000000u}, {10, 0xfe400000u}, {12, 0xffa00000u},
+  {13, 0xffc80000u}, {6, 0x54000000u},  {8, 0xf8000000u},  {11, 0xff400000u},
+  {10, 0xfe800000u}, {10, 0xfec00000u}, {8, 0xf9000000u},  {11, 0xff600000u},
+  {8, 0xfa000000u},  {6, 0x58000000u},  {6, 0x5c000000u},  {6, 0x60000000u},
+  {5, 0x0u},         {5, 0x8000000u},   {5, 0x10000000u},  {6, 0x64000000u},
+  {6, 0x68000000u},  {6, 0x6c000000u},  {6, 0x70000000u},  {6, 0x74000000u},
+  {6, 0x78000000u},  {6, 0x7c000000u},  {7, 0xb8000000u},  {8, 0xfb000000u},
+  {15, 0xfff80000u}, {6, 0x80000000u},  {12, 0xffb00000u}, {10, 0xff000000u},
+  {13, 0xffd00000u}, {6, 0x84000000u},  {7, 0xba000000u},  {7, 0xbc000000u},
+  {7, 0xbe000000u},  {7, 0xc0000000u},  {7, 0xc2000000u},  {7, 0xc4000000u},
+  {7, 0xc6000000u},  {7, 0xc8000000u},  {7, 0xca000000u},  {7, 0xcc000000u},
+  {7, 0xce000000u},  {7, 0xd0000000u},  {7, 0xd2000000u},  {7, 0xd4000000u},
+  {7, 0xd6000000u},  {7, 0xd8000000u},  {7, 0xda000000u},  {7, 0xdc000000u},
+  {7, 0xde000000u},  {7, 0xe0000000u},  {7, 0xe2000000u},  {7, 0xe4000000u},
+  {8, 0xfc000000u},  {7, 0xe6000000u},  {8, 0xfd000000u},  {13, 0xffd80000u},
+  {19, 0xfffe0000u}, {13, 0xffe00000u}, {14, 0xfff00000u}, {6, 0x88000000u},
+  {15, 0xfffa0000u}, {5, 0x18000000u},  {6, 0x8c000000u},  {5, 0x20000000u},
+  {6, 0x90000000u},  {5, 0x28000000u},  {6, 0x94000000u},  {6, 0x98000000u},
+  {6, 0x9c000000u},  {5, 0x30000000u},  {7, 0xe8000000u},  {7, 0xea000000u},
+  {6, 0xa0000000u},  {6, 0xa4000000u},  {6, 0xa8000000u},  {5, 0x38000000u},
+  {6, 0xac000000u},  {7, 0xec000000u},  {6, 0xb0000000u},  {5, 0x40000000u},
+  {5, 0x48000000u},  {6, 0xb4000000u},  {7, 0xee000000u},  {7, 0xf0000000u},
+  {7, 0xf2000000u},  {7, 0xf4000000u},  {7, 0xf6000000u},  {15, 0xfffc0000u},
+  {11, 0xff800000u}, {14, 0xfff40000u}, {13, 0xffe80000u}, {28, 0xffffffc0u},
+  {20, 0xfffe6000u}, {22, 0xffff4800u}, {20, 0xfffe7000u}, {20, 0xfffe8000u},
+  {22, 0xffff4c00u}, {22, 0xffff5000u}, {22, 0xffff5400u}, {23, 0xffffb200u},
+  {22, 0xffff5800u}, {23, 0xffffb400u}, {23, 0xffffb600u}, {23, 0xffffb800u},
+  {23, 0xffffba00u}, {23, 0xffffbc00u}, {24, 0xffffeb00u}, {23, 0xffffbe00u},
+  {24, 0xffffec00u}, {24, 0xffffed00u}, {22, 0xffff5c00u}, {23, 0xffffc000u},
+  {24, 0xffffee00u}, {23, 0xffffc200u}, {23, 0xffffc400u}, {23, 0xffffc600u},
+  {23, 0xffffc800u}, {21, 0xfffee000u}, {22, 0xffff6000u}, {23, 0xffffca00u},
+  {22, 0xffff6400u}, {23, 0xffffcc00u}, {23, 0xffffce00u}, {24, 0xffffef00u},
+  {22, 0xffff6800u}, {21, 0xfffee800u}, {20, 0xfffe9000u}, {22, 0xffff6c00u},
+  {22, 0xffff7000u}, {23, 0xffffd000u}, {23, 0xffffd200u}, {21, 0xfffef000u},
+  {23, 0xffffd400u}, {22, 0xffff7400u}, {22, 0xffff7800u}, {24, 0xfffff000u},
+  {21, 0xfffef800u}, {22, 0xffff7c00u}, {23, 0xffffd600u}, {23, 0xffffd800u},
+  {21, 0xffff0000u}, {21, 0xffff0800u}, {22, 0xffff8000u}, {21, 0xffff1000u},
+  {23, 0xffffda00u}, {22, 0xffff8400u}, {23, 0xffffdc00u}, {23, 0xffffde00u},
+  {20, 0xfffea000u}, {22, 0xffff8800u}, {22, 0xffff8c00u}, {22, 0xffff9000u},
+  {23, 0xffffe000u}, {22, 0xffff9400u}, {22, 0xffff9800u}, {23, 0xffffe200u},
+  {26, 0xfffff800u}, {26, 0xfffff840u}, {20, 0xfffeb000u}, {19, 0xfffe2000u},
+  {22, 0xffff9c00u}, {23, 0xffffe400u}, {22, 0xffffa000u}, {25, 0xfffff600u},
+  {26, 0xfffff880u}, {26, 0xfffff8c0u}, {26, 0xfffff900u}, {27, 0xfffffbc0u},
+  {27, 0xfffffbe0u}, {26, 0xfffff940u}, {24, 0xfffff100u}, {25, 0xfffff680u},
+  {19, 0xfffe4000u}, {21, 0xffff1800u}, {26, 0xfffff980u}, {27, 0xfffffc00u},
+  {27, 0xfffffc20u}, {26, 0xfffff9c0u}, {27, 0xfffffc40u}, {24, 0xfffff200u},
+  {21, 0xffff2000u}, {21, 0xffff2800u}, {26, 0xfffffa00u}, {26, 0xfffffa40u},
+  {28, 0xffffffd0u}, {27, 0xfffffc60u}, {27, 0xfffffc80u}, {27, 0xfffffca0u},
+  {20, 0xfffec000u}, {24, 0xfffff300u}, {20, 0xfffed000u}, {21, 0xffff3000u},
+  {22, 0xffffa400u}, {21, 0xffff3800u}, {21, 0xffff4000u}, {23, 0xffffe600u},
+  {22, 0xffffa800u}, {22, 0xffffac00u}, {25, 0xfffff700u}, {25, 0xfffff780u},
+  {24, 0xfffff400u}, {24, 0xfffff500u}, {26, 0xfffffa80u}, {23, 0xffffe800u},
+  {26, 0xfffffac0u}, {27, 0xfffffcc0u}, {26, 0xfffffb00u}, {26, 0xfffffb40u},
+  {27, 0xfffffce0u}, {27, 0xfffffd00u}, {27, 0xfffffd20u}, {27, 0xfffffd40u},
+  {27, 0xfffffd60u}, {28, 0xffffffe0u}, {27, 0xfffffd80u}, {27, 0xfffffda0u},
+  {27, 0xfffffdc0u}, {27, 0xfffffde0u}, {27, 0xfffffe00u}, {26, 0xfffffb80u},
+  {30, 0xfffffffcu}};
 
 const nghttp2_huff_decode huff_decode_table[][16] = {
-    /* 0 */
-    {
-        {0x04, 0},
-        {0x05, 0},
-        {0x07, 0},
-        {0x08, 0},
-        {0x0b, 0},
-        {0x0c, 0},
-        {0x10, 0},
-        {0x13, 0},
-        {0x19, 0},
-        {0x1c, 0},
-        {0x20, 0},
-        {0x23, 0},
-        {0x2a, 0},
-        {0x31, 0},
-        {0x39, 0},
-        {0x4040, 0},
-    },
-    /* 1 */
-    {
-        {0xc000, 48},
-        {0xc000, 49},
-        {0xc000, 50},
-        {0xc000, 97},
-        {0xc000, 99},
-        {0xc000, 101},
-        {0xc000, 105},
-        {0xc000, 111},
-        {0xc000, 115},
-        {0xc000, 116},
-        {0x0d, 0},
-        {0x0e, 0},
-        {0x11, 0},
-        {0x12, 0},
-        {0x14, 0},
-        {0x15, 0},
-    },
-    /* 2 */
-    {
-        {0x8001, 48},
-        {0xc016, 48},
-        {0x8001, 49},
-        {0xc016, 49},
-        {0x8001, 50},
-        {0xc016, 50},
-        {0x8001, 97},
-        {0xc016, 97},
-        {0x8001, 99},
-        {0xc016, 99},
-        {0x8001, 101},
-        {0xc016, 101},
-        {0x8001, 105},
-        {0xc016, 105},
-        {0x8001, 111},
-        {0xc016, 111},
-    },
-    /* 3 */
-    {
-        {0x8002, 48},
-        {0x8009, 48},
-        {0x8017, 48},
-        {0xc028, 48},
-        {0x8002, 49},
-        {0x8009, 49},
-        {0x8017, 49},
-        {0xc028, 49},
-        {0x8002, 50},
-        {0x8009, 50},
-        {0x8017, 50},
-        {0xc028, 50},
-        {0x8002, 97},
-        {0x8009, 97},
-        {0x8017, 97},
-        {0xc028, 97},
-    },
-    /* 4 */
-    {
-        {0x8003, 48},
-        {0x8006, 48},
-        {0x800a, 48},
-        {0x800f, 48},
-        {0x8018, 48},
-        {0x801f, 48},
-        {0x8029, 48},
-        {0xc038, 48},
-        {0x8003, 49},
-        {0x8006, 49},
-        {0x800a, 49},
-        {0x800f, 49},
-        {0x8018, 49},
-        {0x801f, 49},
-        {0x8029, 49},
-        {0xc038, 49},
-    },
-    /* 5 */
-    {
-        {0x8003, 50},
-        {0x8006, 50},
-        {0x800a, 50},
-        {0x800f, 50},
-        {0x8018, 50},
-        {0x801f, 50},
-        {0x8029, 50},
-        {0xc038, 50},
-        {0x8003, 97},
-        {0x8006, 97},
-        {0x800a, 97},
-        {0x800f, 97},
-        {0x8018, 97},
-        {0x801f, 97},
-        {0x8029, 97},
-        {0xc038, 97},
-    },
-    /* 6 */
-    {
-        {0x8002, 99},
-        {0x8009, 99},
-        {0x8017, 99},
-        {0xc028, 99},
-        {0x8002, 101},
-        {0x8009, 101},
-        {0x8017, 101},
-        {0xc028, 101},
-        {0x8002, 105},
-        {0x8009, 105},
-        {0x8017, 105},
-        {0xc028, 105},
-        {0x8002, 111},
-        {0x8009, 111},
-        {0x8017, 111},
-        {0xc028, 111},
-    },
-    /* 7 */
-    {
-        {0x8003, 99},
-        {0x8006, 99},
-        {0x800a, 99},
-        {0x800f, 99},
-        {0x8018, 99},
-        {0x801f, 99},
-        {0x8029, 99},
-        {0xc038, 99},
-        {0x8003, 101},
-        {0x8006, 101},
-        {0x800a, 101},
-        {0x800f, 101},
-        {0x8018, 101},
-        {0x801f, 101},
-        {0x8029, 101},
-        {0xc038, 101},
-    },
-    /* 8 */
-    {
-        {0x8003, 105},
-        {0x8006, 105},
-        {0x800a, 105},
-        {0x800f, 105},
-        {0x8018, 105},
-        {0x801f, 105},
-        {0x8029, 105},
-        {0xc038, 105},
-        {0x8003, 111},
-        {0x8006, 111},
-        {0x800a, 111},
-        {0x800f, 111},
-        {0x8018, 111},
-        {0x801f, 111},
-        {0x8029, 111},
-        {0xc038, 111},
-    },
-    /* 9 */
-    {
-        {0x8001, 115},
-        {0xc016, 115},
-        {0x8001, 116},
-        {0xc016, 116},
-        {0xc000, 32},
-        {0xc000, 37},
-        {0xc000, 45},
-        {0xc000, 46},
-        {0xc000, 47},
-        {0xc000, 51},
-        {0xc000, 52},
-        {0xc000, 53},
-        {0xc000, 54},
-        {0xc000, 55},
-        {0xc000, 56},
-        {0xc000, 57},
-    },
-    /* 10 */
-    {
-        {0x8002, 115},
-        {0x8009, 115},
-        {0x8017, 115},
-        {0xc028, 115},
-        {0x8002, 116},
-        {0x8009, 116},
-        {0x8017, 116},
-        {0xc028, 116},
-        {0x8001, 32},
-        {0xc016, 32},
-        {0x8001, 37},
-        {0xc016, 37},
-        {0x8001, 45},
-        {0xc016, 45},
-        {0x8001, 46},
-        {0xc016, 46},
-    },
-    /* 11 */
-    {
-        {0x8003, 115},
-        {0x8006, 115},
-        {0x800a, 115},
-        {0x800f, 115},
-        {0x8018, 115},
-        {0x801f, 115},
-        {0x8029, 115},
-        {0xc038, 115},
-        {0x8003, 116},
-        {0x8006, 116},
-        {0x800a, 116},
-        {0x800f, 116},
-        {0x8018, 116},
-        {0x801f, 116},
-        {0x8029, 116},
-        {0xc038, 116},
-    },
-    /* 12 */
-    {
-        {0x8002, 32},
-        {0x8009, 32},
-        {0x8017, 32},
-        {0xc028, 32},
-        {0x8002, 37},
-        {0x8009, 37},
-        {0x8017, 37},
-        {0xc028, 37},
-        {0x8002, 45},
-        {0x8009, 45},
-        {0x8017, 45},
-        {0xc028, 45},
-        {0x8002, 46},
-        {0x8009, 46},
-        {0x8017, 46},
-        {0xc028, 46},
-    },
-    /* 13 */
-    {
-        {0x8003, 32},
-        {0x8006, 32},
-        {0x800a, 32},
-        {0x800f, 32},
-        {0x8018, 32},
-        {0x801f, 32},
-        {0x8029, 32},
-        {0xc038, 32},
-        {0x8003, 37},
-        {0x8006, 37},
-        {0x800a, 37},
-        {0x800f, 37},
-        {0x8018, 37},
-        {0x801f, 37},
-        {0x8029, 37},
-        {0xc038, 37},
-    },
-    /* 14 */
-    {
-        {0x8003, 45},
-        {0x8006, 45},
-        {0x800a, 45},
-        {0x800f, 45},
-        {0x8018, 45},
-        {0x801f, 45},
-        {0x8029, 45},
-        {0xc038, 45},
-        {0x8003, 46},
-        {0x8006, 46},
-        {0x800a, 46},
-        {0x800f, 46},
-        {0x8018, 46},
-        {0x801f, 46},
-        {0x8029, 46},
-        {0xc038, 46},
-    },
-    /* 15 */
-    {
-        {0x8001, 47},
-        {0xc016, 47},
-        {0x8001, 51},
-        {0xc016, 51},
-        {0x8001, 52},
-        {0xc016, 52},
-        {0x8001, 53},
-        {0xc016, 53},
-        {0x8001, 54},
-        {0xc016, 54},
-        {0x8001, 55},
-        {0xc016, 55},
-        {0x8001, 56},
-        {0xc016, 56},
-        {0x8001, 57},
-        {0xc016, 57},
-    },
-    /* 16 */
-    {
-        {0x8002, 47},
-        {0x8009, 47},
-        {0x8017, 47},
-        {0xc028, 47},
-        {0x8002, 51},
-        {0x8009, 51},
-        {0x8017, 51},
-        {0xc028, 51},
-        {0x8002, 52},
-        {0x8009, 52},
-        {0x8017, 52},
-        {0xc028, 52},
-        {0x8002, 53},
-        {0x8009, 53},
-        {0x8017, 53},
-        {0xc028, 53},
-    },
-    /* 17 */
-    {
-        {0x8003, 47},
-        {0x8006, 47},
-        {0x800a, 47},
-        {0x800f, 47},
-        {0x8018, 47},
-        {0x801f, 47},
-        {0x8029, 47},
-        {0xc038, 47},
-        {0x8003, 51},
-        {0x8006, 51},
-        {0x800a, 51},
-        {0x800f, 51},
-        {0x8018, 51},
-        {0x801f, 51},
-        {0x8029, 51},
-        {0xc038, 51},
-    },
-    /* 18 */
-    {
-        {0x8003, 52},
-        {0x8006, 52},
-        {0x800a, 52},
-        {0x800f, 52},
-        {0x8018, 52},
-        {0x801f, 52},
-        {0x8029, 52},
-        {0xc038, 52},
-        {0x8003, 53},
-        {0x8006, 53},
-        {0x800a, 53},
-        {0x800f, 53},
-        {0x8018, 53},
-        {0x801f, 53},
-        {0x8029, 53},
-        {0xc038, 53},
-    },
-    /* 19 */
-    {
-        {0x8002, 54},
-        {0x8009, 54},
-        {0x8017, 54},
-        {0xc028, 54},
-        {0x8002, 55},
-        {0x8009, 55},
-        {0x8017, 55},
-        {0xc028, 55},
-        {0x8002, 56},
-        {0x8009, 56},
-        {0x8017, 56},
-        {0xc028, 56},
-        {0x8002, 57},
-        {0x8009, 57},
-        {0x8017, 57},
-        {0xc028, 57},
-    },
-    /* 20 */
-    {
-        {0x8003, 54},
-        {0x8006, 54},
-        {0x800a, 54},
-        {0x800f, 54},
-        {0x8018, 54},
-        {0x801f, 54},
-        {0x8029, 54},
-        {0xc038, 54},
-        {0x8003, 55},
-        {0x8006, 55},
-        {0x800a, 55},
-        {0x800f, 55},
-        {0x8018, 55},
-        {0x801f, 55},
-        {0x8029, 55},
-        {0xc038, 55},
-    },
-    /* 21 */
-    {
-        {0x8003, 56},
-        {0x8006, 56},
-        {0x800a, 56},
-        {0x800f, 56},
-        {0x8018, 56},
-        {0x801f, 56},
-        {0x8029, 56},
-        {0xc038, 56},
-        {0x8003, 57},
-        {0x8006, 57},
-        {0x800a, 57},
-        {0x800f, 57},
-        {0x8018, 57},
-        {0x801f, 57},
-        {0x8029, 57},
-        {0xc038, 57},
-    },
-    /* 22 */
-    {
-        {0x1a, 0},
-        {0x1b, 0},
-        {0x1d, 0},
-        {0x1e, 0},
-        {0x21, 0},
-        {0x22, 0},
-        {0x24, 0},
-        {0x25, 0},
-        {0x2b, 0},
-        {0x2e, 0},
-        {0x32, 0},
-        {0x35, 0},
-        {0x3a, 0},
-        {0x3d, 0},
-        {0x41, 0},
-        {0x4044, 0},
-    },
-    /* 23 */
-    {
-        {0xc000, 61},
-        {0xc000, 65},
-        {0xc000, 95},
-        {0xc000, 98},
-        {0xc000, 100},
-        {0xc000, 102},
-        {0xc000, 103},
-        {0xc000, 104},
-        {0xc000, 108},
-        {0xc000, 109},
-        {0xc000, 110},
-        {0xc000, 112},
-        {0xc000, 114},
-        {0xc000, 117},
-        {0x26, 0},
-        {0x27, 0},
-    },
-    /* 24 */
-    {
-        {0x8001, 61},
-        {0xc016, 61},
-        {0x8001, 65},
-        {0xc016, 65},
-        {0x8001, 95},
-        {0xc016, 95},
-        {0x8001, 98},
-        {0xc016, 98},
-        {0x8001, 100},
-        {0xc016, 100},
-        {0x8001, 102},
-        {0xc016, 102},
-        {0x8001, 103},
-        {0xc016, 103},
-        {0x8001, 104},
-        {0xc016, 104},
-    },
-    /* 25 */
-    {
-        {0x8002, 61},
-        {0x8009, 61},
-        {0x8017, 61},
-        {0xc028, 61},
-        {0x8002, 65},
-        {0x8009, 65},
-        {0x8017, 65},
-        {0xc028, 65},
-        {0x8002, 95},
-        {0x8009, 95},
-        {0x8017, 95},
-        {0xc028, 95},
-        {0x8002, 98},
-        {0x8009, 98},
-        {0x8017, 98},
-        {0xc028, 98},
-    },
-    /* 26 */
-    {
-        {0x8003, 61},
-        {0x8006, 61},
-        {0x800a, 61},
-        {0x800f, 61},
-        {0x8018, 61},
-        {0x801f, 61},
-        {0x8029, 61},
-        {0xc038, 61},
-        {0x8003, 65},
-        {0x8006, 65},
-        {0x800a, 65},
-        {0x800f, 65},
-        {0x8018, 65},
-        {0x801f, 65},
-        {0x8029, 65},
-        {0xc038, 65},
-    },
-    /* 27 */
-    {
-        {0x8003, 95},
-        {0x8006, 95},
-        {0x800a, 95},
-        {0x800f, 95},
-        {0x8018, 95},
-        {0x801f, 95},
-        {0x8029, 95},
-        {0xc038, 95},
-        {0x8003, 98},
-        {0x8006, 98},
-        {0x800a, 98},
-        {0x800f, 98},
-        {0x8018, 98},
-        {0x801f, 98},
-        {0x8029, 98},
-        {0xc038, 98},
-    },
-    /* 28 */
-    {
-        {0x8002, 100},
-        {0x8009, 100},
-        {0x8017, 100},
-        {0xc028, 100},
-        {0x8002, 102},
-        {0x8009, 102},
-        {0x8017, 102},
-        {0xc028, 102},
-        {0x8002, 103},
-        {0x8009, 103},
-        {0x8017, 103},
-        {0xc028, 103},
-        {0x8002, 104},
-        {0x8009, 104},
-        {0x8017, 104},
-        {0xc028, 104},
-    },
-    /* 29 */
-    {
-        {0x8003, 100},
-        {0x8006, 100},
-        {0x800a, 100},
-        {0x800f, 100},
-        {0x8018, 100},
-        {0x801f, 100},
-        {0x8029, 100},
-        {0xc038, 100},
-        {0x8003, 102},
-        {0x8006, 102},
-        {0x800a, 102},
-        {0x800f, 102},
-        {0x8018, 102},
-        {0x801f, 102},
-        {0x8029, 102},
-        {0xc038, 102},
-    },
-    /* 30 */
-    {
-        {0x8003, 103},
-        {0x8006, 103},
-        {0x800a, 103},
-        {0x800f, 103},
-        {0x8018, 103},
-        {0x801f, 103},
-        {0x8029, 103},
-        {0xc038, 103},
-        {0x8003, 104},
-        {0x8006, 104},
-        {0x800a, 104},
-        {0x800f, 104},
-        {0x8018, 104},
-        {0x801f, 104},
-        {0x8029, 104},
-        {0xc038, 104},
-    },
-    /* 31 */
-    {
-        {0x8001, 108},
-        {0xc016, 108},
-        {0x8001, 109},
-        {0xc016, 109},
-        {0x8001, 110},
-        {0xc016, 110},
-        {0x8001, 112},
-        {0xc016, 112},
-        {0x8001, 114},
-        {0xc016, 114},
-        {0x8001, 117},
-        {0xc016, 117},
-        {0xc000, 58},
-        {0xc000, 66},
-        {0xc000, 67},
-        {0xc000, 68},
-    },
-    /* 32 */
-    {
-        {0x8002, 108},
-        {0x8009, 108},
-        {0x8017, 108},
-        {0xc028, 108},
-        {0x8002, 109},
-        {0x8009, 109},
-        {0x8017, 109},
-        {0xc028, 109},
-        {0x8002, 110},
-        {0x8009, 110},
-        {0x8017, 110},
-        {0xc028, 110},
-        {0x8002, 112},
-        {0x8009, 112},
-        {0x8017, 112},
-        {0xc028, 112},
-    },
-    /* 33 */
-    {
-        {0x8003, 108},
-        {0x8006, 108},
-        {0x800a, 108},
-        {0x800f, 108},
-        {0x8018, 108},
-        {0x801f, 108},
-        {0x8029, 108},
-        {0xc038, 108},
-        {0x8003, 109},
-        {0x8006, 109},
-        {0x800a, 109},
-        {0x800f, 109},
-        {0x8018, 109},
-        {0x801f, 109},
-        {0x8029, 109},
-        {0xc038, 109},
-    },
-    /* 34 */
-    {
-        {0x8003, 110},
-        {0x8006, 110},
-        {0x800a, 110},
-        {0x800f, 110},
-        {0x8018, 110},
-        {0x801f, 110},
-        {0x8029, 110},
-        {0xc038, 110},
-        {0x8003, 112},
-        {0x8006, 112},
-        {0x800a, 112},
-        {0x800f, 112},
-        {0x8018, 112},
-        {0x801f, 112},
-        {0x8029, 112},
-        {0xc038, 112},
-    },
-    /* 35 */
-    {
-        {0x8002, 114},
-        {0x8009, 114},
-        {0x8017, 114},
-        {0xc028, 114},
-        {0x8002, 117},
-        {0x8009, 117},
-        {0x8017, 117},
-        {0xc028, 117},
-        {0x8001, 58},
-        {0xc016, 58},
-        {0x8001, 66},
-        {0xc016, 66},
-        {0x8001, 67},
-        {0xc016, 67},
-        {0x8001, 68},
-        {0xc016, 68},
-    },
-    /* 36 */
-    {
-        {0x8003, 114},
-        {0x8006, 114},
-        {0x800a, 114},
-        {0x800f, 114},
-        {0x8018, 114},
-        {0x801f, 114},
-        {0x8029, 114},
-        {0xc038, 114},
-        {0x8003, 117},
-        {0x8006, 117},
-        {0x800a, 117},
-        {0x800f, 117},
-        {0x8018, 117},
-        {0x801f, 117},
-        {0x8029, 117},
-        {0xc038, 117},
-    },
-    /* 37 */
-    {
-        {0x8002, 58},
-        {0x8009, 58},
-        {0x8017, 58},
-        {0xc028, 58},
-        {0x8002, 66},
-        {0x8009, 66},
-        {0x8017, 66},
-        {0xc028, 66},
-        {0x8002, 67},
-        {0x8009, 67},
-        {0x8017, 67},
-        {0xc028, 67},
-        {0x8002, 68},
-        {0x8009, 68},
-        {0x8017, 68},
-        {0xc028, 68},
-    },
-    /* 38 */
-    {
-        {0x8003, 58},
-        {0x8006, 58},
-        {0x800a, 58},
-        {0x800f, 58},
-        {0x8018, 58},
-        {0x801f, 58},
-        {0x8029, 58},
-        {0xc038, 58},
-        {0x8003, 66},
-        {0x8006, 66},
-        {0x800a, 66},
-        {0x800f, 66},
-        {0x8018, 66},
-        {0x801f, 66},
-        {0x8029, 66},
-        {0xc038, 66},
-    },
-    /* 39 */
-    {
-        {0x8003, 67},
-        {0x8006, 67},
-        {0x800a, 67},
-        {0x800f, 67},
-        {0x8018, 67},
-        {0x801f, 67},
-        {0x8029, 67},
-        {0xc038, 67},
-        {0x8003, 68},
-        {0x8006, 68},
-        {0x800a, 68},
-        {0x800f, 68},
-        {0x8018, 68},
-        {0x801f, 68},
-        {0x8029, 68},
-        {0xc038, 68},
-    },
-    /* 40 */
-    {
-        {0x2c, 0},
-        {0x2d, 0},
-        {0x2f, 0},
-        {0x30, 0},
-        {0x33, 0},
-        {0x34, 0},
-        {0x36, 0},
-        {0x37, 0},
-        {0x3b, 0},
-        {0x3c, 0},
-        {0x3e, 0},
-        {0x3f, 0},
-        {0x42, 0},
-        {0x43, 0},
-        {0x45, 0},
-        {0x4048, 0},
-    },
-    /* 41 */
-    {
-        {0xc000, 69},
-        {0xc000, 70},
-        {0xc000, 71},
-        {0xc000, 72},
-        {0xc000, 73},
-        {0xc000, 74},
-        {0xc000, 75},
-        {0xc000, 76},
-        {0xc000, 77},
-        {0xc000, 78},
-        {0xc000, 79},
-        {0xc000, 80},
-        {0xc000, 81},
-        {0xc000, 82},
-        {0xc000, 83},
-        {0xc000, 84},
-    },
-    /* 42 */
-    {
-        {0x8001, 69},
-        {0xc016, 69},
-        {0x8001, 70},
-        {0xc016, 70},
-        {0x8001, 71},
-        {0xc016, 71},
-        {0x8001, 72},
-        {0xc016, 72},
-        {0x8001, 73},
-        {0xc016, 73},
-        {0x8001, 74},
-        {0xc016, 74},
-        {0x8001, 75},
-        {0xc016, 75},
-        {0x8001, 76},
-        {0xc016, 76},
-    },
-    /* 43 */
-    {
-        {0x8002, 69},
-        {0x8009, 69},
-        {0x8017, 69},
-        {0xc028, 69},
-        {0x8002, 70},
-        {0x8009, 70},
-        {0x8017, 70},
-        {0xc028, 70},
-        {0x8002, 71},
-        {0x8009, 71},
-        {0x8017, 71},
-        {0xc028, 71},
-        {0x8002, 72},
-        {0x8009, 72},
-        {0x8017, 72},
-        {0xc028, 72},
-    },
-    /* 44 */
-    {
-        {0x8003, 69},
-        {0x8006, 69},
-        {0x800a, 69},
-        {0x800f, 69},
-        {0x8018, 69},
-        {0x801f, 69},
-        {0x8029, 69},
-        {0xc038, 69},
-        {0x8003, 70},
-        {0x8006, 70},
-        {0x800a, 70},
-        {0x800f, 70},
-        {0x8018, 70},
-        {0x801f, 70},
-        {0x8029, 70},
-        {0xc038, 70},
-    },
-    /* 45 */
-    {
-        {0x8003, 71},
-        {0x8006, 71},
-        {0x800a, 71},
-        {0x800f, 71},
-        {0x8018, 71},
-        {0x801f, 71},
-        {0x8029, 71},
-        {0xc038, 71},
-        {0x8003, 72},
-        {0x8006, 72},
-        {0x800a, 72},
-        {0x800f, 72},
-        {0x8018, 72},
-        {0x801f, 72},
-        {0x8029, 72},
-        {0xc038, 72},
-    },
-    /* 46 */
-    {
-        {0x8002, 73},
-        {0x8009, 73},
-        {0x8017, 73},
-        {0xc028, 73},
-        {0x8002, 74},
-        {0x8009, 74},
-        {0x8017, 74},
-        {0xc028, 74},
-        {0x8002, 75},
-        {0x8009, 75},
-        {0x8017, 75},
-        {0xc028, 75},
-        {0x8002, 76},
-        {0x8009, 76},
-        {0x8017, 76},
-        {0xc028, 76},
-    },
-    /* 47 */
-    {
-        {0x8003, 73},
-        {0x8006, 73},
-        {0x800a, 73},
-        {0x800f, 73},
-        {0x8018, 73},
-        {0x801f, 73},
-        {0x8029, 73},
-        {0xc038, 73},
-        {0x8003, 74},
-        {0x8006, 74},
-        {0x800a, 74},
-        {0x800f, 74},
-        {0x8018, 74},
-        {0x801f, 74},
-        {0x8029, 74},
-        {0xc038, 74},
-    },
-    /* 48 */
-    {
-        {0x8003, 75},
-        {0x8006, 75},
-        {0x800a, 75},
-        {0x800f, 75},
-        {0x8018, 75},
-        {0x801f, 75},
-        {0x8029, 75},
-        {0xc038, 75},
-        {0x8003, 76},
-        {0x8006, 76},
-        {0x800a, 76},
-        {0x800f, 76},
-        {0x8018, 76},
-        {0x801f, 76},
-        {0x8029, 76},
-        {0xc038, 76},
-    },
-    /* 49 */
-    {
-        {0x8001, 77},
-        {0xc016, 77},
-        {0x8001, 78},
-        {0xc016, 78},
-        {0x8001, 79},
-        {0xc016, 79},
-        {0x8001, 80},
-        {0xc016, 80},
-        {0x8001, 81},
-        {0xc016, 81},
-        {0x8001, 82},
-        {0xc016, 82},
-        {0x8001, 83},
-        {0xc016, 83},
-        {0x8001, 84},
-        {0xc016, 84},
-    },
-    /* 50 */
-    {
-        {0x8002, 77},
-        {0x8009, 77},
-        {0x8017, 77},
-        {0xc028, 77},
-        {0x8002, 78},
-        {0x8009, 78},
-        {0x8017, 78},
-        {0xc028, 78},
-        {0x8002, 79},
-        {0x8009, 79},
-        {0x8017, 79},
-        {0xc028, 79},
-        {0x8002, 80},
-        {0x8009, 80},
-        {0x8017, 80},
-        {0xc028, 80},
-    },
-    /* 51 */
-    {
-        {0x8003, 77},
-        {0x8006, 77},
-        {0x800a, 77},
-        {0x800f, 77},
-        {0x8018, 77},
-        {0x801f, 77},
-        {0x8029, 77},
-        {0xc038, 77},
-        {0x8003, 78},
-        {0x8006, 78},
-        {0x800a, 78},
-        {0x800f, 78},
-        {0x8018, 78},
-        {0x801f, 78},
-        {0x8029, 78},
-        {0xc038, 78},
-    },
-    /* 52 */
-    {
-        {0x8003, 79},
-        {0x8006, 79},
-        {0x800a, 79},
-        {0x800f, 79},
-        {0x8018, 79},
-        {0x801f, 79},
-        {0x8029, 79},
-        {0xc038, 79},
-        {0x8003, 80},
-        {0x8006, 80},
-        {0x800a, 80},
-        {0x800f, 80},
-        {0x8018, 80},
-        {0x801f, 80},
-        {0x8029, 80},
-        {0xc038, 80},
-    },
-    /* 53 */
-    {
-        {0x8002, 81},
-        {0x8009, 81},
-        {0x8017, 81},
-        {0xc028, 81},
-        {0x8002, 82},
-        {0x8009, 82},
-        {0x8017, 82},
-        {0xc028, 82},
-        {0x8002, 83},
-        {0x8009, 83},
-        {0x8017, 83},
-        {0xc028, 83},
-        {0x8002, 84},
-        {0x8009, 84},
-        {0x8017, 84},
-        {0xc028, 84},
-    },
-    /* 54 */
-    {
-        {0x8003, 81},
-        {0x8006, 81},
-        {0x800a, 81},
-        {0x800f, 81},
-        {0x8018, 81},
-        {0x801f, 81},
-        {0x8029, 81},
-        {0xc038, 81},
-        {0x8003, 82},
-        {0x8006, 82},
-        {0x800a, 82},
-        {0x800f, 82},
-        {0x8018, 82},
-        {0x801f, 82},
-        {0x8029, 82},
-        {0xc038, 82},
-    },
-    /* 55 */
-    {
-        {0x8003, 83},
-        {0x8006, 83},
-        {0x800a, 83},
-        {0x800f, 83},
-        {0x8018, 83},
-        {0x801f, 83},
-        {0x8029, 83},
-        {0xc038, 83},
-        {0x8003, 84},
-        {0x8006, 84},
-        {0x800a, 84},
-        {0x800f, 84},
-        {0x8018, 84},
-        {0x801f, 84},
-        {0x8029, 84},
-        {0xc038, 84},
-    },
-    /* 56 */
-    {
-        {0xc000, 85},
-        {0xc000, 86},
-        {0xc000, 87},
-        {0xc000, 89},
-        {0xc000, 106},
-        {0xc000, 107},
-        {0xc000, 113},
-        {0xc000, 118},
-        {0xc000, 119},
-        {0xc000, 120},
-        {0xc000, 121},
-        {0xc000, 122},
-        {0x46, 0},
-        {0x47, 0},
-        {0x49, 0},
-        {0x404a, 0},
-    },
-    /* 57 */
-    {
-        {0x8001, 85},
-        {0xc016, 85},
-        {0x8001, 86},
-        {0xc016, 86},
-        {0x8001, 87},
-        {0xc016, 87},
-        {0x8001, 89},
-        {0xc016, 89},
-        {0x8001, 106},
-        {0xc016, 106},
-        {0x8001, 107},
-        {0xc016, 107},
-        {0x8001, 113},
-        {0xc016, 113},
-        {0x8001, 118},
-        {0xc016, 118},
-    },
-    /* 58 */
-    {
-        {0x8002, 85},
-        {0x8009, 85},
-        {0x8017, 85},
-        {0xc028, 85},
-        {0x8002, 86},
-        {0x8009, 86},
-        {0x8017, 86},
-        {0xc028, 86},
-        {0x8002, 87},
-        {0x8009, 87},
-        {0x8017, 87},
-        {0xc028, 87},
-        {0x8002, 89},
-        {0x8009, 89},
-        {0x8017, 89},
-        {0xc028, 89},
-    },
-    /* 59 */
-    {
-        {0x8003, 85},
-        {0x8006, 85},
-        {0x800a, 85},
-        {0x800f, 85},
-        {0x8018, 85},
-        {0x801f, 85},
-        {0x8029, 85},
-        {0xc038, 85},
-        {0x8003, 86},
-        {0x8006, 86},
-        {0x800a, 86},
-        {0x800f, 86},
-        {0x8018, 86},
-        {0x801f, 86},
-        {0x8029, 86},
-        {0xc038, 86},
-    },
-    /* 60 */
-    {
-        {0x8003, 87},
-        {0x8006, 87},
-        {0x800a, 87},
-        {0x800f, 87},
-        {0x8018, 87},
-        {0x801f, 87},
-        {0x8029, 87},
-        {0xc038, 87},
-        {0x8003, 89},
-        {0x8006, 89},
-        {0x800a, 89},
-        {0x800f, 89},
-        {0x8018, 89},
-        {0x801f, 89},
-        {0x8029, 89},
-        {0xc038, 89},
-    },
-    /* 61 */
-    {
-        {0x8002, 106},
-        {0x8009, 106},
-        {0x8017, 106},
-        {0xc028, 106},
-        {0x8002, 107},
-        {0x8009, 107},
-        {0x8017, 107},
-        {0xc028, 107},
-        {0x8002, 113},
-        {0x8009, 113},
-        {0x8017, 113},
-        {0xc028, 113},
-        {0x8002, 118},
-        {0x8009, 118},
-        {0x8017, 118},
-        {0xc028, 118},
-    },
-    /* 62 */
-    {
-        {0x8003, 106},
-        {0x8006, 106},
-        {0x800a, 106},
-        {0x800f, 106},
-        {0x8018, 106},
-        {0x801f, 106},
-        {0x8029, 106},
-        {0xc038, 106},
-        {0x8003, 107},
-        {0x8006, 107},
-        {0x800a, 107},
-        {0x800f, 107},
-        {0x8018, 107},
-        {0x801f, 107},
-        {0x8029, 107},
-        {0xc038, 107},
-    },
-    /* 63 */
-    {
-        {0x8003, 113},
-        {0x8006, 113},
-        {0x800a, 113},
-        {0x800f, 113},
-        {0x8018, 113},
-        {0x801f, 113},
-        {0x8029, 113},
-        {0xc038, 113},
-        {0x8003, 118},
-        {0x8006, 118},
-        {0x800a, 118},
-        {0x800f, 118},
-        {0x8018, 118},
-        {0x801f, 118},
-        {0x8029, 118},
-        {0xc038, 118},
-    },
-    /* 64 */
-    {
-        {0x8001, 119},
-        {0xc016, 119},
-        {0x8001, 120},
-        {0xc016, 120},
-        {0x8001, 121},
-        {0xc016, 121},
-        {0x8001, 122},
-        {0xc016, 122},
-        {0xc000, 38},
-        {0xc000, 42},
-        {0xc000, 44},
-        {0xc000, 59},
-        {0xc000, 88},
-        {0xc000, 90},
-        {0x4b, 0},
-        {0x4e, 0},
-    },
-    /* 65 */
-    {
-        {0x8002, 119},
-        {0x8009, 119},
-        {0x8017, 119},
-        {0xc028, 119},
-        {0x8002, 120},
-        {0x8009, 120},
-        {0x8017, 120},
-        {0xc028, 120},
-        {0x8002, 121},
-        {0x8009, 121},
-        {0x8017, 121},
-        {0xc028, 121},
-        {0x8002, 122},
-        {0x8009, 122},
-        {0x8017, 122},
-        {0xc028, 122},
-    },
-    /* 66 */
-    {
-        {0x8003, 119},
-        {0x8006, 119},
-        {0x800a, 119},
-        {0x800f, 119},
-        {0x8018, 119},
-        {0x801f, 119},
-        {0x8029, 119},
-        {0xc038, 119},
-        {0x8003, 120},
-        {0x8006, 120},
-        {0x800a, 120},
-        {0x800f, 120},
-        {0x8018, 120},
-        {0x801f, 120},
-        {0x8029, 120},
-        {0xc038, 120},
-    },
-    /* 67 */
-    {
-        {0x8003, 121},
-        {0x8006, 121},
-        {0x800a, 121},
-        {0x800f, 121},
-        {0x8018, 121},
-        {0x801f, 121},
-        {0x8029, 121},
-        {0xc038, 121},
-        {0x8003, 122},
-        {0x8006, 122},
-        {0x800a, 122},
-        {0x800f, 122},
-        {0x8018, 122},
-        {0x801f, 122},
-        {0x8029, 122},
-        {0xc038, 122},
-    },
-    /* 68 */
-    {
-        {0x8001, 38},
-        {0xc016, 38},
-        {0x8001, 42},
-        {0xc016, 42},
-        {0x8001, 44},
-        {0xc016, 44},
-        {0x8001, 59},
-        {0xc016, 59},
-        {0x8001, 88},
-        {0xc016, 88},
-        {0x8001, 90},
-        {0xc016, 90},
-        {0x4c, 0},
-        {0x4d, 0},
-        {0x4f, 0},
-        {0x51, 0},
-    },
-    /* 69 */
-    {
-        {0x8002, 38},
-        {0x8009, 38},
-        {0x8017, 38},
-        {0xc028, 38},
-        {0x8002, 42},
-        {0x8009, 42},
-        {0x8017, 42},
-        {0xc028, 42},
-        {0x8002, 44},
-        {0x8009, 44},
-        {0x8017, 44},
-        {0xc028, 44},
-        {0x8002, 59},
-        {0x8009, 59},
-        {0x8017, 59},
-        {0xc028, 59},
-    },
-    /* 70 */
-    {
-        {0x8003, 38},
-        {0x8006, 38},
-        {0x800a, 38},
-        {0x800f, 38},
-        {0x8018, 38},
-        {0x801f, 38},
-        {0x8029, 38},
-        {0xc038, 38},
-        {0x8003, 42},
-        {0x8006, 42},
-        {0x800a, 42},
-        {0x800f, 42},
-        {0x8018, 42},
-        {0x801f, 42},
-        {0x8029, 42},
-        {0xc038, 42},
-    },
-    /* 71 */
-    {
-        {0x8003, 44},
-        {0x8006, 44},
-        {0x800a, 44},
-        {0x800f, 44},
-        {0x8018, 44},
-        {0x801f, 44},
-        {0x8029, 44},
-        {0xc038, 44},
-        {0x8003, 59},
-        {0x8006, 59},
-        {0x800a, 59},
-        {0x800f, 59},
-        {0x8018, 59},
-        {0x801f, 59},
-        {0x8029, 59},
-        {0xc038, 59},
-    },
-    /* 72 */
-    {
-        {0x8002, 88},
-        {0x8009, 88},
-        {0x8017, 88},
-        {0xc028, 88},
-        {0x8002, 90},
-        {0x8009, 90},
-        {0x8017, 90},
-        {0xc028, 90},
-        {0xc000, 33},
-        {0xc000, 34},
-        {0xc000, 40},
-        {0xc000, 41},
-        {0xc000, 63},
-        {0x50, 0},
-        {0x52, 0},
-        {0x54, 0},
-    },
-    /* 73 */
-    {
-        {0x8003, 88},
-        {0x8006, 88},
-        {0x800a, 88},
-        {0x800f, 88},
-        {0x8018, 88},
-        {0x801f, 88},
-        {0x8029, 88},
-        {0xc038, 88},
-        {0x8003, 90},
-        {0x8006, 90},
-        {0x800a, 90},
-        {0x800f, 90},
-        {0x8018, 90},
-        {0x801f, 90},
-        {0x8029, 90},
-        {0xc038, 90},
-    },
-    /* 74 */
-    {
-        {0x8001, 33},
-        {0xc016, 33},
-        {0x8001, 34},
-        {0xc016, 34},
-        {0x8001, 40},
-        {0xc016, 40},
-        {0x8001, 41},
-        {0xc016, 41},
-        {0x8001, 63},
-        {0xc016, 63},
-        {0xc000, 39},
-        {0xc000, 43},
-        {0xc000, 124},
-        {0x53, 0},
-        {0x55, 0},
-        {0x58, 0},
-    },
-    /* 75 */
-    {
-        {0x8002, 33},
-        {0x8009, 33},
-        {0x8017, 33},
-        {0xc028, 33},
-        {0x8002, 34},
-        {0x8009, 34},
-        {0x8017, 34},
-        {0xc028, 34},
-        {0x8002, 40},
-        {0x8009, 40},
-        {0x8017, 40},
-        {0xc028, 40},
-        {0x8002, 41},
-        {0x8009, 41},
-        {0x8017, 41},
-        {0xc028, 41},
-    },
-    /* 76 */
-    {
-        {0x8003, 33},
-        {0x8006, 33},
-        {0x800a, 33},
-        {0x800f, 33},
-        {0x8018, 33},
-        {0x801f, 33},
-        {0x8029, 33},
-        {0xc038, 33},
-        {0x8003, 34},
-        {0x8006, 34},
-        {0x800a, 34},
-        {0x800f, 34},
-        {0x8018, 34},
-        {0x801f, 34},
-        {0x8029, 34},
-        {0xc038, 34},
-    },
-    /* 77 */
-    {
-        {0x8003, 40},
-        {0x8006, 40},
-        {0x800a, 40},
-        {0x800f, 40},
-        {0x8018, 40},
-        {0x801f, 40},
-        {0x8029, 40},
-        {0xc038, 40},
-        {0x8003, 41},
-        {0x8006, 41},
-        {0x800a, 41},
-        {0x800f, 41},
-        {0x8018, 41},
-        {0x801f, 41},
-        {0x8029, 41},
-        {0xc038, 41},
-    },
-    /* 78 */
-    {
-        {0x8002, 63},
-        {0x8009, 63},
-        {0x8017, 63},
-        {0xc028, 63},
-        {0x8001, 39},
-        {0xc016, 39},
-        {0x8001, 43},
-        {0xc016, 43},
-        {0x8001, 124},
-        {0xc016, 124},
-        {0xc000, 35},
-        {0xc000, 62},
-        {0x56, 0},
-        {0x57, 0},
-        {0x59, 0},
-        {0x5a, 0},
-    },
-    /* 79 */
-    {
-        {0x8003, 63},
-        {0x8006, 63},
-        {0x800a, 63},
-        {0x800f, 63},
-        {0x8018, 63},
-        {0x801f, 63},
-        {0x8029, 63},
-        {0xc038, 63},
-        {0x8002, 39},
-        {0x8009, 39},
-        {0x8017, 39},
-        {0xc028, 39},
-        {0x8002, 43},
-        {0x8009, 43},
-        {0x8017, 43},
-        {0xc028, 43},
-    },
-    /* 80 */
-    {
-        {0x8003, 39},
-        {0x8006, 39},
-        {0x800a, 39},
-        {0x800f, 39},
-        {0x8018, 39},
-        {0x801f, 39},
-        {0x8029, 39},
-        {0xc038, 39},
-        {0x8003, 43},
-        {0x8006, 43},
-        {0x800a, 43},
-        {0x800f, 43},
-        {0x8018, 43},
-        {0x801f, 43},
-        {0x8029, 43},
-        {0xc038, 43},
-    },
-    /* 81 */
-    {
-        {0x8002, 124},
-        {0x8009, 124},
-        {0x8017, 124},
-        {0xc028, 124},
-        {0x8001, 35},
-        {0xc016, 35},
-        {0x8001, 62},
-        {0xc016, 62},
-        {0xc000, 0},
-        {0xc000, 36},
-        {0xc000, 64},
-        {0xc000, 91},
-        {0xc000, 93},
-        {0xc000, 126},
-        {0x5b, 0},
-        {0x5c, 0},
-    },
-    /* 82 */
-    {
-        {0x8003, 124},
-        {0x8006, 124},
-        {0x800a, 124},
-        {0x800f, 124},
-        {0x8018, 124},
-        {0x801f, 124},
-        {0x8029, 124},
-        {0xc038, 124},
-        {0x8002, 35},
-        {0x8009, 35},
-        {0x8017, 35},
-        {0xc028, 35},
-        {0x8002, 62},
-        {0x8009, 62},
-        {0x8017, 62},
-        {0xc028, 62},
-    },
-    /* 83 */
-    {
-        {0x8003, 35},
-        {0x8006, 35},
-        {0x800a, 35},
-        {0x800f, 35},
-        {0x8018, 35},
-        {0x801f, 35},
-        {0x8029, 35},
-        {0xc038, 35},
-        {0x8003, 62},
-        {0x8006, 62},
-        {0x800a, 62},
-        {0x800f, 62},
-        {0x8018, 62},
-        {0x801f, 62},
-        {0x8029, 62},
-        {0xc038, 62},
-    },
-    /* 84 */
-    {
-        {0x8001, 0},
-        {0xc016, 0},
-        {0x8001, 36},
-        {0xc016, 36},
-        {0x8001, 64},
-        {0xc016, 64},
-        {0x8001, 91},
-        {0xc016, 91},
-        {0x8001, 93},
-        {0xc016, 93},
-        {0x8001, 126},
-        {0xc016, 126},
-        {0xc000, 94},
-        {0xc000, 125},
-        {0x5d, 0},
-        {0x5e, 0},
-    },
-    /* 85 */
-    {
-        {0x8002, 0},
-        {0x8009, 0},
-        {0x8017, 0},
-        {0xc028, 0},
-        {0x8002, 36},
-        {0x8009, 36},
-        {0x8017, 36},
-        {0xc028, 36},
-        {0x8002, 64},
-        {0x8009, 64},
-        {0x8017, 64},
-        {0xc028, 64},
-        {0x8002, 91},
-        {0x8009, 91},
-        {0x8017, 91},
-        {0xc028, 91},
-    },
-    /* 86 */
-    {
-        {0x8003, 0},
-        {0x8006, 0},
-        {0x800a, 0},
-        {0x800f, 0},
-        {0x8018, 0},
-        {0x801f, 0},
-        {0x8029, 0},
-        {0xc038, 0},
-        {0x8003, 36},
-        {0x8006, 36},
-        {0x800a, 36},
-        {0x800f, 36},
-        {0x8018, 36},
-        {0x801f, 36},
-        {0x8029, 36},
-        {0xc038, 36},
-    },
-    /* 87 */
-    {
-        {0x8003, 64},
-        {0x8006, 64},
-        {0x800a, 64},
-        {0x800f, 64},
-        {0x8018, 64},
-        {0x801f, 64},
-        {0x8029, 64},
-        {0xc038, 64},
-        {0x8003, 91},
-        {0x8006, 91},
-        {0x800a, 91},
-        {0x800f, 91},
-        {0x8018, 91},
-        {0x801f, 91},
-        {0x8029, 91},
-        {0xc038, 91},
-    },
-    /* 88 */
-    {
-        {0x8002, 93},
-        {0x8009, 93},
-        {0x8017, 93},
-        {0xc028, 93},
-        {0x8002, 126},
-        {0x8009, 126},
-        {0x8017, 126},
-        {0xc028, 126},
-        {0x8001, 94},
-        {0xc016, 94},
-        {0x8001, 125},
-        {0xc016, 125},
-        {0xc000, 60},
-        {0xc000, 96},
-        {0xc000, 123},
-        {0x5f, 0},
-    },
-    /* 89 */
-    {
-        {0x8003, 93},
-        {0x8006, 93},
-        {0x800a, 93},
-        {0x800f, 93},
-        {0x8018, 93},
-        {0x801f, 93},
-        {0x8029, 93},
-        {0xc038, 93},
-        {0x8003, 126},
-        {0x8006, 126},
-        {0x800a, 126},
-        {0x800f, 126},
-        {0x8018, 126},
-        {0x801f, 126},
-        {0x8029, 126},
-        {0xc038, 126},
-    },
-    /* 90 */
-    {
-        {0x8002, 94},
-        {0x8009, 94},
-        {0x8017, 94},
-        {0xc028, 94},
-        {0x8002, 125},
-        {0x8009, 125},
-        {0x8017, 125},
-        {0xc028, 125},
-        {0x8001, 60},
-        {0xc016, 60},
-        {0x8001, 96},
-        {0xc016, 96},
-        {0x8001, 123},
-        {0xc016, 123},
-        {0x60, 0},
-        {0x6e, 0},
-    },
-    /* 91 */
-    {
-        {0x8003, 94},
-        {0x8006, 94},
-        {0x800a, 94},
-        {0x800f, 94},
-        {0x8018, 94},
-        {0x801f, 94},
-        {0x8029, 94},
-        {0xc038, 94},
-        {0x8003, 125},
-        {0x8006, 125},
-        {0x800a, 125},
-        {0x800f, 125},
-        {0x8018, 125},
-        {0x801f, 125},
-        {0x8029, 125},
-        {0xc038, 125},
-    },
-    /* 92 */
-    {
-        {0x8002, 60},
-        {0x8009, 60},
-        {0x8017, 60},
-        {0xc028, 60},
-        {0x8002, 96},
-        {0x8009, 96},
-        {0x8017, 96},
-        {0xc028, 96},
-        {0x8002, 123},
-        {0x8009, 123},
-        {0x8017, 123},
-        {0xc028, 123},
-        {0x61, 0},
-        {0x65, 0},
-        {0x6f, 0},
-        {0x85, 0},
-    },
-    /* 93 */
-    {
-        {0x8003, 60},
-        {0x8006, 60},
-        {0x800a, 60},
-        {0x800f, 60},
-        {0x8018, 60},
-        {0x801f, 60},
-        {0x8029, 60},
-        {0xc038, 60},
-        {0x8003, 96},
-        {0x8006, 96},
-        {0x800a, 96},
-        {0x800f, 96},
-        {0x8018, 96},
-        {0x801f, 96},
-        {0x8029, 96},
-        {0xc038, 96},
-    },
-    /* 94 */
-    {
-        {0x8003, 123},
-        {0x8006, 123},
-        {0x800a, 123},
-        {0x800f, 123},
-        {0x8018, 123},
-        {0x801f, 123},
-        {0x8029, 123},
-        {0xc038, 123},
-        {0x62, 0},
-        {0x63, 0},
-        {0x66, 0},
-        {0x69, 0},
-        {0x70, 0},
-        {0x77, 0},
-        {0x86, 0},
-        {0x99, 0},
-    },
-    /* 95 */
-    {
-        {0xc000, 92},
-        {0xc000, 195},
-        {0xc000, 208},
-        {0x64, 0},
-        {0x67, 0},
-        {0x68, 0},
-        {0x6a, 0},
-        {0x6b, 0},
-        {0x71, 0},
-        {0x74, 0},
-        {0x78, 0},
-        {0x7e, 0},
-        {0x87, 0},
-        {0x8e, 0},
-        {0x9a, 0},
-        {0xa9, 0},
-    },
-    /* 96 */
-    {
-        {0x8001, 92},
-        {0xc016, 92},
-        {0x8001, 195},
-        {0xc016, 195},
-        {0x8001, 208},
-        {0xc016, 208},
-        {0xc000, 128},
-        {0xc000, 130},
-        {0xc000, 131},
-        {0xc000, 162},
-        {0xc000, 184},
-        {0xc000, 194},
-        {0xc000, 224},
-        {0xc000, 226},
-        {0x6c, 0},
-        {0x6d, 0},
-    },
-    /* 97 */
-    {
-        {0x8002, 92},
-        {0x8009, 92},
-        {0x8017, 92},
-        {0xc028, 92},
-        {0x8002, 195},
-        {0x8009, 195},
-        {0x8017, 195},
-        {0xc028, 195},
-        {0x8002, 208},
-        {0x8009, 208},
-        {0x8017, 208},
-        {0xc028, 208},
-        {0x8001, 128},
-        {0xc016, 128},
-        {0x8001, 130},
-        {0xc016, 130},
-    },
-    /* 98 */
-    {
-        {0x8003, 92},
-        {0x8006, 92},
-        {0x800a, 92},
-        {0x800f, 92},
-        {0x8018, 92},
-        {0x801f, 92},
-        {0x8029, 92},
-        {0xc038, 92},
-        {0x8003, 195},
-        {0x8006, 195},
-        {0x800a, 195},
-        {0x800f, 195},
-        {0x8018, 195},
-        {0x801f, 195},
-        {0x8029, 195},
-        {0xc038, 195},
-    },
-    /* 99 */
-    {
-        {0x8003, 208},
-        {0x8006, 208},
-        {0x800a, 208},
-        {0x800f, 208},
-        {0x8018, 208},
-        {0x801f, 208},
-        {0x8029, 208},
-        {0xc038, 208},
-        {0x8002, 128},
-        {0x8009, 128},
-        {0x8017, 128},
-        {0xc028, 128},
-        {0x8002, 130},
-        {0x8009, 130},
-        {0x8017, 130},
-        {0xc028, 130},
-    },
-    /* 100 */
-    {
-        {0x8003, 128},
-        {0x8006, 128},
-        {0x800a, 128},
-        {0x800f, 128},
-        {0x8018, 128},
-        {0x801f, 128},
-        {0x8029, 128},
-        {0xc038, 128},
-        {0x8003, 130},
-        {0x8006, 130},
-        {0x800a, 130},
-        {0x800f, 130},
-        {0x8018, 130},
-        {0x801f, 130},
-        {0x8029, 130},
-        {0xc038, 130},
-    },
-    /* 101 */
-    {
-        {0x8001, 131},
-        {0xc016, 131},
-        {0x8001, 162},
-        {0xc016, 162},
-        {0x8001, 184},
-        {0xc016, 184},
-        {0x8001, 194},
-        {0xc016, 194},
-        {0x8001, 224},
-        {0xc016, 224},
-        {0x8001, 226},
-        {0xc016, 226},
-        {0xc000, 153},
-        {0xc000, 161},
-        {0xc000, 167},
-        {0xc000, 172},
-    },
-    /* 102 */
-    {
-        {0x8002, 131},
-        {0x8009, 131},
-        {0x8017, 131},
-        {0xc028, 131},
-        {0x8002, 162},
-        {0x8009, 162},
-        {0x8017, 162},
-        {0xc028, 162},
-        {0x8002, 184},
-        {0x8009, 184},
-        {0x8017, 184},
-        {0xc028, 184},
-        {0x8002, 194},
-        {0x8009, 194},
-        {0x8017, 194},
-        {0xc028, 194},
-    },
-    /* 103 */
-    {
-        {0x8003, 131},
-        {0x8006, 131},
-        {0x800a, 131},
-        {0x800f, 131},
-        {0x8018, 131},
-        {0x801f, 131},
-        {0x8029, 131},
-        {0xc038, 131},
-        {0x8003, 162},
-        {0x8006, 162},
-        {0x800a, 162},
-        {0x800f, 162},
-        {0x8018, 162},
-        {0x801f, 162},
-        {0x8029, 162},
-        {0xc038, 162},
-    },
-    /* 104 */
-    {
-        {0x8003, 184},
-        {0x8006, 184},
-        {0x800a, 184},
-        {0x800f, 184},
-        {0x8018, 184},
-        {0x801f, 184},
-        {0x8029, 184},
-        {0xc038, 184},
-        {0x8003, 194},
-        {0x8006, 194},
-        {0x800a, 194},
-        {0x800f, 194},
-        {0x8018, 194},
-        {0x801f, 194},
-        {0x8029, 194},
-        {0xc038, 194},
-    },
-    /* 105 */
-    {
-        {0x8002, 224},
-        {0x8009, 224},
-        {0x8017, 224},
-        {0xc028, 224},
-        {0x8002, 226},
-        {0x8009, 226},
-        {0x8017, 226},
-        {0xc028, 226},
-        {0x8001, 153},
-        {0xc016, 153},
-        {0x8001, 161},
-        {0xc016, 161},
-        {0x8001, 167},
-        {0xc016, 167},
-        {0x8001, 172},
-        {0xc016, 172},
-    },
-    /* 106 */
-    {
-        {0x8003, 224},
-        {0x8006, 224},
-        {0x800a, 224},
-        {0x800f, 224},
-        {0x8018, 224},
-        {0x801f, 224},
-        {0x8029, 224},
-        {0xc038, 224},
-        {0x8003, 226},
-        {0x8006, 226},
-        {0x800a, 226},
-        {0x800f, 226},
-        {0x8018, 226},
-        {0x801f, 226},
-        {0x8029, 226},
-        {0xc038, 226},
-    },
-    /* 107 */
-    {
-        {0x8002, 153},
-        {0x8009, 153},
-        {0x8017, 153},
-        {0xc028, 153},
-        {0x8002, 161},
-        {0x8009, 161},
-        {0x8017, 161},
-        {0xc028, 161},
-        {0x8002, 167},
-        {0x8009, 167},
-        {0x8017, 167},
-        {0xc028, 167},
-        {0x8002, 172},
-        {0x8009, 172},
-        {0x8017, 172},
-        {0xc028, 172},
-    },
-    /* 108 */
-    {
-        {0x8003, 153},
-        {0x8006, 153},
-        {0x800a, 153},
-        {0x800f, 153},
-        {0x8018, 153},
-        {0x801f, 153},
-        {0x8029, 153},
-        {0xc038, 153},
-        {0x8003, 161},
-        {0x8006, 161},
-        {0x800a, 161},
-        {0x800f, 161},
-        {0x8018, 161},
-        {0x801f, 161},
-        {0x8029, 161},
-        {0xc038, 161},
-    },
-    /* 109 */
-    {
-        {0x8003, 167},
-        {0x8006, 167},
-        {0x800a, 167},
-        {0x800f, 167},
-        {0x8018, 167},
-        {0x801f, 167},
-        {0x8029, 167},
-        {0xc038, 167},
-        {0x8003, 172},
-        {0x8006, 172},
-        {0x800a, 172},
-        {0x800f, 172},
-        {0x8018, 172},
-        {0x801f, 172},
-        {0x8029, 172},
-        {0xc038, 172},
-    },
-    /* 110 */
-    {
-        {0x72, 0},
-        {0x73, 0},
-        {0x75, 0},
-        {0x76, 0},
-        {0x79, 0},
-        {0x7b, 0},
-        {0x7f, 0},
-        {0x82, 0},
-        {0x88, 0},
-        {0x8b, 0},
-        {0x8f, 0},
-        {0x92, 0},
-        {0x9b, 0},
-        {0xa2, 0},
-        {0xaa, 0},
-        {0xb4, 0},
-    },
-    /* 111 */
-    {
-        {0xc000, 176},
-        {0xc000, 177},
-        {0xc000, 179},
-        {0xc000, 209},
-        {0xc000, 216},
-        {0xc000, 217},
-        {0xc000, 227},
-        {0xc000, 229},
-        {0xc000, 230},
-        {0x7a, 0},
-        {0x7c, 0},
-        {0x7d, 0},
-        {0x80, 0},
-        {0x81, 0},
-        {0x83, 0},
-        {0x84, 0},
-    },
-    /* 112 */
-    {
-        {0x8001, 176},
-        {0xc016, 176},
-        {0x8001, 177},
-        {0xc016, 177},
-        {0x8001, 179},
-        {0xc016, 179},
-        {0x8001, 209},
-        {0xc016, 209},
-        {0x8001, 216},
-        {0xc016, 216},
-        {0x8001, 217},
-        {0xc016, 217},
-        {0x8001, 227},
-        {0xc016, 227},
-        {0x8001, 229},
-        {0xc016, 229},
-    },
-    /* 113 */
-    {
-        {0x8002, 176},
-        {0x8009, 176},
-        {0x8017, 176},
-        {0xc028, 176},
-        {0x8002, 177},
-        {0x8009, 177},
-        {0x8017, 177},
-        {0xc028, 177},
-        {0x8002, 179},
-        {0x8009, 179},
-        {0x8017, 179},
-        {0xc028, 179},
-        {0x8002, 209},
-        {0x8009, 209},
-        {0x8017, 209},
-        {0xc028, 209},
-    },
-    /* 114 */
-    {
-        {0x8003, 176},
-        {0x8006, 176},
-        {0x800a, 176},
-        {0x800f, 176},
-        {0x8018, 176},
-        {0x801f, 176},
-        {0x8029, 176},
-        {0xc038, 176},
-        {0x8003, 177},
-        {0x8006, 177},
-        {0x800a, 177},
-        {0x800f, 177},
-        {0x8018, 177},
-        {0x801f, 177},
-        {0x8029, 177},
-        {0xc038, 177},
-    },
-    /* 115 */
-    {
-        {0x8003, 179},
-        {0x8006, 179},
-        {0x800a, 179},
-        {0x800f, 179},
-        {0x8018, 179},
-        {0x801f, 179},
-        {0x8029, 179},
-        {0xc038, 179},
-        {0x8003, 209},
-        {0x8006, 209},
-        {0x800a, 209},
-        {0x800f, 209},
-        {0x8018, 209},
-        {0x801f, 209},
-        {0x8029, 209},
-        {0xc038, 209},
-    },
-    /* 116 */
-    {
-        {0x8002, 216},
-        {0x8009, 216},
-        {0x8017, 216},
-        {0xc028, 216},
-        {0x8002, 217},
-        {0x8009, 217},
-        {0x8017, 217},
-        {0xc028, 217},
-        {0x8002, 227},
-        {0x8009, 227},
-        {0x8017, 227},
-        {0xc028, 227},
-        {0x8002, 229},
-        {0x8009, 229},
-        {0x8017, 229},
-        {0xc028, 229},
-    },
-    /* 117 */
-    {
-        {0x8003, 216},
-        {0x8006, 216},
-        {0x800a, 216},
-        {0x800f, 216},
-        {0x8018, 216},
-        {0x801f, 216},
-        {0x8029, 216},
-        {0xc038, 216},
-        {0x8003, 217},
-        {0x8006, 217},
-        {0x800a, 217},
-        {0x800f, 217},
-        {0x8018, 217},
-        {0x801f, 217},
-        {0x8029, 217},
-        {0xc038, 217},
-    },
-    /* 118 */
-    {
-        {0x8003, 227},
-        {0x8006, 227},
-        {0x800a, 227},
-        {0x800f, 227},
-        {0x8018, 227},
-        {0x801f, 227},
-        {0x8029, 227},
-        {0xc038, 227},
-        {0x8003, 229},
-        {0x8006, 229},
-        {0x800a, 229},
-        {0x800f, 229},
-        {0x8018, 229},
-        {0x801f, 229},
-        {0x8029, 229},
-        {0xc038, 229},
-    },
-    /* 119 */
-    {
-        {0x8001, 230},
-        {0xc016, 230},
-        {0xc000, 129},
-        {0xc000, 132},
-        {0xc000, 133},
-        {0xc000, 134},
-        {0xc000, 136},
-        {0xc000, 146},
-        {0xc000, 154},
-        {0xc000, 156},
-        {0xc000, 160},
-        {0xc000, 163},
-        {0xc000, 164},
-        {0xc000, 169},
-        {0xc000, 170},
-        {0xc000, 173},
-    },
-    /* 120 */
-    {
-        {0x8002, 230},
-        {0x8009, 230},
-        {0x8017, 230},
-        {0xc028, 230},
-        {0x8001, 129},
-        {0xc016, 129},
-        {0x8001, 132},
-        {0xc016, 132},
-        {0x8001, 133},
-        {0xc016, 133},
-        {0x8001, 134},
-        {0xc016, 134},
-        {0x8001, 136},
-        {0xc016, 136},
-        {0x8001, 146},
-        {0xc016, 146},
-    },
-    /* 121 */
-    {
-        {0x8003, 230},
-        {0x8006, 230},
-        {0x800a, 230},
-        {0x800f, 230},
-        {0x8018, 230},
-        {0x801f, 230},
-        {0x8029, 230},
-        {0xc038, 230},
-        {0x8002, 129},
-        {0x8009, 129},
-        {0x8017, 129},
-        {0xc028, 129},
-        {0x8002, 132},
-        {0x8009, 132},
-        {0x8017, 132},
-        {0xc028, 132},
-    },
-    /* 122 */
-    {
-        {0x8003, 129},
-        {0x8006, 129},
-        {0x800a, 129},
-        {0x800f, 129},
-        {0x8018, 129},
-        {0x801f, 129},
-        {0x8029, 129},
-        {0xc038, 129},
-        {0x8003, 132},
-        {0x8006, 132},
-        {0x800a, 132},
-        {0x800f, 132},
-        {0x8018, 132},
-        {0x801f, 132},
-        {0x8029, 132},
-        {0xc038, 132},
-    },
-    /* 123 */
-    {
-        {0x8002, 133},
-        {0x8009, 133},
-        {0x8017, 133},
-        {0xc028, 133},
-        {0x8002, 134},
-        {0x8009, 134},
-        {0x8017, 134},
-        {0xc028, 134},
-        {0x8002, 136},
-        {0x8009, 136},
-        {0x8017, 136},
-        {0xc028, 136},
-        {0x8002, 146},
-        {0x8009, 146},
-        {0x8017, 146},
-        {0xc028, 146},
-    },
-    /* 124 */
-    {
-        {0x8003, 133},
-        {0x8006, 133},
-        {0x800a, 133},
-        {0x800f, 133},
-        {0x8018, 133},
-        {0x801f, 133},
-        {0x8029, 133},
-        {0xc038, 133},
-        {0x8003, 134},
-        {0x8006, 134},
-        {0x800a, 134},
-        {0x800f, 134},
-        {0x8018, 134},
-        {0x801f, 134},
-        {0x8029, 134},
-        {0xc038, 134},
-    },
-    /* 125 */
-    {
-        {0x8003, 136},
-        {0x8006, 136},
-        {0x800a, 136},
-        {0x800f, 136},
-        {0x8018, 136},
-        {0x801f, 136},
-        {0x8029, 136},
-        {0xc038, 136},
-        {0x8003, 146},
-        {0x8006, 146},
-        {0x800a, 146},
-        {0x800f, 146},
-        {0x8018, 146},
-        {0x801f, 146},
-        {0x8029, 146},
-        {0xc038, 146},
-    },
-    /* 126 */
-    {
-        {0x8001, 154},
-        {0xc016, 154},
-        {0x8001, 156},
-        {0xc016, 156},
-        {0x8001, 160},
-        {0xc016, 160},
-        {0x8001, 163},
-        {0xc016, 163},
-        {0x8001, 164},
-        {0xc016, 164},
-        {0x8001, 169},
-        {0xc016, 169},
-        {0x8001, 170},
-        {0xc016, 170},
-        {0x8001, 173},
-        {0xc016, 173},
-    },
-    /* 127 */
-    {
-        {0x8002, 154},
-        {0x8009, 154},
-        {0x8017, 154},
-        {0xc028, 154},
-        {0x8002, 156},
-        {0x8009, 156},
-        {0x8017, 156},
-        {0xc028, 156},
-        {0x8002, 160},
-        {0x8009, 160},
-        {0x8017, 160},
-        {0xc028, 160},
-        {0x8002, 163},
-        {0x8009, 163},
-        {0x8017, 163},
-        {0xc028, 163},
-    },
-    /* 128 */
-    {
-        {0x8003, 154},
-        {0x8006, 154},
-        {0x800a, 154},
-        {0x800f, 154},
-        {0x8018, 154},
-        {0x801f, 154},
-        {0x8029, 154},
-        {0xc038, 154},
-        {0x8003, 156},
-        {0x8006, 156},
-        {0x800a, 156},
-        {0x800f, 156},
-        {0x8018, 156},
-        {0x801f, 156},
-        {0x8029, 156},
-        {0xc038, 156},
-    },
-    /* 129 */
-    {
-        {0x8003, 160},
-        {0x8006, 160},
-        {0x800a, 160},
-        {0x800f, 160},
-        {0x8018, 160},
-        {0x801f, 160},
-        {0x8029, 160},
-        {0xc038, 160},
-        {0x8003, 163},
-        {0x8006, 163},
-        {0x800a, 163},
-        {0x800f, 163},
-        {0x8018, 163},
-        {0x801f, 163},
-        {0x8029, 163},
-        {0xc038, 163},
-    },
-    /* 130 */
-    {
-        {0x8002, 164},
-        {0x8009, 164},
-        {0x8017, 164},
-        {0xc028, 164},
-        {0x8002, 169},
-        {0x8009, 169},
-        {0x8017, 169},
-        {0xc028, 169},
-        {0x8002, 170},
-        {0x8009, 170},
-        {0x8017, 170},
-        {0xc028, 170},
-        {0x8002, 173},
-        {0x8009, 173},
-        {0x8017, 173},
-        {0xc028, 173},
-    },
-    /* 131 */
-    {
-        {0x8003, 164},
-        {0x8006, 164},
-        {0x800a, 164},
-        {0x800f, 164},
-        {0x8018, 164},
-        {0x801f, 164},
-        {0x8029, 164},
-        {0xc038, 164},
-        {0x8003, 169},
-        {0x8006, 169},
-        {0x800a, 169},
-        {0x800f, 169},
-        {0x8018, 169},
-        {0x801f, 169},
-        {0x8029, 169},
-        {0xc038, 169},
-    },
-    /* 132 */
-    {
-        {0x8003, 170},
-        {0x8006, 170},
-        {0x800a, 170},
-        {0x800f, 170},
-        {0x8018, 170},
-        {0x801f, 170},
-        {0x8029, 170},
-        {0xc038, 170},
-        {0x8003, 173},
-        {0x8006, 173},
-        {0x800a, 173},
-        {0x800f, 173},
-        {0x8018, 173},
-        {0x801f, 173},
-        {0x8029, 173},
-        {0xc038, 173},
-    },
-    /* 133 */
-    {
-        {0x89, 0},
-        {0x8a, 0},
-        {0x8c, 0},
-        {0x8d, 0},
-        {0x90, 0},
-        {0x91, 0},
-        {0x93, 0},
-        {0x96, 0},
-        {0x9c, 0},
-        {0x9f, 0},
-        {0xa3, 0},
-        {0xa6, 0},
-        {0xab, 0},
-        {0xae, 0},
-        {0xb5, 0},
-        {0xbe, 0},
-    },
-    /* 134 */
-    {
-        {0xc000, 178},
-        {0xc000, 181},
-        {0xc000, 185},
-        {0xc000, 186},
-        {0xc000, 187},
-        {0xc000, 189},
-        {0xc000, 190},
-        {0xc000, 196},
-        {0xc000, 198},
-        {0xc000, 228},
-        {0xc000, 232},
-        {0xc000, 233},
-        {0x94, 0},
-        {0x95, 0},
-        {0x97, 0},
-        {0x98, 0},
-    },
-    /* 135 */
-    {
-        {0x8001, 178},
-        {0xc016, 178},
-        {0x8001, 181},
-        {0xc016, 181},
-        {0x8001, 185},
-        {0xc016, 185},
-        {0x8001, 186},
-        {0xc016, 186},
-        {0x8001, 187},
-        {0xc016, 187},
-        {0x8001, 189},
-        {0xc016, 189},
-        {0x8001, 190},
-        {0xc016, 190},
-        {0x8001, 196},
-        {0xc016, 196},
-    },
-    /* 136 */
-    {
-        {0x8002, 178},
-        {0x8009, 178},
-        {0x8017, 178},
-        {0xc028, 178},
-        {0x8002, 181},
-        {0x8009, 181},
-        {0x8017, 181},
-        {0xc028, 181},
-        {0x8002, 185},
-        {0x8009, 185},
-        {0x8017, 185},
-        {0xc028, 185},
-        {0x8002, 186},
-        {0x8009, 186},
-        {0x8017, 186},
-        {0xc028, 186},
-    },
-    /* 137 */
-    {
-        {0x8003, 178},
-        {0x8006, 178},
-        {0x800a, 178},
-        {0x800f, 178},
-        {0x8018, 178},
-        {0x801f, 178},
-        {0x8029, 178},
-        {0xc038, 178},
-        {0x8003, 181},
-        {0x8006, 181},
-        {0x800a, 181},
-        {0x800f, 181},
-        {0x8018, 181},
-        {0x801f, 181},
-        {0x8029, 181},
-        {0xc038, 181},
-    },
-    /* 138 */
-    {
-        {0x8003, 185},
-        {0x8006, 185},
-        {0x800a, 185},
-        {0x800f, 185},
-        {0x8018, 185},
-        {0x801f, 185},
-        {0x8029, 185},
-        {0xc038, 185},
-        {0x8003, 186},
-        {0x8006, 186},
-        {0x800a, 186},
-        {0x800f, 186},
-        {0x8018, 186},
-        {0x801f, 186},
-        {0x8029, 186},
-        {0xc038, 186},
-    },
-    /* 139 */
-    {
-        {0x8002, 187},
-        {0x8009, 187},
-        {0x8017, 187},
-        {0xc028, 187},
-        {0x8002, 189},
-        {0x8009, 189},
-        {0x8017, 189},
-        {0xc028, 189},
-        {0x8002, 190},
-        {0x8009, 190},
-        {0x8017, 190},
-        {0xc028, 190},
-        {0x8002, 196},
-        {0x8009, 196},
-        {0x8017, 196},
-        {0xc028, 196},
-    },
-    /* 140 */
-    {
-        {0x8003, 187},
-        {0x8006, 187},
-        {0x800a, 187},
-        {0x800f, 187},
-        {0x8018, 187},
-        {0x801f, 187},
-        {0x8029, 187},
-        {0xc038, 187},
-        {0x8003, 189},
-        {0x8006, 189},
-        {0x800a, 189},
-        {0x800f, 189},
-        {0x8018, 189},
-        {0x801f, 189},
-        {0x8029, 189},
-        {0xc038, 189},
-    },
-    /* 141 */
-    {
-        {0x8003, 190},
-        {0x8006, 190},
-        {0x800a, 190},
-        {0x800f, 190},
-        {0x8018, 190},
-        {0x801f, 190},
-        {0x8029, 190},
-        {0xc038, 190},
-        {0x8003, 196},
-        {0x8006, 196},
-        {0x800a, 196},
-        {0x800f, 196},
-        {0x8018, 196},
-        {0x801f, 196},
-        {0x8029, 196},
-        {0xc038, 196},
-    },
-    /* 142 */
-    {
-        {0x8001, 198},
-        {0xc016, 198},
-        {0x8001, 228},
-        {0xc016, 228},
-        {0x8001, 232},
-        {0xc016, 232},
-        {0x8001, 233},
-        {0xc016, 233},
-        {0xc000, 1},
-        {0xc000, 135},
-        {0xc000, 137},
-        {0xc000, 138},
-        {0xc000, 139},
-        {0xc000, 140},
-        {0xc000, 141},
-        {0xc000, 143},
-    },
-    /* 143 */
-    {
-        {0x8002, 198},
-        {0x8009, 198},
-        {0x8017, 198},
-        {0xc028, 198},
-        {0x8002, 228},
-        {0x8009, 228},
-        {0x8017, 228},
-        {0xc028, 228},
-        {0x8002, 232},
-        {0x8009, 232},
-        {0x8017, 232},
-        {0xc028, 232},
-        {0x8002, 233},
-        {0x8009, 233},
-        {0x8017, 233},
-        {0xc028, 233},
-    },
-    /* 144 */
-    {
-        {0x8003, 198},
-        {0x8006, 198},
-        {0x800a, 198},
-        {0x800f, 198},
-        {0x8018, 198},
-        {0x801f, 198},
-        {0x8029, 198},
-        {0xc038, 198},
-        {0x8003, 228},
-        {0x8006, 228},
-        {0x800a, 228},
-        {0x800f, 228},
-        {0x8018, 228},
-        {0x801f, 228},
-        {0x8029, 228},
-        {0xc038, 228},
-    },
-    /* 145 */
-    {
-        {0x8003, 232},
-        {0x8006, 232},
-        {0x800a, 232},
-        {0x800f, 232},
-        {0x8018, 232},
-        {0x801f, 232},
-        {0x8029, 232},
-        {0xc038, 232},
-        {0x8003, 233},
-        {0x8006, 233},
-        {0x800a, 233},
-        {0x800f, 233},
-        {0x8018, 233},
-        {0x801f, 233},
-        {0x8029, 233},
-        {0xc038, 233},
-    },
-    /* 146 */
-    {
-        {0x8001, 1},
-        {0xc016, 1},
-        {0x8001, 135},
-        {0xc016, 135},
-        {0x8001, 137},
-        {0xc016, 137},
-        {0x8001, 138},
-        {0xc016, 138},
-        {0x8001, 139},
-        {0xc016, 139},
-        {0x8001, 140},
-        {0xc016, 140},
-        {0x8001, 141},
-        {0xc016, 141},
-        {0x8001, 143},
-        {0xc016, 143},
-    },
-    /* 147 */
-    {
-        {0x8002, 1},
-        {0x8009, 1},
-        {0x8017, 1},
-        {0xc028, 1},
-        {0x8002, 135},
-        {0x8009, 135},
-        {0x8017, 135},
-        {0xc028, 135},
-        {0x8002, 137},
-        {0x8009, 137},
-        {0x8017, 137},
-        {0xc028, 137},
-        {0x8002, 138},
-        {0x8009, 138},
-        {0x8017, 138},
-        {0xc028, 138},
-    },
-    /* 148 */
-    {
-        {0x8003, 1},
-        {0x8006, 1},
-        {0x800a, 1},
-        {0x800f, 1},
-        {0x8018, 1},
-        {0x801f, 1},
-        {0x8029, 1},
-        {0xc038, 1},
-        {0x8003, 135},
-        {0x8006, 135},
-        {0x800a, 135},
-        {0x800f, 135},
-        {0x8018, 135},
-        {0x801f, 135},
-        {0x8029, 135},
-        {0xc038, 135},
-    },
-    /* 149 */
-    {
-        {0x8003, 137},
-        {0x8006, 137},
-        {0x800a, 137},
-        {0x800f, 137},
-        {0x8018, 137},
-        {0x801f, 137},
-        {0x8029, 137},
-        {0xc038, 137},
-        {0x8003, 138},
-        {0x8006, 138},
-        {0x800a, 138},
-        {0x800f, 138},
-        {0x8018, 138},
-        {0x801f, 138},
-        {0x8029, 138},
-        {0xc038, 138},
-    },
-    /* 150 */
-    {
-        {0x8002, 139},
-        {0x8009, 139},
-        {0x8017, 139},
-        {0xc028, 139},
-        {0x8002, 140},
-        {0x8009, 140},
-        {0x8017, 140},
-        {0xc028, 140},
-        {0x8002, 141},
-        {0x8009, 141},
-        {0x8017, 141},
-        {0xc028, 141},
-        {0x8002, 143},
-        {0x8009, 143},
-        {0x8017, 143},
-        {0xc028, 143},
-    },
-    /* 151 */
-    {
-        {0x8003, 139},
-        {0x8006, 139},
-        {0x800a, 139},
-        {0x800f, 139},
-        {0x8018, 139},
-        {0x801f, 139},
-        {0x8029, 139},
-        {0xc038, 139},
-        {0x8003, 140},
-        {0x8006, 140},
-        {0x800a, 140},
-        {0x800f, 140},
-        {0x8018, 140},
-        {0x801f, 140},
-        {0x8029, 140},
-        {0xc038, 140},
-    },
-    /* 152 */
-    {
-        {0x8003, 141},
-        {0x8006, 141},
-        {0x800a, 141},
-        {0x800f, 141},
-        {0x8018, 141},
-        {0x801f, 141},
-        {0x8029, 141},
-        {0xc038, 141},
-        {0x8003, 143},
-        {0x8006, 143},
-        {0x800a, 143},
-        {0x800f, 143},
-        {0x8018, 143},
-        {0x801f, 143},
-        {0x8029, 143},
-        {0xc038, 143},
-    },
-    /* 153 */
-    {
-        {0x9d, 0},
-        {0x9e, 0},
-        {0xa0, 0},
-        {0xa1, 0},
-        {0xa4, 0},
-        {0xa5, 0},
-        {0xa7, 0},
-        {0xa8, 0},
-        {0xac, 0},
-        {0xad, 0},
-        {0xaf, 0},
-        {0xb1, 0},
-        {0xb6, 0},
-        {0xb9, 0},
-        {0xbf, 0},
-        {0xcf, 0},
-    },
-    /* 154 */
-    {
-        {0xc000, 147},
-        {0xc000, 149},
-        {0xc000, 150},
-        {0xc000, 151},
-        {0xc000, 152},
-        {0xc000, 155},
-        {0xc000, 157},
-        {0xc000, 158},
-        {0xc000, 165},
-        {0xc000, 166},
-        {0xc000, 168},
-        {0xc000, 174},
-        {0xc000, 175},
-        {0xc000, 180},
-        {0xc000, 182},
-        {0xc000, 183},
-    },
-    /* 155 */
-    {
-        {0x8001, 147},
-        {0xc016, 147},
-        {0x8001, 149},
-        {0xc016, 149},
-        {0x8001, 150},
-        {0xc016, 150},
-        {0x8001, 151},
-        {0xc016, 151},
-        {0x8001, 152},
-        {0xc016, 152},
-        {0x8001, 155},
-        {0xc016, 155},
-        {0x8001, 157},
-        {0xc016, 157},
-        {0x8001, 158},
-        {0xc016, 158},
-    },
-    /* 156 */
-    {
-        {0x8002, 147},
-        {0x8009, 147},
-        {0x8017, 147},
-        {0xc028, 147},
-        {0x8002, 149},
-        {0x8009, 149},
-        {0x8017, 149},
-        {0xc028, 149},
-        {0x8002, 150},
-        {0x8009, 150},
-        {0x8017, 150},
-        {0xc028, 150},
-        {0x8002, 151},
-        {0x8009, 151},
-        {0x8017, 151},
-        {0xc028, 151},
-    },
-    /* 157 */
-    {
-        {0x8003, 147},
-        {0x8006, 147},
-        {0x800a, 147},
-        {0x800f, 147},
-        {0x8018, 147},
-        {0x801f, 147},
-        {0x8029, 147},
-        {0xc038, 147},
-        {0x8003, 149},
-        {0x8006, 149},
-        {0x800a, 149},
-        {0x800f, 149},
-        {0x8018, 149},
-        {0x801f, 149},
-        {0x8029, 149},
-        {0xc038, 149},
-    },
-    /* 158 */
-    {
-        {0x8003, 150},
-        {0x8006, 150},
-        {0x800a, 150},
-        {0x800f, 150},
-        {0x8018, 150},
-        {0x801f, 150},
-        {0x8029, 150},
-        {0xc038, 150},
-        {0x8003, 151},
-        {0x8006, 151},
-        {0x800a, 151},
-        {0x800f, 151},
-        {0x8018, 151},
-        {0x801f, 151},
-        {0x8029, 151},
-        {0xc038, 151},
-    },
-    /* 159 */
-    {
-        {0x8002, 152},
-        {0x8009, 152},
-        {0x8017, 152},
-        {0xc028, 152},
-        {0x8002, 155},
-        {0x8009, 155},
-        {0x8017, 155},
-        {0xc028, 155},
-        {0x8002, 157},
-        {0x8009, 157},
-        {0x8017, 157},
-        {0xc028, 157},
-        {0x8002, 158},
-        {0x8009, 158},
-        {0x8017, 158},
-        {0xc028, 158},
-    },
-    /* 160 */
-    {
-        {0x8003, 152},
-        {0x8006, 152},
-        {0x800a, 152},
-        {0x800f, 152},
-        {0x8018, 152},
-        {0x801f, 152},
-        {0x8029, 152},
-        {0xc038, 152},
-        {0x8003, 155},
-        {0x8006, 155},
-        {0x800a, 155},
-        {0x800f, 155},
-        {0x8018, 155},
-        {0x801f, 155},
-        {0x8029, 155},
-        {0xc038, 155},
-    },
-    /* 161 */
-    {
-        {0x8003, 157},
-        {0x8006, 157},
-        {0x800a, 157},
-        {0x800f, 157},
-        {0x8018, 157},
-        {0x801f, 157},
-        {0x8029, 157},
-        {0xc038, 157},
-        {0x8003, 158},
-        {0x8006, 158},
-        {0x800a, 158},
-        {0x800f, 158},
-        {0x8018, 158},
-        {0x801f, 158},
-        {0x8029, 158},
-        {0xc038, 158},
-    },
-    /* 162 */
-    {
-        {0x8001, 165},
-        {0xc016, 165},
-        {0x8001, 166},
-        {0xc016, 166},
-        {0x8001, 168},
-        {0xc016, 168},
-        {0x8001, 174},
-        {0xc016, 174},
-        {0x8001, 175},
-        {0xc016, 175},
-        {0x8001, 180},
-        {0xc016, 180},
-        {0x8001, 182},
-        {0xc016, 182},
-        {0x8001, 183},
-        {0xc016, 183},
-    },
-    /* 163 */
-    {
-        {0x8002, 165},
-        {0x8009, 165},
-        {0x8017, 165},
-        {0xc028, 165},
-        {0x8002, 166},
-        {0x8009, 166},
-        {0x8017, 166},
-        {0xc028, 166},
-        {0x8002, 168},
-        {0x8009, 168},
-        {0x8017, 168},
-        {0xc028, 168},
-        {0x8002, 174},
-        {0x8009, 174},
-        {0x8017, 174},
-        {0xc028, 174},
-    },
-    /* 164 */
-    {
-        {0x8003, 165},
-        {0x8006, 165},
-        {0x800a, 165},
-        {0x800f, 165},
-        {0x8018, 165},
-        {0x801f, 165},
-        {0x8029, 165},
-        {0xc038, 165},
-        {0x8003, 166},
-        {0x8006, 166},
-        {0x800a, 166},
-        {0x800f, 166},
-        {0x8018, 166},
-        {0x801f, 166},
-        {0x8029, 166},
-        {0xc038, 166},
-    },
-    /* 165 */
-    {
-        {0x8003, 168},
-        {0x8006, 168},
-        {0x800a, 168},
-        {0x800f, 168},
-        {0x8018, 168},
-        {0x801f, 168},
-        {0x8029, 168},
-        {0xc038, 168},
-        {0x8003, 174},
-        {0x8006, 174},
-        {0x800a, 174},
-        {0x800f, 174},
-        {0x8018, 174},
-        {0x801f, 174},
-        {0x8029, 174},
-        {0xc038, 174},
-    },
-    /* 166 */
-    {
-        {0x8002, 175},
-        {0x8009, 175},
-        {0x8017, 175},
-        {0xc028, 175},
-        {0x8002, 180},
-        {0x8009, 180},
-        {0x8017, 180},
-        {0xc028, 180},
-        {0x8002, 182},
-        {0x8009, 182},
-        {0x8017, 182},
-        {0xc028, 182},
-        {0x8002, 183},
-        {0x8009, 183},
-        {0x8017, 183},
-        {0xc028, 183},
-    },
-    /* 167 */
-    {
-        {0x8003, 175},
-        {0x8006, 175},
-        {0x800a, 175},
-        {0x800f, 175},
-        {0x8018, 175},
-        {0x801f, 175},
-        {0x8029, 175},
-        {0xc038, 175},
-        {0x8003, 180},
-        {0x8006, 180},
-        {0x800a, 180},
-        {0x800f, 180},
-        {0x8018, 180},
-        {0x801f, 180},
-        {0x8029, 180},
-        {0xc038, 180},
-    },
-    /* 168 */
-    {
-        {0x8003, 182},
-        {0x8006, 182},
-        {0x800a, 182},
-        {0x800f, 182},
-        {0x8018, 182},
-        {0x801f, 182},
-        {0x8029, 182},
-        {0xc038, 182},
-        {0x8003, 183},
-        {0x8006, 183},
-        {0x800a, 183},
-        {0x800f, 183},
-        {0x8018, 183},
-        {0x801f, 183},
-        {0x8029, 183},
-        {0xc038, 183},
-    },
-    /* 169 */
-    {
-        {0xc000, 188},
-        {0xc000, 191},
-        {0xc000, 197},
-        {0xc000, 231},
-        {0xc000, 239},
-        {0xb0, 0},
-        {0xb2, 0},
-        {0xb3, 0},
-        {0xb7, 0},
-        {0xb8, 0},
-        {0xba, 0},
-        {0xbb, 0},
-        {0xc0, 0},
-        {0xc7, 0},
-        {0xd0, 0},
-        {0xdf, 0},
-    },
-    /* 170 */
-    {
-        {0x8001, 188},
-        {0xc016, 188},
-        {0x8001, 191},
-        {0xc016, 191},
-        {0x8001, 197},
-        {0xc016, 197},
-        {0x8001, 231},
-        {0xc016, 231},
-        {0x8001, 239},
-        {0xc016, 239},
-        {0xc000, 9},
-        {0xc000, 142},
-        {0xc000, 144},
-        {0xc000, 145},
-        {0xc000, 148},
-        {0xc000, 159},
-    },
-    /* 171 */
-    {
-        {0x8002, 188},
-        {0x8009, 188},
-        {0x8017, 188},
-        {0xc028, 188},
-        {0x8002, 191},
-        {0x8009, 191},
-        {0x8017, 191},
-        {0xc028, 191},
-        {0x8002, 197},
-        {0x8009, 197},
-        {0x8017, 197},
-        {0xc028, 197},
-        {0x8002, 231},
-        {0x8009, 231},
-        {0x8017, 231},
-        {0xc028, 231},
-    },
-    /* 172 */
-    {
-        {0x8003, 188},
-        {0x8006, 188},
-        {0x800a, 188},
-        {0x800f, 188},
-        {0x8018, 188},
-        {0x801f, 188},
-        {0x8029, 188},
-        {0xc038, 188},
-        {0x8003, 191},
-        {0x8006, 191},
-        {0x800a, 191},
-        {0x800f, 191},
-        {0x8018, 191},
-        {0x801f, 191},
-        {0x8029, 191},
-        {0xc038, 191},
-    },
-    /* 173 */
-    {
-        {0x8003, 197},
-        {0x8006, 197},
-        {0x800a, 197},
-        {0x800f, 197},
-        {0x8018, 197},
-        {0x801f, 197},
-        {0x8029, 197},
-        {0xc038, 197},
-        {0x8003, 231},
-        {0x8006, 231},
-        {0x800a, 231},
-        {0x800f, 231},
-        {0x8018, 231},
-        {0x801f, 231},
-        {0x8029, 231},
-        {0xc038, 231},
-    },
-    /* 174 */
-    {
-        {0x8002, 239},
-        {0x8009, 239},
-        {0x8017, 239},
-        {0xc028, 239},
-        {0x8001, 9},
-        {0xc016, 9},
-        {0x8001, 142},
-        {0xc016, 142},
-        {0x8001, 144},
-        {0xc016, 144},
-        {0x8001, 145},
-        {0xc016, 145},
-        {0x8001, 148},
-        {0xc016, 148},
-        {0x8001, 159},
-        {0xc016, 159},
-    },
-    /* 175 */
-    {
-        {0x8003, 239},
-        {0x8006, 239},
-        {0x800a, 239},
-        {0x800f, 239},
-        {0x8018, 239},
-        {0x801f, 239},
-        {0x8029, 239},
-        {0xc038, 239},
-        {0x8002, 9},
-        {0x8009, 9},
-        {0x8017, 9},
-        {0xc028, 9},
-        {0x8002, 142},
-        {0x8009, 142},
-        {0x8017, 142},
-        {0xc028, 142},
-    },
-    /* 176 */
-    {
-        {0x8003, 9},
-        {0x8006, 9},
-        {0x800a, 9},
-        {0x800f, 9},
-        {0x8018, 9},
-        {0x801f, 9},
-        {0x8029, 9},
-        {0xc038, 9},
-        {0x8003, 142},
-        {0x8006, 142},
-        {0x800a, 142},
-        {0x800f, 142},
-        {0x8018, 142},
-        {0x801f, 142},
-        {0x8029, 142},
-        {0xc038, 142},
-    },
-    /* 177 */
-    {
-        {0x8002, 144},
-        {0x8009, 144},
-        {0x8017, 144},
-        {0xc028, 144},
-        {0x8002, 145},
-        {0x8009, 145},
-        {0x8017, 145},
-        {0xc028, 145},
-        {0x8002, 148},
-        {0x8009, 148},
-        {0x8017, 148},
-        {0xc028, 148},
-        {0x8002, 159},
-        {0x8009, 159},
-        {0x8017, 159},
-        {0xc028, 159},
-    },
-    /* 178 */
-    {
-        {0x8003, 144},
-        {0x8006, 144},
-        {0x800a, 144},
-        {0x800f, 144},
-        {0x8018, 144},
-        {0x801f, 144},
-        {0x8029, 144},
-        {0xc038, 144},
-        {0x8003, 145},
-        {0x8006, 145},
-        {0x800a, 145},
-        {0x800f, 145},
-        {0x8018, 145},
-        {0x801f, 145},
-        {0x8029, 145},
-        {0xc038, 145},
-    },
-    /* 179 */
-    {
-        {0x8003, 148},
-        {0x8006, 148},
-        {0x800a, 148},
-        {0x800f, 148},
-        {0x8018, 148},
-        {0x801f, 148},
-        {0x8029, 148},
-        {0xc038, 148},
-        {0x8003, 159},
-        {0x8006, 159},
-        {0x800a, 159},
-        {0x800f, 159},
-        {0x8018, 159},
-        {0x801f, 159},
-        {0x8029, 159},
-        {0xc038, 159},
-    },
-    /* 180 */
-    {
-        {0xc000, 171},
-        {0xc000, 206},
-        {0xc000, 215},
-        {0xc000, 225},
-        {0xc000, 236},
-        {0xc000, 237},
-        {0xbc, 0},
-        {0xbd, 0},
-        {0xc1, 0},
-        {0xc4, 0},
-        {0xc8, 0},
-        {0xcb, 0},
-        {0xd1, 0},
-        {0xd8, 0},
-        {0xe0, 0},
-        {0xee, 0},
-    },
-    /* 181 */
-    {
-        {0x8001, 171},
-        {0xc016, 171},
-        {0x8001, 206},
-        {0xc016, 206},
-        {0x8001, 215},
-        {0xc016, 215},
-        {0x8001, 225},
-        {0xc016, 225},
-        {0x8001, 236},
-        {0xc016, 236},
-        {0x8001, 237},
-        {0xc016, 237},
-        {0xc000, 199},
-        {0xc000, 207},
-        {0xc000, 234},
-        {0xc000, 235},
-    },
-    /* 182 */
-    {
-        {0x8002, 171},
-        {0x8009, 171},
-        {0x8017, 171},
-        {0xc028, 171},
-        {0x8002, 206},
-        {0x8009, 206},
-        {0x8017, 206},
-        {0xc028, 206},
-        {0x8002, 215},
-        {0x8009, 215},
-        {0x8017, 215},
-        {0xc028, 215},
-        {0x8002, 225},
-        {0x8009, 225},
-        {0x8017, 225},
-        {0xc028, 225},
-    },
-    /* 183 */
-    {
-        {0x8003, 171},
-        {0x8006, 171},
-        {0x800a, 171},
-        {0x800f, 171},
-        {0x8018, 171},
-        {0x801f, 171},
-        {0x8029, 171},
-        {0xc038, 171},
-        {0x8003, 206},
-        {0x8006, 206},
-        {0x800a, 206},
-        {0x800f, 206},
-        {0x8018, 206},
-        {0x801f, 206},
-        {0x8029, 206},
-        {0xc038, 206},
-    },
-    /* 184 */
-    {
-        {0x8003, 215},
-        {0x8006, 215},
-        {0x800a, 215},
-        {0x800f, 215},
-        {0x8018, 215},
-        {0x801f, 215},
-        {0x8029, 215},
-        {0xc038, 215},
-        {0x8003, 225},
-        {0x8006, 225},
-        {0x800a, 225},
-        {0x800f, 225},
-        {0x8018, 225},
-        {0x801f, 225},
-        {0x8029, 225},
-        {0xc038, 225},
-    },
-    /* 185 */
-    {
-        {0x8002, 236},
-        {0x8009, 236},
-        {0x8017, 236},
-        {0xc028, 236},
-        {0x8002, 237},
-        {0x8009, 237},
-        {0x8017, 237},
-        {0xc028, 237},
-        {0x8001, 199},
-        {0xc016, 199},
-        {0x8001, 207},
-        {0xc016, 207},
-        {0x8001, 234},
-        {0xc016, 234},
-        {0x8001, 235},
-        {0xc016, 235},
-    },
-    /* 186 */
-    {
-        {0x8003, 236},
-        {0x8006, 236},
-        {0x800a, 236},
-        {0x800f, 236},
-        {0x8018, 236},
-        {0x801f, 236},
-        {0x8029, 236},
-        {0xc038, 236},
-        {0x8003, 237},
-        {0x8006, 237},
-        {0x800a, 237},
-        {0x800f, 237},
-        {0x8018, 237},
-        {0x801f, 237},
-        {0x8029, 237},
-        {0xc038, 237},
-    },
-    /* 187 */
-    {
-        {0x8002, 199},
-        {0x8009, 199},
-        {0x8017, 199},
-        {0xc028, 199},
-        {0x8002, 207},
-        {0x8009, 207},
-        {0x8017, 207},
-        {0xc028, 207},
-        {0x8002, 234},
-        {0x8009, 234},
-        {0x8017, 234},
-        {0xc028, 234},
-        {0x8002, 235},
-        {0x8009, 235},
-        {0x8017, 235},
-        {0xc028, 235},
-    },
-    /* 188 */
-    {
-        {0x8003, 199},
-        {0x8006, 199},
-        {0x800a, 199},
-        {0x800f, 199},
-        {0x8018, 199},
-        {0x801f, 199},
-        {0x8029, 199},
-        {0xc038, 199},
-        {0x8003, 207},
-        {0x8006, 207},
-        {0x800a, 207},
-        {0x800f, 207},
-        {0x8018, 207},
-        {0x801f, 207},
-        {0x8029, 207},
-        {0xc038, 207},
-    },
-    /* 189 */
-    {
-        {0x8003, 234},
-        {0x8006, 234},
-        {0x800a, 234},
-        {0x800f, 234},
-        {0x8018, 234},
-        {0x801f, 234},
-        {0x8029, 234},
-        {0xc038, 234},
-        {0x8003, 235},
-        {0x8006, 235},
-        {0x800a, 235},
-        {0x800f, 235},
-        {0x8018, 235},
-        {0x801f, 235},
-        {0x8029, 235},
-        {0xc038, 235},
-    },
-    /* 190 */
-    {
-        {0xc2, 0},
-        {0xc3, 0},
-        {0xc5, 0},
-        {0xc6, 0},
-        {0xc9, 0},
-        {0xca, 0},
-        {0xcc, 0},
-        {0xcd, 0},
-        {0xd2, 0},
-        {0xd5, 0},
-        {0xd9, 0},
-        {0xdc, 0},
-        {0xe1, 0},
-        {0xe7, 0},
-        {0xef, 0},
-        {0xf6, 0},
-    },
-    /* 191 */
-    {
-        {0xc000, 192},
-        {0xc000, 193},
-        {0xc000, 200},
-        {0xc000, 201},
-        {0xc000, 202},
-        {0xc000, 205},
-        {0xc000, 210},
-        {0xc000, 213},
-        {0xc000, 218},
-        {0xc000, 219},
-        {0xc000, 238},
-        {0xc000, 240},
-        {0xc000, 242},
-        {0xc000, 243},
-        {0xc000, 255},
-        {0xce, 0},
-    },
-    /* 192 */
-    {
-        {0x8001, 192},
-        {0xc016, 192},
-        {0x8001, 193},
-        {0xc016, 193},
-        {0x8001, 200},
-        {0xc016, 200},
-        {0x8001, 201},
-        {0xc016, 201},
-        {0x8001, 202},
-        {0xc016, 202},
-        {0x8001, 205},
-        {0xc016, 205},
-        {0x8001, 210},
-        {0xc016, 210},
-        {0x8001, 213},
-        {0xc016, 213},
-    },
-    /* 193 */
-    {
-        {0x8002, 192},
-        {0x8009, 192},
-        {0x8017, 192},
-        {0xc028, 192},
-        {0x8002, 193},
-        {0x8009, 193},
-        {0x8017, 193},
-        {0xc028, 193},
-        {0x8002, 200},
-        {0x8009, 200},
-        {0x8017, 200},
-        {0xc028, 200},
-        {0x8002, 201},
-        {0x8009, 201},
-        {0x8017, 201},
-        {0xc028, 201},
-    },
-    /* 194 */
-    {
-        {0x8003, 192},
-        {0x8006, 192},
-        {0x800a, 192},
-        {0x800f, 192},
-        {0x8018, 192},
-        {0x801f, 192},
-        {0x8029, 192},
-        {0xc038, 192},
-        {0x8003, 193},
-        {0x8006, 193},
-        {0x800a, 193},
-        {0x800f, 193},
-        {0x8018, 193},
-        {0x801f, 193},
-        {0x8029, 193},
-        {0xc038, 193},
-    },
-    /* 195 */
-    {
-        {0x8003, 200},
-        {0x8006, 200},
-        {0x800a, 200},
-        {0x800f, 200},
-        {0x8018, 200},
-        {0x801f, 200},
-        {0x8029, 200},
-        {0xc038, 200},
-        {0x8003, 201},
-        {0x8006, 201},
-        {0x800a, 201},
-        {0x800f, 201},
-        {0x8018, 201},
-        {0x801f, 201},
-        {0x8029, 201},
-        {0xc038, 201},
-    },
-    /* 196 */
-    {
-        {0x8002, 202},
-        {0x8009, 202},
-        {0x8017, 202},
-        {0xc028, 202},
-        {0x8002, 205},
-        {0x8009, 205},
-        {0x8017, 205},
-        {0xc028, 205},
-        {0x8002, 210},
-        {0x8009, 210},
-        {0x8017, 210},
-        {0xc028, 210},
-        {0x8002, 213},
-        {0x8009, 213},
-        {0x8017, 213},
-        {0xc028, 213},
-    },
-    /* 197 */
-    {
-        {0x8003, 202},
-        {0x8006, 202},
-        {0x800a, 202},
-        {0x800f, 202},
-        {0x8018, 202},
-        {0x801f, 202},
-        {0x8029, 202},
-        {0xc038, 202},
-        {0x8003, 205},
-        {0x8006, 205},
-        {0x800a, 205},
-        {0x800f, 205},
-        {0x8018, 205},
-        {0x801f, 205},
-        {0x8029, 205},
-        {0xc038, 205},
-    },
-    /* 198 */
-    {
-        {0x8003, 210},
-        {0x8006, 210},
-        {0x800a, 210},
-        {0x800f, 210},
-        {0x8018, 210},
-        {0x801f, 210},
-        {0x8029, 210},
-        {0xc038, 210},
-        {0x8003, 213},
-        {0x8006, 213},
-        {0x800a, 213},
-        {0x800f, 213},
-        {0x8018, 213},
-        {0x801f, 213},
-        {0x8029, 213},
-        {0xc038, 213},
-    },
-    /* 199 */
-    {
-        {0x8001, 218},
-        {0xc016, 218},
-        {0x8001, 219},
-        {0xc016, 219},
-        {0x8001, 238},
-        {0xc016, 238},
-        {0x8001, 240},
-        {0xc016, 240},
-        {0x8001, 242},
-        {0xc016, 242},
-        {0x8001, 243},
-        {0xc016, 243},
-        {0x8001, 255},
-        {0xc016, 255},
-        {0xc000, 203},
-        {0xc000, 204},
-    },
-    /* 200 */
-    {
-        {0x8002, 218},
-        {0x8009, 218},
-        {0x8017, 218},
-        {0xc028, 218},
-        {0x8002, 219},
-        {0x8009, 219},
-        {0x8017, 219},
-        {0xc028, 219},
-        {0x8002, 238},
-        {0x8009, 238},
-        {0x8017, 238},
-        {0xc028, 238},
-        {0x8002, 240},
-        {0x8009, 240},
-        {0x8017, 240},
-        {0xc028, 240},
-    },
-    /* 201 */
-    {
-        {0x8003, 218},
-        {0x8006, 218},
-        {0x800a, 218},
-        {0x800f, 218},
-        {0x8018, 218},
-        {0x801f, 218},
-        {0x8029, 218},
-        {0xc038, 218},
-        {0x8003, 219},
-        {0x8006, 219},
-        {0x800a, 219},
-        {0x800f, 219},
-        {0x8018, 219},
-        {0x801f, 219},
-        {0x8029, 219},
-        {0xc038, 219},
-    },
-    /* 202 */
-    {
-        {0x8003, 238},
-        {0x8006, 238},
-        {0x800a, 238},
-        {0x800f, 238},
-        {0x8018, 238},
-        {0x801f, 238},
-        {0x8029, 238},
-        {0xc038, 238},
-        {0x8003, 240},
-        {0x8006, 240},
-        {0x800a, 240},
-        {0x800f, 240},
-        {0x8018, 240},
-        {0x801f, 240},
-        {0x8029, 240},
-        {0xc038, 240},
-    },
-    /* 203 */
-    {
-        {0x8002, 242},
-        {0x8009, 242},
-        {0x8017, 242},
-        {0xc028, 242},
-        {0x8002, 243},
-        {0x8009, 243},
-        {0x8017, 243},
-        {0xc028, 243},
-        {0x8002, 255},
-        {0x8009, 255},
-        {0x8017, 255},
-        {0xc028, 255},
-        {0x8001, 203},
-        {0xc016, 203},
-        {0x8001, 204},
-        {0xc016, 204},
-    },
-    /* 204 */
-    {
-        {0x8003, 242},
-        {0x8006, 242},
-        {0x800a, 242},
-        {0x800f, 242},
-        {0x8018, 242},
-        {0x801f, 242},
-        {0x8029, 242},
-        {0xc038, 242},
-        {0x8003, 243},
-        {0x8006, 243},
-        {0x800a, 243},
-        {0x800f, 243},
-        {0x8018, 243},
-        {0x801f, 243},
-        {0x8029, 243},
-        {0xc038, 243},
-    },
-    /* 205 */
-    {
-        {0x8003, 255},
-        {0x8006, 255},
-        {0x800a, 255},
-        {0x800f, 255},
-        {0x8018, 255},
-        {0x801f, 255},
-        {0x8029, 255},
-        {0xc038, 255},
-        {0x8002, 203},
-        {0x8009, 203},
-        {0x8017, 203},
-        {0xc028, 203},
-        {0x8002, 204},
-        {0x8009, 204},
-        {0x8017, 204},
-        {0xc028, 204},
-    },
-    /* 206 */
-    {
-        {0x8003, 203},
-        {0x8006, 203},
-        {0x800a, 203},
-        {0x800f, 203},
-        {0x8018, 203},
-        {0x801f, 203},
-        {0x8029, 203},
-        {0xc038, 203},
-        {0x8003, 204},
-        {0x8006, 204},
-        {0x800a, 204},
-        {0x800f, 204},
-        {0x8018, 204},
-        {0x801f, 204},
-        {0x8029, 204},
-        {0xc038, 204},
-    },
-    /* 207 */
-    {
-        {0xd3, 0},
-        {0xd4, 0},
-        {0xd6, 0},
-        {0xd7, 0},
-        {0xda, 0},
-        {0xdb, 0},
-        {0xdd, 0},
-        {0xde, 0},
-        {0xe2, 0},
-        {0xe4, 0},
-        {0xe8, 0},
-        {0xeb, 0},
-        {0xf0, 0},
-        {0xf3, 0},
-        {0xf7, 0},
-        {0xfa, 0},
-    },
-    /* 208 */
-    {
-        {0xc000, 211},
-        {0xc000, 212},
-        {0xc000, 214},
-        {0xc000, 221},
-        {0xc000, 222},
-        {0xc000, 223},
-        {0xc000, 241},
-        {0xc000, 244},
-        {0xc000, 245},
-        {0xc000, 246},
-        {0xc000, 247},
-        {0xc000, 248},
-        {0xc000, 250},
-        {0xc000, 251},
-        {0xc000, 252},
-        {0xc000, 253},
-    },
-    /* 209 */
-    {
-        {0x8001, 211},
-        {0xc016, 211},
-        {0x8001, 212},
-        {0xc016, 212},
-        {0x8001, 214},
-        {0xc016, 214},
-        {0x8001, 221},
-        {0xc016, 221},
-        {0x8001, 222},
-        {0xc016, 222},
-        {0x8001, 223},
-        {0xc016, 223},
-        {0x8001, 241},
-        {0xc016, 241},
-        {0x8001, 244},
-        {0xc016, 244},
-    },
-    /* 210 */
-    {
-        {0x8002, 211},
-        {0x8009, 211},
-        {0x8017, 211},
-        {0xc028, 211},
-        {0x8002, 212},
-        {0x8009, 212},
-        {0x8017, 212},
-        {0xc028, 212},
-        {0x8002, 214},
-        {0x8009, 214},
-        {0x8017, 214},
-        {0xc028, 214},
-        {0x8002, 221},
-        {0x8009, 221},
-        {0x8017, 221},
-        {0xc028, 221},
-    },
-    /* 211 */
-    {
-        {0x8003, 211},
-        {0x8006, 211},
-        {0x800a, 211},
-        {0x800f, 211},
-        {0x8018, 211},
-        {0x801f, 211},
-        {0x8029, 211},
-        {0xc038, 211},
-        {0x8003, 212},
-        {0x8006, 212},
-        {0x800a, 212},
-        {0x800f, 212},
-        {0x8018, 212},
-        {0x801f, 212},
-        {0x8029, 212},
-        {0xc038, 212},
-    },
-    /* 212 */
-    {
-        {0x8003, 214},
-        {0x8006, 214},
-        {0x800a, 214},
-        {0x800f, 214},
-        {0x8018, 214},
-        {0x801f, 214},
-        {0x8029, 214},
-        {0xc038, 214},
-        {0x8003, 221},
-        {0x8006, 221},
-        {0x800a, 221},
-        {0x800f, 221},
-        {0x8018, 221},
-        {0x801f, 221},
-        {0x8029, 221},
-        {0xc038, 221},
-    },
-    /* 213 */
-    {
-        {0x8002, 222},
-        {0x8009, 222},
-        {0x8017, 222},
-        {0xc028, 222},
-        {0x8002, 223},
-        {0x8009, 223},
-        {0x8017, 223},
-        {0xc028, 223},
-        {0x8002, 241},
-        {0x8009, 241},
-        {0x8017, 241},
-        {0xc028, 241},
-        {0x8002, 244},
-        {0x8009, 244},
-        {0x8017, 244},
-        {0xc028, 244},
-    },
-    /* 214 */
-    {
-        {0x8003, 222},
-        {0x8006, 222},
-        {0x800a, 222},
-        {0x800f, 222},
-        {0x8018, 222},
-        {0x801f, 222},
-        {0x8029, 222},
-        {0xc038, 222},
-        {0x8003, 223},
-        {0x8006, 223},
-        {0x800a, 223},
-        {0x800f, 223},
-        {0x8018, 223},
-        {0x801f, 223},
-        {0x8029, 223},
-        {0xc038, 223},
-    },
-    /* 215 */
-    {
-        {0x8003, 241},
-        {0x8006, 241},
-        {0x800a, 241},
-        {0x800f, 241},
-        {0x8018, 241},
-        {0x801f, 241},
-        {0x8029, 241},
-        {0xc038, 241},
-        {0x8003, 244},
-        {0x8006, 244},
-        {0x800a, 244},
-        {0x800f, 244},
-        {0x8018, 244},
-        {0x801f, 244},
-        {0x8029, 244},
-        {0xc038, 244},
-    },
-    /* 216 */
-    {
-        {0x8001, 245},
-        {0xc016, 245},
-        {0x8001, 246},
-        {0xc016, 246},
-        {0x8001, 247},
-        {0xc016, 247},
-        {0x8001, 248},
-        {0xc016, 248},
-        {0x8001, 250},
-        {0xc016, 250},
-        {0x8001, 251},
-        {0xc016, 251},
-        {0x8001, 252},
-        {0xc016, 252},
-        {0x8001, 253},
-        {0xc016, 253},
-    },
-    /* 217 */
-    {
-        {0x8002, 245},
-        {0x8009, 245},
-        {0x8017, 245},
-        {0xc028, 245},
-        {0x8002, 246},
-        {0x8009, 246},
-        {0x8017, 246},
-        {0xc028, 246},
-        {0x8002, 247},
-        {0x8009, 247},
-        {0x8017, 247},
-        {0xc028, 247},
-        {0x8002, 248},
-        {0x8009, 248},
-        {0x8017, 248},
-        {0xc028, 248},
-    },
-    /* 218 */
-    {
-        {0x8003, 245},
-        {0x8006, 245},
-        {0x800a, 245},
-        {0x800f, 245},
-        {0x8018, 245},
-        {0x801f, 245},
-        {0x8029, 245},
-        {0xc038, 245},
-        {0x8003, 246},
-        {0x8006, 246},
-        {0x800a, 246},
-        {0x800f, 246},
-        {0x8018, 246},
-        {0x801f, 246},
-        {0x8029, 246},
-        {0xc038, 246},
-    },
-    /* 219 */
-    {
-        {0x8003, 247},
-        {0x8006, 247},
-        {0x800a, 247},
-        {0x800f, 247},
-        {0x8018, 247},
-        {0x801f, 247},
-        {0x8029, 247},
-        {0xc038, 247},
-        {0x8003, 248},
-        {0x8006, 248},
-        {0x800a, 248},
-        {0x800f, 248},
-        {0x8018, 248},
-        {0x801f, 248},
-        {0x8029, 248},
-        {0xc038, 248},
-    },
-    /* 220 */
-    {
-        {0x8002, 250},
-        {0x8009, 250},
-        {0x8017, 250},
-        {0xc028, 250},
-        {0x8002, 251},
-        {0x8009, 251},
-        {0x8017, 251},
-        {0xc028, 251},
-        {0x8002, 252},
-        {0x8009, 252},
-        {0x8017, 252},
-        {0xc028, 252},
-        {0x8002, 253},
-        {0x8009, 253},
-        {0x8017, 253},
-        {0xc028, 253},
-    },
-    /* 221 */
-    {
-        {0x8003, 250},
-        {0x8006, 250},
-        {0x800a, 250},
-        {0x800f, 250},
-        {0x8018, 250},
-        {0x801f, 250},
-        {0x8029, 250},
-        {0xc038, 250},
-        {0x8003, 251},
-        {0x8006, 251},
-        {0x800a, 251},
-        {0x800f, 251},
-        {0x8018, 251},
-        {0x801f, 251},
-        {0x8029, 251},
-        {0xc038, 251},
-    },
-    /* 222 */
-    {
-        {0x8003, 252},
-        {0x8006, 252},
-        {0x800a, 252},
-        {0x800f, 252},
-        {0x8018, 252},
-        {0x801f, 252},
-        {0x8029, 252},
-        {0xc038, 252},
-        {0x8003, 253},
-        {0x8006, 253},
-        {0x800a, 253},
-        {0x800f, 253},
-        {0x8018, 253},
-        {0x801f, 253},
-        {0x8029, 253},
-        {0xc038, 253},
-    },
-    /* 223 */
-    {
-        {0xc000, 254},
-        {0xe3, 0},
-        {0xe5, 0},
-        {0xe6, 0},
-        {0xe9, 0},
-        {0xea, 0},
-        {0xec, 0},
-        {0xed, 0},
-        {0xf1, 0},
-        {0xf2, 0},
-        {0xf4, 0},
-        {0xf5, 0},
-        {0xf8, 0},
-        {0xf9, 0},
-        {0xfb, 0},
-        {0xfc, 0},
-    },
-    /* 224 */
-    {
-        {0x8001, 254},
-        {0xc016, 254},
-        {0xc000, 2},
-        {0xc000, 3},
-        {0xc000, 4},
-        {0xc000, 5},
-        {0xc000, 6},
-        {0xc000, 7},
-        {0xc000, 8},
-        {0xc000, 11},
-        {0xc000, 12},
-        {0xc000, 14},
-        {0xc000, 15},
-        {0xc000, 16},
-        {0xc000, 17},
-        {0xc000, 18},
-    },
-    /* 225 */
-    {
-        {0x8002, 254},
-        {0x8009, 254},
-        {0x8017, 254},
-        {0xc028, 254},
-        {0x8001, 2},
-        {0xc016, 2},
-        {0x8001, 3},
-        {0xc016, 3},
-        {0x8001, 4},
-        {0xc016, 4},
-        {0x8001, 5},
-        {0xc016, 5},
-        {0x8001, 6},
-        {0xc016, 6},
-        {0x8001, 7},
-        {0xc016, 7},
-    },
-    /* 226 */
-    {
-        {0x8003, 254},
-        {0x8006, 254},
-        {0x800a, 254},
-        {0x800f, 254},
-        {0x8018, 254},
-        {0x801f, 254},
-        {0x8029, 254},
-        {0xc038, 254},
-        {0x8002, 2},
-        {0x8009, 2},
-        {0x8017, 2},
-        {0xc028, 2},
-        {0x8002, 3},
-        {0x8009, 3},
-        {0x8017, 3},
-        {0xc028, 3},
-    },
-    /* 227 */
-    {
-        {0x8003, 2},
-        {0x8006, 2},
-        {0x800a, 2},
-        {0x800f, 2},
-        {0x8018, 2},
-        {0x801f, 2},
-        {0x8029, 2},
-        {0xc038, 2},
-        {0x8003, 3},
-        {0x8006, 3},
-        {0x800a, 3},
-        {0x800f, 3},
-        {0x8018, 3},
-        {0x801f, 3},
-        {0x8029, 3},
-        {0xc038, 3},
-    },
-    /* 228 */
-    {
-        {0x8002, 4},
-        {0x8009, 4},
-        {0x8017, 4},
-        {0xc028, 4},
-        {0x8002, 5},
-        {0x8009, 5},
-        {0x8017, 5},
-        {0xc028, 5},
-        {0x8002, 6},
-        {0x8009, 6},
-        {0x8017, 6},
-        {0xc028, 6},
-        {0x8002, 7},
-        {0x8009, 7},
-        {0x8017, 7},
-        {0xc028, 7},
-    },
-    /* 229 */
-    {
-        {0x8003, 4},
-        {0x8006, 4},
-        {0x800a, 4},
-        {0x800f, 4},
-        {0x8018, 4},
-        {0x801f, 4},
-        {0x8029, 4},
-        {0xc038, 4},
-        {0x8003, 5},
-        {0x8006, 5},
-        {0x800a, 5},
-        {0x800f, 5},
-        {0x8018, 5},
-        {0x801f, 5},
-        {0x8029, 5},
-        {0xc038, 5},
-    },
-    /* 230 */
-    {
-        {0x8003, 6},
-        {0x8006, 6},
-        {0x800a, 6},
-        {0x800f, 6},
-        {0x8018, 6},
-        {0x801f, 6},
-        {0x8029, 6},
-        {0xc038, 6},
-        {0x8003, 7},
-        {0x8006, 7},
-        {0x800a, 7},
-        {0x800f, 7},
-        {0x8018, 7},
-        {0x801f, 7},
-        {0x8029, 7},
-        {0xc038, 7},
-    },
-    /* 231 */
-    {
-        {0x8001, 8},
-        {0xc016, 8},
-        {0x8001, 11},
-        {0xc016, 11},
-        {0x8001, 12},
-        {0xc016, 12},
-        {0x8001, 14},
-        {0xc016, 14},
-        {0x8001, 15},
-        {0xc016, 15},
-        {0x8001, 16},
-        {0xc016, 16},
-        {0x8001, 17},
-        {0xc016, 17},
-        {0x8001, 18},
-        {0xc016, 18},
-    },
-    /* 232 */
-    {
-        {0x8002, 8},
-        {0x8009, 8},
-        {0x8017, 8},
-        {0xc028, 8},
-        {0x8002, 11},
-        {0x8009, 11},
-        {0x8017, 11},
-        {0xc028, 11},
-        {0x8002, 12},
-        {0x8009, 12},
-        {0x8017, 12},
-        {0xc028, 12},
-        {0x8002, 14},
-        {0x8009, 14},
-        {0x8017, 14},
-        {0xc028, 14},
-    },
-    /* 233 */
-    {
-        {0x8003, 8},
-        {0x8006, 8},
-        {0x800a, 8},
-        {0x800f, 8},
-        {0x8018, 8},
-        {0x801f, 8},
-        {0x8029, 8},
-        {0xc038, 8},
-        {0x8003, 11},
-        {0x8006, 11},
-        {0x800a, 11},
-        {0x800f, 11},
-        {0x8018, 11},
-        {0x801f, 11},
-        {0x8029, 11},
-        {0xc038, 11},
-    },
-    /* 234 */
-    {
-        {0x8003, 12},
-        {0x8006, 12},
-        {0x800a, 12},
-        {0x800f, 12},
-        {0x8018, 12},
-        {0x801f, 12},
-        {0x8029, 12},
-        {0xc038, 12},
-        {0x8003, 14},
-        {0x8006, 14},
-        {0x800a, 14},
-        {0x800f, 14},
-        {0x8018, 14},
-        {0x801f, 14},
-        {0x8029, 14},
-        {0xc038, 14},
-    },
-    /* 235 */
-    {
-        {0x8002, 15},
-        {0x8009, 15},
-        {0x8017, 15},
-        {0xc028, 15},
-        {0x8002, 16},
-        {0x8009, 16},
-        {0x8017, 16},
-        {0xc028, 16},
-        {0x8002, 17},
-        {0x8009, 17},
-        {0x8017, 17},
-        {0xc028, 17},
-        {0x8002, 18},
-        {0x8009, 18},
-        {0x8017, 18},
-        {0xc028, 18},
-    },
-    /* 236 */
-    {
-        {0x8003, 15},
-        {0x8006, 15},
-        {0x800a, 15},
-        {0x800f, 15},
-        {0x8018, 15},
-        {0x801f, 15},
-        {0x8029, 15},
-        {0xc038, 15},
-        {0x8003, 16},
-        {0x8006, 16},
-        {0x800a, 16},
-        {0x800f, 16},
-        {0x8018, 16},
-        {0x801f, 16},
-        {0x8029, 16},
-        {0xc038, 16},
-    },
-    /* 237 */
-    {
-        {0x8003, 17},
-        {0x8006, 17},
-        {0x800a, 17},
-        {0x800f, 17},
-        {0x8018, 17},
-        {0x801f, 17},
-        {0x8029, 17},
-        {0xc038, 17},
-        {0x8003, 18},
-        {0x8006, 18},
-        {0x800a, 18},
-        {0x800f, 18},
-        {0x8018, 18},
-        {0x801f, 18},
-        {0x8029, 18},
-        {0xc038, 18},
-    },
-    /* 238 */
-    {
-        {0xc000, 19},
-        {0xc000, 20},
-        {0xc000, 21},
-        {0xc000, 23},
-        {0xc000, 24},
-        {0xc000, 25},
-        {0xc000, 26},
-        {0xc000, 27},
-        {0xc000, 28},
-        {0xc000, 29},
-        {0xc000, 30},
-        {0xc000, 31},
-        {0xc000, 127},
-        {0xc000, 220},
-        {0xc000, 249},
-        {0xfd, 0},
-    },
-    /* 239 */
-    {
-        {0x8001, 19},
-        {0xc016, 19},
-        {0x8001, 20},
-        {0xc016, 20},
-        {0x8001, 21},
-        {0xc016, 21},
-        {0x8001, 23},
-        {0xc016, 23},
-        {0x8001, 24},
-        {0xc016, 24},
-        {0x8001, 25},
-        {0xc016, 25},
-        {0x8001, 26},
-        {0xc016, 26},
-        {0x8001, 27},
-        {0xc016, 27},
-    },
-    /* 240 */
-    {
-        {0x8002, 19},
-        {0x8009, 19},
-        {0x8017, 19},
-        {0xc028, 19},
-        {0x8002, 20},
-        {0x8009, 20},
-        {0x8017, 20},
-        {0xc028, 20},
-        {0x8002, 21},
-        {0x8009, 21},
-        {0x8017, 21},
-        {0xc028, 21},
-        {0x8002, 23},
-        {0x8009, 23},
-        {0x8017, 23},
-        {0xc028, 23},
-    },
-    /* 241 */
-    {
-        {0x8003, 19},
-        {0x8006, 19},
-        {0x800a, 19},
-        {0x800f, 19},
-        {0x8018, 19},
-        {0x801f, 19},
-        {0x8029, 19},
-        {0xc038, 19},
-        {0x8003, 20},
-        {0x8006, 20},
-        {0x800a, 20},
-        {0x800f, 20},
-        {0x8018, 20},
-        {0x801f, 20},
-        {0x8029, 20},
-        {0xc038, 20},
-    },
-    /* 242 */
-    {
-        {0x8003, 21},
-        {0x8006, 21},
-        {0x800a, 21},
-        {0x800f, 21},
-        {0x8018, 21},
-        {0x801f, 21},
-        {0x8029, 21},
-        {0xc038, 21},
-        {0x8003, 23},
-        {0x8006, 23},
-        {0x800a, 23},
-        {0x800f, 23},
-        {0x8018, 23},
-        {0x801f, 23},
-        {0x8029, 23},
-        {0xc038, 23},
-    },
-    /* 243 */
-    {
-        {0x8002, 24},
-        {0x8009, 24},
-        {0x8017, 24},
-        {0xc028, 24},
-        {0x8002, 25},
-        {0x8009, 25},
-        {0x8017, 25},
-        {0xc028, 25},
-        {0x8002, 26},
-        {0x8009, 26},
-        {0x8017, 26},
-        {0xc028, 26},
-        {0x8002, 27},
-        {0x8009, 27},
-        {0x8017, 27},
-        {0xc028, 27},
-    },
-    /* 244 */
-    {
-        {0x8003, 24},
-        {0x8006, 24},
-        {0x800a, 24},
-        {0x800f, 24},
-        {0x8018, 24},
-        {0x801f, 24},
-        {0x8029, 24},
-        {0xc038, 24},
-        {0x8003, 25},
-        {0x8006, 25},
-        {0x800a, 25},
-        {0x800f, 25},
-        {0x8018, 25},
-        {0x801f, 25},
-        {0x8029, 25},
-        {0xc038, 25},
-    },
-    /* 245 */
-    {
-        {0x8003, 26},
-        {0x8006, 26},
-        {0x800a, 26},
-        {0x800f, 26},
-        {0x8018, 26},
-        {0x801f, 26},
-        {0x8029, 26},
-        {0xc038, 26},
-        {0x8003, 27},
-        {0x8006, 27},
-        {0x800a, 27},
-        {0x800f, 27},
-        {0x8018, 27},
-        {0x801f, 27},
-        {0x8029, 27},
-        {0xc038, 27},
-    },
-    /* 246 */
-    {
-        {0x8001, 28},
-        {0xc016, 28},
-        {0x8001, 29},
-        {0xc016, 29},
-        {0x8001, 30},
-        {0xc016, 30},
-        {0x8001, 31},
-        {0xc016, 31},
-        {0x8001, 127},
-        {0xc016, 127},
-        {0x8001, 220},
-        {0xc016, 220},
-        {0x8001, 249},
-        {0xc016, 249},
-        {0xfe, 0},
-        {0xff, 0},
-    },
-    /* 247 */
-    {
-        {0x8002, 28},
-        {0x8009, 28},
-        {0x8017, 28},
-        {0xc028, 28},
-        {0x8002, 29},
-        {0x8009, 29},
-        {0x8017, 29},
-        {0xc028, 29},
-        {0x8002, 30},
-        {0x8009, 30},
-        {0x8017, 30},
-        {0xc028, 30},
-        {0x8002, 31},
-        {0x8009, 31},
-        {0x8017, 31},
-        {0xc028, 31},
-    },
-    /* 248 */
-    {
-        {0x8003, 28},
-        {0x8006, 28},
-        {0x800a, 28},
-        {0x800f, 28},
-        {0x8018, 28},
-        {0x801f, 28},
-        {0x8029, 28},
-        {0xc038, 28},
-        {0x8003, 29},
-        {0x8006, 29},
-        {0x800a, 29},
-        {0x800f, 29},
-        {0x8018, 29},
-        {0x801f, 29},
-        {0x8029, 29},
-        {0xc038, 29},
-    },
-    /* 249 */
-    {
-        {0x8003, 30},
-        {0x8006, 30},
-        {0x800a, 30},
-        {0x800f, 30},
-        {0x8018, 30},
-        {0x801f, 30},
-        {0x8029, 30},
-        {0xc038, 30},
-        {0x8003, 31},
-        {0x8006, 31},
-        {0x800a, 31},
-        {0x800f, 31},
-        {0x8018, 31},
-        {0x801f, 31},
-        {0x8029, 31},
-        {0xc038, 31},
-    },
-    /* 250 */
-    {
-        {0x8002, 127},
-        {0x8009, 127},
-        {0x8017, 127},
-        {0xc028, 127},
-        {0x8002, 220},
-        {0x8009, 220},
-        {0x8017, 220},
-        {0xc028, 220},
-        {0x8002, 249},
-        {0x8009, 249},
-        {0x8017, 249},
-        {0xc028, 249},
-        {0xc000, 10},
-        {0xc000, 13},
-        {0xc000, 22},
-        {0x100, 0},
-    },
-    /* 251 */
-    {
-        {0x8003, 127},
-        {0x8006, 127},
-        {0x800a, 127},
-        {0x800f, 127},
-        {0x8018, 127},
-        {0x801f, 127},
-        {0x8029, 127},
-        {0xc038, 127},
-        {0x8003, 220},
-        {0x8006, 220},
-        {0x800a, 220},
-        {0x800f, 220},
-        {0x8018, 220},
-        {0x801f, 220},
-        {0x8029, 220},
-        {0xc038, 220},
-    },
-    /* 252 */
-    {
-        {0x8003, 249},
-        {0x8006, 249},
-        {0x800a, 249},
-        {0x800f, 249},
-        {0x8018, 249},
-        {0x801f, 249},
-        {0x8029, 249},
-        {0xc038, 249},
-        {0x8001, 10},
-        {0xc016, 10},
-        {0x8001, 13},
-        {0xc016, 13},
-        {0x8001, 22},
-        {0xc016, 22},
-        {0x100, 0},
-        {0x100, 0},
-    },
-    /* 253 */
-    {
-        {0x8002, 10},
-        {0x8009, 10},
-        {0x8017, 10},
-        {0xc028, 10},
-        {0x8002, 13},
-        {0x8009, 13},
-        {0x8017, 13},
-        {0xc028, 13},
-        {0x8002, 22},
-        {0x8009, 22},
-        {0x8017, 22},
-        {0xc028, 22},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-    },
-    /* 254 */
-    {
-        {0x8003, 10},
-        {0x8006, 10},
-        {0x800a, 10},
-        {0x800f, 10},
-        {0x8018, 10},
-        {0x801f, 10},
-        {0x8029, 10},
-        {0xc038, 10},
-        {0x8003, 13},
-        {0x8006, 13},
-        {0x800a, 13},
-        {0x800f, 13},
-        {0x8018, 13},
-        {0x801f, 13},
-        {0x8029, 13},
-        {0xc038, 13},
-    },
-    /* 255 */
-    {
-        {0x8003, 22},
-        {0x8006, 22},
-        {0x800a, 22},
-        {0x800f, 22},
-        {0x8018, 22},
-        {0x801f, 22},
-        {0x8029, 22},
-        {0xc038, 22},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-    },
-    /* 256 */
-    {
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-        {0x100, 0},
-    },
+  /* 0 */
+  {
+    {0x04, 0},
+    {0x05, 0},
+    {0x07, 0},
+    {0x08, 0},
+    {0x0b, 0},
+    {0x0c, 0},
+    {0x10, 0},
+    {0x13, 0},
+    {0x19, 0},
+    {0x1c, 0},
+    {0x20, 0},
+    {0x23, 0},
+    {0x2a, 0},
+    {0x31, 0},
+    {0x39, 0},
+    {0x4040, 0},
+  },
+  /* 1 */
+  {
+    {0xc000, 48},
+    {0xc000, 49},
+    {0xc000, 50},
+    {0xc000, 97},
+    {0xc000, 99},
+    {0xc000, 101},
+    {0xc000, 105},
+    {0xc000, 111},
+    {0xc000, 115},
+    {0xc000, 116},
+    {0x0d, 0},
+    {0x0e, 0},
+    {0x11, 0},
+    {0x12, 0},
+    {0x14, 0},
+    {0x15, 0},
+  },
+  /* 2 */
+  {
+    {0x8001, 48},
+    {0xc016, 48},
+    {0x8001, 49},
+    {0xc016, 49},
+    {0x8001, 50},
+    {0xc016, 50},
+    {0x8001, 97},
+    {0xc016, 97},
+    {0x8001, 99},
+    {0xc016, 99},
+    {0x8001, 101},
+    {0xc016, 101},
+    {0x8001, 105},
+    {0xc016, 105},
+    {0x8001, 111},
+    {0xc016, 111},
+  },
+  /* 3 */
+  {
+    {0x8002, 48},
+    {0x8009, 48},
+    {0x8017, 48},
+    {0xc028, 48},
+    {0x8002, 49},
+    {0x8009, 49},
+    {0x8017, 49},
+    {0xc028, 49},
+    {0x8002, 50},
+    {0x8009, 50},
+    {0x8017, 50},
+    {0xc028, 50},
+    {0x8002, 97},
+    {0x8009, 97},
+    {0x8017, 97},
+    {0xc028, 97},
+  },
+  /* 4 */
+  {
+    {0x8003, 48},
+    {0x8006, 48},
+    {0x800a, 48},
+    {0x800f, 48},
+    {0x8018, 48},
+    {0x801f, 48},
+    {0x8029, 48},
+    {0xc038, 48},
+    {0x8003, 49},
+    {0x8006, 49},
+    {0x800a, 49},
+    {0x800f, 49},
+    {0x8018, 49},
+    {0x801f, 49},
+    {0x8029, 49},
+    {0xc038, 49},
+  },
+  /* 5 */
+  {
+    {0x8003, 50},
+    {0x8006, 50},
+    {0x800a, 50},
+    {0x800f, 50},
+    {0x8018, 50},
+    {0x801f, 50},
+    {0x8029, 50},
+    {0xc038, 50},
+    {0x8003, 97},
+    {0x8006, 97},
+    {0x800a, 97},
+    {0x800f, 97},
+    {0x8018, 97},
+    {0x801f, 97},
+    {0x8029, 97},
+    {0xc038, 97},
+  },
+  /* 6 */
+  {
+    {0x8002, 99},
+    {0x8009, 99},
+    {0x8017, 99},
+    {0xc028, 99},
+    {0x8002, 101},
+    {0x8009, 101},
+    {0x8017, 101},
+    {0xc028, 101},
+    {0x8002, 105},
+    {0x8009, 105},
+    {0x8017, 105},
+    {0xc028, 105},
+    {0x8002, 111},
+    {0x8009, 111},
+    {0x8017, 111},
+    {0xc028, 111},
+  },
+  /* 7 */
+  {
+    {0x8003, 99},
+    {0x8006, 99},
+    {0x800a, 99},
+    {0x800f, 99},
+    {0x8018, 99},
+    {0x801f, 99},
+    {0x8029, 99},
+    {0xc038, 99},
+    {0x8003, 101},
+    {0x8006, 101},
+    {0x800a, 101},
+    {0x800f, 101},
+    {0x8018, 101},
+    {0x801f, 101},
+    {0x8029, 101},
+    {0xc038, 101},
+  },
+  /* 8 */
+  {
+    {0x8003, 105},
+    {0x8006, 105},
+    {0x800a, 105},
+    {0x800f, 105},
+    {0x8018, 105},
+    {0x801f, 105},
+    {0x8029, 105},
+    {0xc038, 105},
+    {0x8003, 111},
+    {0x8006, 111},
+    {0x800a, 111},
+    {0x800f, 111},
+    {0x8018, 111},
+    {0x801f, 111},
+    {0x8029, 111},
+    {0xc038, 111},
+  },
+  /* 9 */
+  {
+    {0x8001, 115},
+    {0xc016, 115},
+    {0x8001, 116},
+    {0xc016, 116},
+    {0xc000, 32},
+    {0xc000, 37},
+    {0xc000, 45},
+    {0xc000, 46},
+    {0xc000, 47},
+    {0xc000, 51},
+    {0xc000, 52},
+    {0xc000, 53},
+    {0xc000, 54},
+    {0xc000, 55},
+    {0xc000, 56},
+    {0xc000, 57},
+  },
+  /* 10 */
+  {
+    {0x8002, 115},
+    {0x8009, 115},
+    {0x8017, 115},
+    {0xc028, 115},
+    {0x8002, 116},
+    {0x8009, 116},
+    {0x8017, 116},
+    {0xc028, 116},
+    {0x8001, 32},
+    {0xc016, 32},
+    {0x8001, 37},
+    {0xc016, 37},
+    {0x8001, 45},
+    {0xc016, 45},
+    {0x8001, 46},
+    {0xc016, 46},
+  },
+  /* 11 */
+  {
+    {0x8003, 115},
+    {0x8006, 115},
+    {0x800a, 115},
+    {0x800f, 115},
+    {0x8018, 115},
+    {0x801f, 115},
+    {0x8029, 115},
+    {0xc038, 115},
+    {0x8003, 116},
+    {0x8006, 116},
+    {0x800a, 116},
+    {0x800f, 116},
+    {0x8018, 116},
+    {0x801f, 116},
+    {0x8029, 116},
+    {0xc038, 116},
+  },
+  /* 12 */
+  {
+    {0x8002, 32},
+    {0x8009, 32},
+    {0x8017, 32},
+    {0xc028, 32},
+    {0x8002, 37},
+    {0x8009, 37},
+    {0x8017, 37},
+    {0xc028, 37},
+    {0x8002, 45},
+    {0x8009, 45},
+    {0x8017, 45},
+    {0xc028, 45},
+    {0x8002, 46},
+    {0x8009, 46},
+    {0x8017, 46},
+    {0xc028, 46},
+  },
+  /* 13 */
+  {
+    {0x8003, 32},
+    {0x8006, 32},
+    {0x800a, 32},
+    {0x800f, 32},
+    {0x8018, 32},
+    {0x801f, 32},
+    {0x8029, 32},
+    {0xc038, 32},
+    {0x8003, 37},
+    {0x8006, 37},
+    {0x800a, 37},
+    {0x800f, 37},
+    {0x8018, 37},
+    {0x801f, 37},
+    {0x8029, 37},
+    {0xc038, 37},
+  },
+  /* 14 */
+  {
+    {0x8003, 45},
+    {0x8006, 45},
+    {0x800a, 45},
+    {0x800f, 45},
+    {0x8018, 45},
+    {0x801f, 45},
+    {0x8029, 45},
+    {0xc038, 45},
+    {0x8003, 46},
+    {0x8006, 46},
+    {0x800a, 46},
+    {0x800f, 46},
+    {0x8018, 46},
+    {0x801f, 46},
+    {0x8029, 46},
+    {0xc038, 46},
+  },
+  /* 15 */
+  {
+    {0x8001, 47},
+    {0xc016, 47},
+    {0x8001, 51},
+    {0xc016, 51},
+    {0x8001, 52},
+    {0xc016, 52},
+    {0x8001, 53},
+    {0xc016, 53},
+    {0x8001, 54},
+    {0xc016, 54},
+    {0x8001, 55},
+    {0xc016, 55},
+    {0x8001, 56},
+    {0xc016, 56},
+    {0x8001, 57},
+    {0xc016, 57},
+  },
+  /* 16 */
+  {
+    {0x8002, 47},
+    {0x8009, 47},
+    {0x8017, 47},
+    {0xc028, 47},
+    {0x8002, 51},
+    {0x8009, 51},
+    {0x8017, 51},
+    {0xc028, 51},
+    {0x8002, 52},
+    {0x8009, 52},
+    {0x8017, 52},
+    {0xc028, 52},
+    {0x8002, 53},
+    {0x8009, 53},
+    {0x8017, 53},
+    {0xc028, 53},
+  },
+  /* 17 */
+  {
+    {0x8003, 47},
+    {0x8006, 47},
+    {0x800a, 47},
+    {0x800f, 47},
+    {0x8018, 47},
+    {0x801f, 47},
+    {0x8029, 47},
+    {0xc038, 47},
+    {0x8003, 51},
+    {0x8006, 51},
+    {0x800a, 51},
+    {0x800f, 51},
+    {0x8018, 51},
+    {0x801f, 51},
+    {0x8029, 51},
+    {0xc038, 51},
+  },
+  /* 18 */
+  {
+    {0x8003, 52},
+    {0x8006, 52},
+    {0x800a, 52},
+    {0x800f, 52},
+    {0x8018, 52},
+    {0x801f, 52},
+    {0x8029, 52},
+    {0xc038, 52},
+    {0x8003, 53},
+    {0x8006, 53},
+    {0x800a, 53},
+    {0x800f, 53},
+    {0x8018, 53},
+    {0x801f, 53},
+    {0x8029, 53},
+    {0xc038, 53},
+  },
+  /* 19 */
+  {
+    {0x8002, 54},
+    {0x8009, 54},
+    {0x8017, 54},
+    {0xc028, 54},
+    {0x8002, 55},
+    {0x8009, 55},
+    {0x8017, 55},
+    {0xc028, 55},
+    {0x8002, 56},
+    {0x8009, 56},
+    {0x8017, 56},
+    {0xc028, 56},
+    {0x8002, 57},
+    {0x8009, 57},
+    {0x8017, 57},
+    {0xc028, 57},
+  },
+  /* 20 */
+  {
+    {0x8003, 54},
+    {0x8006, 54},
+    {0x800a, 54},
+    {0x800f, 54},
+    {0x8018, 54},
+    {0x801f, 54},
+    {0x8029, 54},
+    {0xc038, 54},
+    {0x8003, 55},
+    {0x8006, 55},
+    {0x800a, 55},
+    {0x800f, 55},
+    {0x8018, 55},
+    {0x801f, 55},
+    {0x8029, 55},
+    {0xc038, 55},
+  },
+  /* 21 */
+  {
+    {0x8003, 56},
+    {0x8006, 56},
+    {0x800a, 56},
+    {0x800f, 56},
+    {0x8018, 56},
+    {0x801f, 56},
+    {0x8029, 56},
+    {0xc038, 56},
+    {0x8003, 57},
+    {0x8006, 57},
+    {0x800a, 57},
+    {0x800f, 57},
+    {0x8018, 57},
+    {0x801f, 57},
+    {0x8029, 57},
+    {0xc038, 57},
+  },
+  /* 22 */
+  {
+    {0x1a, 0},
+    {0x1b, 0},
+    {0x1d, 0},
+    {0x1e, 0},
+    {0x21, 0},
+    {0x22, 0},
+    {0x24, 0},
+    {0x25, 0},
+    {0x2b, 0},
+    {0x2e, 0},
+    {0x32, 0},
+    {0x35, 0},
+    {0x3a, 0},
+    {0x3d, 0},
+    {0x41, 0},
+    {0x4044, 0},
+  },
+  /* 23 */
+  {
+    {0xc000, 61},
+    {0xc000, 65},
+    {0xc000, 95},
+    {0xc000, 98},
+    {0xc000, 100},
+    {0xc000, 102},
+    {0xc000, 103},
+    {0xc000, 104},
+    {0xc000, 108},
+    {0xc000, 109},
+    {0xc000, 110},
+    {0xc000, 112},
+    {0xc000, 114},
+    {0xc000, 117},
+    {0x26, 0},
+    {0x27, 0},
+  },
+  /* 24 */
+  {
+    {0x8001, 61},
+    {0xc016, 61},
+    {0x8001, 65},
+    {0xc016, 65},
+    {0x8001, 95},
+    {0xc016, 95},
+    {0x8001, 98},
+    {0xc016, 98},
+    {0x8001, 100},
+    {0xc016, 100},
+    {0x8001, 102},
+    {0xc016, 102},
+    {0x8001, 103},
+    {0xc016, 103},
+    {0x8001, 104},
+    {0xc016, 104},
+  },
+  /* 25 */
+  {
+    {0x8002, 61},
+    {0x8009, 61},
+    {0x8017, 61},
+    {0xc028, 61},
+    {0x8002, 65},
+    {0x8009, 65},
+    {0x8017, 65},
+    {0xc028, 65},
+    {0x8002, 95},
+    {0x8009, 95},
+    {0x8017, 95},
+    {0xc028, 95},
+    {0x8002, 98},
+    {0x8009, 98},
+    {0x8017, 98},
+    {0xc028, 98},
+  },
+  /* 26 */
+  {
+    {0x8003, 61},
+    {0x8006, 61},
+    {0x800a, 61},
+    {0x800f, 61},
+    {0x8018, 61},
+    {0x801f, 61},
+    {0x8029, 61},
+    {0xc038, 61},
+    {0x8003, 65},
+    {0x8006, 65},
+    {0x800a, 65},
+    {0x800f, 65},
+    {0x8018, 65},
+    {0x801f, 65},
+    {0x8029, 65},
+    {0xc038, 65},
+  },
+  /* 27 */
+  {
+    {0x8003, 95},
+    {0x8006, 95},
+    {0x800a, 95},
+    {0x800f, 95},
+    {0x8018, 95},
+    {0x801f, 95},
+    {0x8029, 95},
+    {0xc038, 95},
+    {0x8003, 98},
+    {0x8006, 98},
+    {0x800a, 98},
+    {0x800f, 98},
+    {0x8018, 98},
+    {0x801f, 98},
+    {0x8029, 98},
+    {0xc038, 98},
+  },
+  /* 28 */
+  {
+    {0x8002, 100},
+    {0x8009, 100},
+    {0x8017, 100},
+    {0xc028, 100},
+    {0x8002, 102},
+    {0x8009, 102},
+    {0x8017, 102},
+    {0xc028, 102},
+    {0x8002, 103},
+    {0x8009, 103},
+    {0x8017, 103},
+    {0xc028, 103},
+    {0x8002, 104},
+    {0x8009, 104},
+    {0x8017, 104},
+    {0xc028, 104},
+  },
+  /* 29 */
+  {
+    {0x8003, 100},
+    {0x8006, 100},
+    {0x800a, 100},
+    {0x800f, 100},
+    {0x8018, 100},
+    {0x801f, 100},
+    {0x8029, 100},
+    {0xc038, 100},
+    {0x8003, 102},
+    {0x8006, 102},
+    {0x800a, 102},
+    {0x800f, 102},
+    {0x8018, 102},
+    {0x801f, 102},
+    {0x8029, 102},
+    {0xc038, 102},
+  },
+  /* 30 */
+  {
+    {0x8003, 103},
+    {0x8006, 103},
+    {0x800a, 103},
+    {0x800f, 103},
+    {0x8018, 103},
+    {0x801f, 103},
+    {0x8029, 103},
+    {0xc038, 103},
+    {0x8003, 104},
+    {0x8006, 104},
+    {0x800a, 104},
+    {0x800f, 104},
+    {0x8018, 104},
+    {0x801f, 104},
+    {0x8029, 104},
+    {0xc038, 104},
+  },
+  /* 31 */
+  {
+    {0x8001, 108},
+    {0xc016, 108},
+    {0x8001, 109},
+    {0xc016, 109},
+    {0x8001, 110},
+    {0xc016, 110},
+    {0x8001, 112},
+    {0xc016, 112},
+    {0x8001, 114},
+    {0xc016, 114},
+    {0x8001, 117},
+    {0xc016, 117},
+    {0xc000, 58},
+    {0xc000, 66},
+    {0xc000, 67},
+    {0xc000, 68},
+  },
+  /* 32 */
+  {
+    {0x8002, 108},
+    {0x8009, 108},
+    {0x8017, 108},
+    {0xc028, 108},
+    {0x8002, 109},
+    {0x8009, 109},
+    {0x8017, 109},
+    {0xc028, 109},
+    {0x8002, 110},
+    {0x8009, 110},
+    {0x8017, 110},
+    {0xc028, 110},
+    {0x8002, 112},
+    {0x8009, 112},
+    {0x8017, 112},
+    {0xc028, 112},
+  },
+  /* 33 */
+  {
+    {0x8003, 108},
+    {0x8006, 108},
+    {0x800a, 108},
+    {0x800f, 108},
+    {0x8018, 108},
+    {0x801f, 108},
+    {0x8029, 108},
+    {0xc038, 108},
+    {0x8003, 109},
+    {0x8006, 109},
+    {0x800a, 109},
+    {0x800f, 109},
+    {0x8018, 109},
+    {0x801f, 109},
+    {0x8029, 109},
+    {0xc038, 109},
+  },
+  /* 34 */
+  {
+    {0x8003, 110},
+    {0x8006, 110},
+    {0x800a, 110},
+    {0x800f, 110},
+    {0x8018, 110},
+    {0x801f, 110},
+    {0x8029, 110},
+    {0xc038, 110},
+    {0x8003, 112},
+    {0x8006, 112},
+    {0x800a, 112},
+    {0x800f, 112},
+    {0x8018, 112},
+    {0x801f, 112},
+    {0x8029, 112},
+    {0xc038, 112},
+  },
+  /* 35 */
+  {
+    {0x8002, 114},
+    {0x8009, 114},
+    {0x8017, 114},
+    {0xc028, 114},
+    {0x8002, 117},
+    {0x8009, 117},
+    {0x8017, 117},
+    {0xc028, 117},
+    {0x8001, 58},
+    {0xc016, 58},
+    {0x8001, 66},
+    {0xc016, 66},
+    {0x8001, 67},
+    {0xc016, 67},
+    {0x8001, 68},
+    {0xc016, 68},
+  },
+  /* 36 */
+  {
+    {0x8003, 114},
+    {0x8006, 114},
+    {0x800a, 114},
+    {0x800f, 114},
+    {0x8018, 114},
+    {0x801f, 114},
+    {0x8029, 114},
+    {0xc038, 114},
+    {0x8003, 117},
+    {0x8006, 117},
+    {0x800a, 117},
+    {0x800f, 117},
+    {0x8018, 117},
+    {0x801f, 117},
+    {0x8029, 117},
+    {0xc038, 117},
+  },
+  /* 37 */
+  {
+    {0x8002, 58},
+    {0x8009, 58},
+    {0x8017, 58},
+    {0xc028, 58},
+    {0x8002, 66},
+    {0x8009, 66},
+    {0x8017, 66},
+    {0xc028, 66},
+    {0x8002, 67},
+    {0x8009, 67},
+    {0x8017, 67},
+    {0xc028, 67},
+    {0x8002, 68},
+    {0x8009, 68},
+    {0x8017, 68},
+    {0xc028, 68},
+  },
+  /* 38 */
+  {
+    {0x8003, 58},
+    {0x8006, 58},
+    {0x800a, 58},
+    {0x800f, 58},
+    {0x8018, 58},
+    {0x801f, 58},
+    {0x8029, 58},
+    {0xc038, 58},
+    {0x8003, 66},
+    {0x8006, 66},
+    {0x800a, 66},
+    {0x800f, 66},
+    {0x8018, 66},
+    {0x801f, 66},
+    {0x8029, 66},
+    {0xc038, 66},
+  },
+  /* 39 */
+  {
+    {0x8003, 67},
+    {0x8006, 67},
+    {0x800a, 67},
+    {0x800f, 67},
+    {0x8018, 67},
+    {0x801f, 67},
+    {0x8029, 67},
+    {0xc038, 67},
+    {0x8003, 68},
+    {0x8006, 68},
+    {0x800a, 68},
+    {0x800f, 68},
+    {0x8018, 68},
+    {0x801f, 68},
+    {0x8029, 68},
+    {0xc038, 68},
+  },
+  /* 40 */
+  {
+    {0x2c, 0},
+    {0x2d, 0},
+    {0x2f, 0},
+    {0x30, 0},
+    {0x33, 0},
+    {0x34, 0},
+    {0x36, 0},
+    {0x37, 0},
+    {0x3b, 0},
+    {0x3c, 0},
+    {0x3e, 0},
+    {0x3f, 0},
+    {0x42, 0},
+    {0x43, 0},
+    {0x45, 0},
+    {0x4048, 0},
+  },
+  /* 41 */
+  {
+    {0xc000, 69},
+    {0xc000, 70},
+    {0xc000, 71},
+    {0xc000, 72},
+    {0xc000, 73},
+    {0xc000, 74},
+    {0xc000, 75},
+    {0xc000, 76},
+    {0xc000, 77},
+    {0xc000, 78},
+    {0xc000, 79},
+    {0xc000, 80},
+    {0xc000, 81},
+    {0xc000, 82},
+    {0xc000, 83},
+    {0xc000, 84},
+  },
+  /* 42 */
+  {
+    {0x8001, 69},
+    {0xc016, 69},
+    {0x8001, 70},
+    {0xc016, 70},
+    {0x8001, 71},
+    {0xc016, 71},
+    {0x8001, 72},
+    {0xc016, 72},
+    {0x8001, 73},
+    {0xc016, 73},
+    {0x8001, 74},
+    {0xc016, 74},
+    {0x8001, 75},
+    {0xc016, 75},
+    {0x8001, 76},
+    {0xc016, 76},
+  },
+  /* 43 */
+  {
+    {0x8002, 69},
+    {0x8009, 69},
+    {0x8017, 69},
+    {0xc028, 69},
+    {0x8002, 70},
+    {0x8009, 70},
+    {0x8017, 70},
+    {0xc028, 70},
+    {0x8002, 71},
+    {0x8009, 71},
+    {0x8017, 71},
+    {0xc028, 71},
+    {0x8002, 72},
+    {0x8009, 72},
+    {0x8017, 72},
+    {0xc028, 72},
+  },
+  /* 44 */
+  {
+    {0x8003, 69},
+    {0x8006, 69},
+    {0x800a, 69},
+    {0x800f, 69},
+    {0x8018, 69},
+    {0x801f, 69},
+    {0x8029, 69},
+    {0xc038, 69},
+    {0x8003, 70},
+    {0x8006, 70},
+    {0x800a, 70},
+    {0x800f, 70},
+    {0x8018, 70},
+    {0x801f, 70},
+    {0x8029, 70},
+    {0xc038, 70},
+  },
+  /* 45 */
+  {
+    {0x8003, 71},
+    {0x8006, 71},
+    {0x800a, 71},
+    {0x800f, 71},
+    {0x8018, 71},
+    {0x801f, 71},
+    {0x8029, 71},
+    {0xc038, 71},
+    {0x8003, 72},
+    {0x8006, 72},
+    {0x800a, 72},
+    {0x800f, 72},
+    {0x8018, 72},
+    {0x801f, 72},
+    {0x8029, 72},
+    {0xc038, 72},
+  },
+  /* 46 */
+  {
+    {0x8002, 73},
+    {0x8009, 73},
+    {0x8017, 73},
+    {0xc028, 73},
+    {0x8002, 74},
+    {0x8009, 74},
+    {0x8017, 74},
+    {0xc028, 74},
+    {0x8002, 75},
+    {0x8009, 75},
+    {0x8017, 75},
+    {0xc028, 75},
+    {0x8002, 76},
+    {0x8009, 76},
+    {0x8017, 76},
+    {0xc028, 76},
+  },
+  /* 47 */
+  {
+    {0x8003, 73},
+    {0x8006, 73},
+    {0x800a, 73},
+    {0x800f, 73},
+    {0x8018, 73},
+    {0x801f, 73},
+    {0x8029, 73},
+    {0xc038, 73},
+    {0x8003, 74},
+    {0x8006, 74},
+    {0x800a, 74},
+    {0x800f, 74},
+    {0x8018, 74},
+    {0x801f, 74},
+    {0x8029, 74},
+    {0xc038, 74},
+  },
+  /* 48 */
+  {
+    {0x8003, 75},
+    {0x8006, 75},
+    {0x800a, 75},
+    {0x800f, 75},
+    {0x8018, 75},
+    {0x801f, 75},
+    {0x8029, 75},
+    {0xc038, 75},
+    {0x8003, 76},
+    {0x8006, 76},
+    {0x800a, 76},
+    {0x800f, 76},
+    {0x8018, 76},
+    {0x801f, 76},
+    {0x8029, 76},
+    {0xc038, 76},
+  },
+  /* 49 */
+  {
+    {0x8001, 77},
+    {0xc016, 77},
+    {0x8001, 78},
+    {0xc016, 78},
+    {0x8001, 79},
+    {0xc016, 79},
+    {0x8001, 80},
+    {0xc016, 80},
+    {0x8001, 81},
+    {0xc016, 81},
+    {0x8001, 82},
+    {0xc016, 82},
+    {0x8001, 83},
+    {0xc016, 83},
+    {0x8001, 84},
+    {0xc016, 84},
+  },
+  /* 50 */
+  {
+    {0x8002, 77},
+    {0x8009, 77},
+    {0x8017, 77},
+    {0xc028, 77},
+    {0x8002, 78},
+    {0x8009, 78},
+    {0x8017, 78},
+    {0xc028, 78},
+    {0x8002, 79},
+    {0x8009, 79},
+    {0x8017, 79},
+    {0xc028, 79},
+    {0x8002, 80},
+    {0x8009, 80},
+    {0x8017, 80},
+    {0xc028, 80},
+  },
+  /* 51 */
+  {
+    {0x8003, 77},
+    {0x8006, 77},
+    {0x800a, 77},
+    {0x800f, 77},
+    {0x8018, 77},
+    {0x801f, 77},
+    {0x8029, 77},
+    {0xc038, 77},
+    {0x8003, 78},
+    {0x8006, 78},
+    {0x800a, 78},
+    {0x800f, 78},
+    {0x8018, 78},
+    {0x801f, 78},
+    {0x8029, 78},
+    {0xc038, 78},
+  },
+  /* 52 */
+  {
+    {0x8003, 79},
+    {0x8006, 79},
+    {0x800a, 79},
+    {0x800f, 79},
+    {0x8018, 79},
+    {0x801f, 79},
+    {0x8029, 79},
+    {0xc038, 79},
+    {0x8003, 80},
+    {0x8006, 80},
+    {0x800a, 80},
+    {0x800f, 80},
+    {0x8018, 80},
+    {0x801f, 80},
+    {0x8029, 80},
+    {0xc038, 80},
+  },
+  /* 53 */
+  {
+    {0x8002, 81},
+    {0x8009, 81},
+    {0x8017, 81},
+    {0xc028, 81},
+    {0x8002, 82},
+    {0x8009, 82},
+    {0x8017, 82},
+    {0xc028, 82},
+    {0x8002, 83},
+    {0x8009, 83},
+    {0x8017, 83},
+    {0xc028, 83},
+    {0x8002, 84},
+    {0x8009, 84},
+    {0x8017, 84},
+    {0xc028, 84},
+  },
+  /* 54 */
+  {
+    {0x8003, 81},
+    {0x8006, 81},
+    {0x800a, 81},
+    {0x800f, 81},
+    {0x8018, 81},
+    {0x801f, 81},
+    {0x8029, 81},
+    {0xc038, 81},
+    {0x8003, 82},
+    {0x8006, 82},
+    {0x800a, 82},
+    {0x800f, 82},
+    {0x8018, 82},
+    {0x801f, 82},
+    {0x8029, 82},
+    {0xc038, 82},
+  },
+  /* 55 */
+  {
+    {0x8003, 83},
+    {0x8006, 83},
+    {0x800a, 83},
+    {0x800f, 83},
+    {0x8018, 83},
+    {0x801f, 83},
+    {0x8029, 83},
+    {0xc038, 83},
+    {0x8003, 84},
+    {0x8006, 84},
+    {0x800a, 84},
+    {0x800f, 84},
+    {0x8018, 84},
+    {0x801f, 84},
+    {0x8029, 84},
+    {0xc038, 84},
+  },
+  /* 56 */
+  {
+    {0xc000, 85},
+    {0xc000, 86},
+    {0xc000, 87},
+    {0xc000, 89},
+    {0xc000, 106},
+    {0xc000, 107},
+    {0xc000, 113},
+    {0xc000, 118},
+    {0xc000, 119},
+    {0xc000, 120},
+    {0xc000, 121},
+    {0xc000, 122},
+    {0x46, 0},
+    {0x47, 0},
+    {0x49, 0},
+    {0x404a, 0},
+  },
+  /* 57 */
+  {
+    {0x8001, 85},
+    {0xc016, 85},
+    {0x8001, 86},
+    {0xc016, 86},
+    {0x8001, 87},
+    {0xc016, 87},
+    {0x8001, 89},
+    {0xc016, 89},
+    {0x8001, 106},
+    {0xc016, 106},
+    {0x8001, 107},
+    {0xc016, 107},
+    {0x8001, 113},
+    {0xc016, 113},
+    {0x8001, 118},
+    {0xc016, 118},
+  },
+  /* 58 */
+  {
+    {0x8002, 85},
+    {0x8009, 85},
+    {0x8017, 85},
+    {0xc028, 85},
+    {0x8002, 86},
+    {0x8009, 86},
+    {0x8017, 86},
+    {0xc028, 86},
+    {0x8002, 87},
+    {0x8009, 87},
+    {0x8017, 87},
+    {0xc028, 87},
+    {0x8002, 89},
+    {0x8009, 89},
+    {0x8017, 89},
+    {0xc028, 89},
+  },
+  /* 59 */
+  {
+    {0x8003, 85},
+    {0x8006, 85},
+    {0x800a, 85},
+    {0x800f, 85},
+    {0x8018, 85},
+    {0x801f, 85},
+    {0x8029, 85},
+    {0xc038, 85},
+    {0x8003, 86},
+    {0x8006, 86},
+    {0x800a, 86},
+    {0x800f, 86},
+    {0x8018, 86},
+    {0x801f, 86},
+    {0x8029, 86},
+    {0xc038, 86},
+  },
+  /* 60 */
+  {
+    {0x8003, 87},
+    {0x8006, 87},
+    {0x800a, 87},
+    {0x800f, 87},
+    {0x8018, 87},
+    {0x801f, 87},
+    {0x8029, 87},
+    {0xc038, 87},
+    {0x8003, 89},
+    {0x8006, 89},
+    {0x800a, 89},
+    {0x800f, 89},
+    {0x8018, 89},
+    {0x801f, 89},
+    {0x8029, 89},
+    {0xc038, 89},
+  },
+  /* 61 */
+  {
+    {0x8002, 106},
+    {0x8009, 106},
+    {0x8017, 106},
+    {0xc028, 106},
+    {0x8002, 107},
+    {0x8009, 107},
+    {0x8017, 107},
+    {0xc028, 107},
+    {0x8002, 113},
+    {0x8009, 113},
+    {0x8017, 113},
+    {0xc028, 113},
+    {0x8002, 118},
+    {0x8009, 118},
+    {0x8017, 118},
+    {0xc028, 118},
+  },
+  /* 62 */
+  {
+    {0x8003, 106},
+    {0x8006, 106},
+    {0x800a, 106},
+    {0x800f, 106},
+    {0x8018, 106},
+    {0x801f, 106},
+    {0x8029, 106},
+    {0xc038, 106},
+    {0x8003, 107},
+    {0x8006, 107},
+    {0x800a, 107},
+    {0x800f, 107},
+    {0x8018, 107},
+    {0x801f, 107},
+    {0x8029, 107},
+    {0xc038, 107},
+  },
+  /* 63 */
+  {
+    {0x8003, 113},
+    {0x8006, 113},
+    {0x800a, 113},
+    {0x800f, 113},
+    {0x8018, 113},
+    {0x801f, 113},
+    {0x8029, 113},
+    {0xc038, 113},
+    {0x8003, 118},
+    {0x8006, 118},
+    {0x800a, 118},
+    {0x800f, 118},
+    {0x8018, 118},
+    {0x801f, 118},
+    {0x8029, 118},
+    {0xc038, 118},
+  },
+  /* 64 */
+  {
+    {0x8001, 119},
+    {0xc016, 119},
+    {0x8001, 120},
+    {0xc016, 120},
+    {0x8001, 121},
+    {0xc016, 121},
+    {0x8001, 122},
+    {0xc016, 122},
+    {0xc000, 38},
+    {0xc000, 42},
+    {0xc000, 44},
+    {0xc000, 59},
+    {0xc000, 88},
+    {0xc000, 90},
+    {0x4b, 0},
+    {0x4e, 0},
+  },
+  /* 65 */
+  {
+    {0x8002, 119},
+    {0x8009, 119},
+    {0x8017, 119},
+    {0xc028, 119},
+    {0x8002, 120},
+    {0x8009, 120},
+    {0x8017, 120},
+    {0xc028, 120},
+    {0x8002, 121},
+    {0x8009, 121},
+    {0x8017, 121},
+    {0xc028, 121},
+    {0x8002, 122},
+    {0x8009, 122},
+    {0x8017, 122},
+    {0xc028, 122},
+  },
+  /* 66 */
+  {
+    {0x8003, 119},
+    {0x8006, 119},
+    {0x800a, 119},
+    {0x800f, 119},
+    {0x8018, 119},
+    {0x801f, 119},
+    {0x8029, 119},
+    {0xc038, 119},
+    {0x8003, 120},
+    {0x8006, 120},
+    {0x800a, 120},
+    {0x800f, 120},
+    {0x8018, 120},
+    {0x801f, 120},
+    {0x8029, 120},
+    {0xc038, 120},
+  },
+  /* 67 */
+  {
+    {0x8003, 121},
+    {0x8006, 121},
+    {0x800a, 121},
+    {0x800f, 121},
+    {0x8018, 121},
+    {0x801f, 121},
+    {0x8029, 121},
+    {0xc038, 121},
+    {0x8003, 122},
+    {0x8006, 122},
+    {0x800a, 122},
+    {0x800f, 122},
+    {0x8018, 122},
+    {0x801f, 122},
+    {0x8029, 122},
+    {0xc038, 122},
+  },
+  /* 68 */
+  {
+    {0x8001, 38},
+    {0xc016, 38},
+    {0x8001, 42},
+    {0xc016, 42},
+    {0x8001, 44},
+    {0xc016, 44},
+    {0x8001, 59},
+    {0xc016, 59},
+    {0x8001, 88},
+    {0xc016, 88},
+    {0x8001, 90},
+    {0xc016, 90},
+    {0x4c, 0},
+    {0x4d, 0},
+    {0x4f, 0},
+    {0x51, 0},
+  },
+  /* 69 */
+  {
+    {0x8002, 38},
+    {0x8009, 38},
+    {0x8017, 38},
+    {0xc028, 38},
+    {0x8002, 42},
+    {0x8009, 42},
+    {0x8017, 42},
+    {0xc028, 42},
+    {0x8002, 44},
+    {0x8009, 44},
+    {0x8017, 44},
+    {0xc028, 44},
+    {0x8002, 59},
+    {0x8009, 59},
+    {0x8017, 59},
+    {0xc028, 59},
+  },
+  /* 70 */
+  {
+    {0x8003, 38},
+    {0x8006, 38},
+    {0x800a, 38},
+    {0x800f, 38},
+    {0x8018, 38},
+    {0x801f, 38},
+    {0x8029, 38},
+    {0xc038, 38},
+    {0x8003, 42},
+    {0x8006, 42},
+    {0x800a, 42},
+    {0x800f, 42},
+    {0x8018, 42},
+    {0x801f, 42},
+    {0x8029, 42},
+    {0xc038, 42},
+  },
+  /* 71 */
+  {
+    {0x8003, 44},
+    {0x8006, 44},
+    {0x800a, 44},
+    {0x800f, 44},
+    {0x8018, 44},
+    {0x801f, 44},
+    {0x8029, 44},
+    {0xc038, 44},
+    {0x8003, 59},
+    {0x8006, 59},
+    {0x800a, 59},
+    {0x800f, 59},
+    {0x8018, 59},
+    {0x801f, 59},
+    {0x8029, 59},
+    {0xc038, 59},
+  },
+  /* 72 */
+  {
+    {0x8002, 88},
+    {0x8009, 88},
+    {0x8017, 88},
+    {0xc028, 88},
+    {0x8002, 90},
+    {0x8009, 90},
+    {0x8017, 90},
+    {0xc028, 90},
+    {0xc000, 33},
+    {0xc000, 34},
+    {0xc000, 40},
+    {0xc000, 41},
+    {0xc000, 63},
+    {0x50, 0},
+    {0x52, 0},
+    {0x54, 0},
+  },
+  /* 73 */
+  {
+    {0x8003, 88},
+    {0x8006, 88},
+    {0x800a, 88},
+    {0x800f, 88},
+    {0x8018, 88},
+    {0x801f, 88},
+    {0x8029, 88},
+    {0xc038, 88},
+    {0x8003, 90},
+    {0x8006, 90},
+    {0x800a, 90},
+    {0x800f, 90},
+    {0x8018, 90},
+    {0x801f, 90},
+    {0x8029, 90},
+    {0xc038, 90},
+  },
+  /* 74 */
+  {
+    {0x8001, 33},
+    {0xc016, 33},
+    {0x8001, 34},
+    {0xc016, 34},
+    {0x8001, 40},
+    {0xc016, 40},
+    {0x8001, 41},
+    {0xc016, 41},
+    {0x8001, 63},
+    {0xc016, 63},
+    {0xc000, 39},
+    {0xc000, 43},
+    {0xc000, 124},
+    {0x53, 0},
+    {0x55, 0},
+    {0x58, 0},
+  },
+  /* 75 */
+  {
+    {0x8002, 33},
+    {0x8009, 33},
+    {0x8017, 33},
+    {0xc028, 33},
+    {0x8002, 34},
+    {0x8009, 34},
+    {0x8017, 34},
+    {0xc028, 34},
+    {0x8002, 40},
+    {0x8009, 40},
+    {0x8017, 40},
+    {0xc028, 40},
+    {0x8002, 41},
+    {0x8009, 41},
+    {0x8017, 41},
+    {0xc028, 41},
+  },
+  /* 76 */
+  {
+    {0x8003, 33},
+    {0x8006, 33},
+    {0x800a, 33},
+    {0x800f, 33},
+    {0x8018, 33},
+    {0x801f, 33},
+    {0x8029, 33},
+    {0xc038, 33},
+    {0x8003, 34},
+    {0x8006, 34},
+    {0x800a, 34},
+    {0x800f, 34},
+    {0x8018, 34},
+    {0x801f, 34},
+    {0x8029, 34},
+    {0xc038, 34},
+  },
+  /* 77 */
+  {
+    {0x8003, 40},
+    {0x8006, 40},
+    {0x800a, 40},
+    {0x800f, 40},
+    {0x8018, 40},
+    {0x801f, 40},
+    {0x8029, 40},
+    {0xc038, 40},
+    {0x8003, 41},
+    {0x8006, 41},
+    {0x800a, 41},
+    {0x800f, 41},
+    {0x8018, 41},
+    {0x801f, 41},
+    {0x8029, 41},
+    {0xc038, 41},
+  },
+  /* 78 */
+  {
+    {0x8002, 63},
+    {0x8009, 63},
+    {0x8017, 63},
+    {0xc028, 63},
+    {0x8001, 39},
+    {0xc016, 39},
+    {0x8001, 43},
+    {0xc016, 43},
+    {0x8001, 124},
+    {0xc016, 124},
+    {0xc000, 35},
+    {0xc000, 62},
+    {0x56, 0},
+    {0x57, 0},
+    {0x59, 0},
+    {0x5a, 0},
+  },
+  /* 79 */
+  {
+    {0x8003, 63},
+    {0x8006, 63},
+    {0x800a, 63},
+    {0x800f, 63},
+    {0x8018, 63},
+    {0x801f, 63},
+    {0x8029, 63},
+    {0xc038, 63},
+    {0x8002, 39},
+    {0x8009, 39},
+    {0x8017, 39},
+    {0xc028, 39},
+    {0x8002, 43},
+    {0x8009, 43},
+    {0x8017, 43},
+    {0xc028, 43},
+  },
+  /* 80 */
+  {
+    {0x8003, 39},
+    {0x8006, 39},
+    {0x800a, 39},
+    {0x800f, 39},
+    {0x8018, 39},
+    {0x801f, 39},
+    {0x8029, 39},
+    {0xc038, 39},
+    {0x8003, 43},
+    {0x8006, 43},
+    {0x800a, 43},
+    {0x800f, 43},
+    {0x8018, 43},
+    {0x801f, 43},
+    {0x8029, 43},
+    {0xc038, 43},
+  },
+  /* 81 */
+  {
+    {0x8002, 124},
+    {0x8009, 124},
+    {0x8017, 124},
+    {0xc028, 124},
+    {0x8001, 35},
+    {0xc016, 35},
+    {0x8001, 62},
+    {0xc016, 62},
+    {0xc000, 0},
+    {0xc000, 36},
+    {0xc000, 64},
+    {0xc000, 91},
+    {0xc000, 93},
+    {0xc000, 126},
+    {0x5b, 0},
+    {0x5c, 0},
+  },
+  /* 82 */
+  {
+    {0x8003, 124},
+    {0x8006, 124},
+    {0x800a, 124},
+    {0x800f, 124},
+    {0x8018, 124},
+    {0x801f, 124},
+    {0x8029, 124},
+    {0xc038, 124},
+    {0x8002, 35},
+    {0x8009, 35},
+    {0x8017, 35},
+    {0xc028, 35},
+    {0x8002, 62},
+    {0x8009, 62},
+    {0x8017, 62},
+    {0xc028, 62},
+  },
+  /* 83 */
+  {
+    {0x8003, 35},
+    {0x8006, 35},
+    {0x800a, 35},
+    {0x800f, 35},
+    {0x8018, 35},
+    {0x801f, 35},
+    {0x8029, 35},
+    {0xc038, 35},
+    {0x8003, 62},
+    {0x8006, 62},
+    {0x800a, 62},
+    {0x800f, 62},
+    {0x8018, 62},
+    {0x801f, 62},
+    {0x8029, 62},
+    {0xc038, 62},
+  },
+  /* 84 */
+  {
+    {0x8001, 0},
+    {0xc016, 0},
+    {0x8001, 36},
+    {0xc016, 36},
+    {0x8001, 64},
+    {0xc016, 64},
+    {0x8001, 91},
+    {0xc016, 91},
+    {0x8001, 93},
+    {0xc016, 93},
+    {0x8001, 126},
+    {0xc016, 126},
+    {0xc000, 94},
+    {0xc000, 125},
+    {0x5d, 0},
+    {0x5e, 0},
+  },
+  /* 85 */
+  {
+    {0x8002, 0},
+    {0x8009, 0},
+    {0x8017, 0},
+    {0xc028, 0},
+    {0x8002, 36},
+    {0x8009, 36},
+    {0x8017, 36},
+    {0xc028, 36},
+    {0x8002, 64},
+    {0x8009, 64},
+    {0x8017, 64},
+    {0xc028, 64},
+    {0x8002, 91},
+    {0x8009, 91},
+    {0x8017, 91},
+    {0xc028, 91},
+  },
+  /* 86 */
+  {
+    {0x8003, 0},
+    {0x8006, 0},
+    {0x800a, 0},
+    {0x800f, 0},
+    {0x8018, 0},
+    {0x801f, 0},
+    {0x8029, 0},
+    {0xc038, 0},
+    {0x8003, 36},
+    {0x8006, 36},
+    {0x800a, 36},
+    {0x800f, 36},
+    {0x8018, 36},
+    {0x801f, 36},
+    {0x8029, 36},
+    {0xc038, 36},
+  },
+  /* 87 */
+  {
+    {0x8003, 64},
+    {0x8006, 64},
+    {0x800a, 64},
+    {0x800f, 64},
+    {0x8018, 64},
+    {0x801f, 64},
+    {0x8029, 64},
+    {0xc038, 64},
+    {0x8003, 91},
+    {0x8006, 91},
+    {0x800a, 91},
+    {0x800f, 91},
+    {0x8018, 91},
+    {0x801f, 91},
+    {0x8029, 91},
+    {0xc038, 91},
+  },
+  /* 88 */
+  {
+    {0x8002, 93},
+    {0x8009, 93},
+    {0x8017, 93},
+    {0xc028, 93},
+    {0x8002, 126},
+    {0x8009, 126},
+    {0x8017, 126},
+    {0xc028, 126},
+    {0x8001, 94},
+    {0xc016, 94},
+    {0x8001, 125},
+    {0xc016, 125},
+    {0xc000, 60},
+    {0xc000, 96},
+    {0xc000, 123},
+    {0x5f, 0},
+  },
+  /* 89 */
+  {
+    {0x8003, 93},
+    {0x8006, 93},
+    {0x800a, 93},
+    {0x800f, 93},
+    {0x8018, 93},
+    {0x801f, 93},
+    {0x8029, 93},
+    {0xc038, 93},
+    {0x8003, 126},
+    {0x8006, 126},
+    {0x800a, 126},
+    {0x800f, 126},
+    {0x8018, 126},
+    {0x801f, 126},
+    {0x8029, 126},
+    {0xc038, 126},
+  },
+  /* 90 */
+  {
+    {0x8002, 94},
+    {0x8009, 94},
+    {0x8017, 94},
+    {0xc028, 94},
+    {0x8002, 125},
+    {0x8009, 125},
+    {0x8017, 125},
+    {0xc028, 125},
+    {0x8001, 60},
+    {0xc016, 60},
+    {0x8001, 96},
+    {0xc016, 96},
+    {0x8001, 123},
+    {0xc016, 123},
+    {0x60, 0},
+    {0x6e, 0},
+  },
+  /* 91 */
+  {
+    {0x8003, 94},
+    {0x8006, 94},
+    {0x800a, 94},
+    {0x800f, 94},
+    {0x8018, 94},
+    {0x801f, 94},
+    {0x8029, 94},
+    {0xc038, 94},
+    {0x8003, 125},
+    {0x8006, 125},
+    {0x800a, 125},
+    {0x800f, 125},
+    {0x8018, 125},
+    {0x801f, 125},
+    {0x8029, 125},
+    {0xc038, 125},
+  },
+  /* 92 */
+  {
+    {0x8002, 60},
+    {0x8009, 60},
+    {0x8017, 60},
+    {0xc028, 60},
+    {0x8002, 96},
+    {0x8009, 96},
+    {0x8017, 96},
+    {0xc028, 96},
+    {0x8002, 123},
+    {0x8009, 123},
+    {0x8017, 123},
+    {0xc028, 123},
+    {0x61, 0},
+    {0x65, 0},
+    {0x6f, 0},
+    {0x85, 0},
+  },
+  /* 93 */
+  {
+    {0x8003, 60},
+    {0x8006, 60},
+    {0x800a, 60},
+    {0x800f, 60},
+    {0x8018, 60},
+    {0x801f, 60},
+    {0x8029, 60},
+    {0xc038, 60},
+    {0x8003, 96},
+    {0x8006, 96},
+    {0x800a, 96},
+    {0x800f, 96},
+    {0x8018, 96},
+    {0x801f, 96},
+    {0x8029, 96},
+    {0xc038, 96},
+  },
+  /* 94 */
+  {
+    {0x8003, 123},
+    {0x8006, 123},
+    {0x800a, 123},
+    {0x800f, 123},
+    {0x8018, 123},
+    {0x801f, 123},
+    {0x8029, 123},
+    {0xc038, 123},
+    {0x62, 0},
+    {0x63, 0},
+    {0x66, 0},
+    {0x69, 0},
+    {0x70, 0},
+    {0x77, 0},
+    {0x86, 0},
+    {0x99, 0},
+  },
+  /* 95 */
+  {
+    {0xc000, 92},
+    {0xc000, 195},
+    {0xc000, 208},
+    {0x64, 0},
+    {0x67, 0},
+    {0x68, 0},
+    {0x6a, 0},
+    {0x6b, 0},
+    {0x71, 0},
+    {0x74, 0},
+    {0x78, 0},
+    {0x7e, 0},
+    {0x87, 0},
+    {0x8e, 0},
+    {0x9a, 0},
+    {0xa9, 0},
+  },
+  /* 96 */
+  {
+    {0x8001, 92},
+    {0xc016, 92},
+    {0x8001, 195},
+    {0xc016, 195},
+    {0x8001, 208},
+    {0xc016, 208},
+    {0xc000, 128},
+    {0xc000, 130},
+    {0xc000, 131},
+    {0xc000, 162},
+    {0xc000, 184},
+    {0xc000, 194},
+    {0xc000, 224},
+    {0xc000, 226},
+    {0x6c, 0},
+    {0x6d, 0},
+  },
+  /* 97 */
+  {
+    {0x8002, 92},
+    {0x8009, 92},
+    {0x8017, 92},
+    {0xc028, 92},
+    {0x8002, 195},
+    {0x8009, 195},
+    {0x8017, 195},
+    {0xc028, 195},
+    {0x8002, 208},
+    {0x8009, 208},
+    {0x8017, 208},
+    {0xc028, 208},
+    {0x8001, 128},
+    {0xc016, 128},
+    {0x8001, 130},
+    {0xc016, 130},
+  },
+  /* 98 */
+  {
+    {0x8003, 92},
+    {0x8006, 92},
+    {0x800a, 92},
+    {0x800f, 92},
+    {0x8018, 92},
+    {0x801f, 92},
+    {0x8029, 92},
+    {0xc038, 92},
+    {0x8003, 195},
+    {0x8006, 195},
+    {0x800a, 195},
+    {0x800f, 195},
+    {0x8018, 195},
+    {0x801f, 195},
+    {0x8029, 195},
+    {0xc038, 195},
+  },
+  /* 99 */
+  {
+    {0x8003, 208},
+    {0x8006, 208},
+    {0x800a, 208},
+    {0x800f, 208},
+    {0x8018, 208},
+    {0x801f, 208},
+    {0x8029, 208},
+    {0xc038, 208},
+    {0x8002, 128},
+    {0x8009, 128},
+    {0x8017, 128},
+    {0xc028, 128},
+    {0x8002, 130},
+    {0x8009, 130},
+    {0x8017, 130},
+    {0xc028, 130},
+  },
+  /* 100 */
+  {
+    {0x8003, 128},
+    {0x8006, 128},
+    {0x800a, 128},
+    {0x800f, 128},
+    {0x8018, 128},
+    {0x801f, 128},
+    {0x8029, 128},
+    {0xc038, 128},
+    {0x8003, 130},
+    {0x8006, 130},
+    {0x800a, 130},
+    {0x800f, 130},
+    {0x8018, 130},
+    {0x801f, 130},
+    {0x8029, 130},
+    {0xc038, 130},
+  },
+  /* 101 */
+  {
+    {0x8001, 131},
+    {0xc016, 131},
+    {0x8001, 162},
+    {0xc016, 162},
+    {0x8001, 184},
+    {0xc016, 184},
+    {0x8001, 194},
+    {0xc016, 194},
+    {0x8001, 224},
+    {0xc016, 224},
+    {0x8001, 226},
+    {0xc016, 226},
+    {0xc000, 153},
+    {0xc000, 161},
+    {0xc000, 167},
+    {0xc000, 172},
+  },
+  /* 102 */
+  {
+    {0x8002, 131},
+    {0x8009, 131},
+    {0x8017, 131},
+    {0xc028, 131},
+    {0x8002, 162},
+    {0x8009, 162},
+    {0x8017, 162},
+    {0xc028, 162},
+    {0x8002, 184},
+    {0x8009, 184},
+    {0x8017, 184},
+    {0xc028, 184},
+    {0x8002, 194},
+    {0x8009, 194},
+    {0x8017, 194},
+    {0xc028, 194},
+  },
+  /* 103 */
+  {
+    {0x8003, 131},
+    {0x8006, 131},
+    {0x800a, 131},
+    {0x800f, 131},
+    {0x8018, 131},
+    {0x801f, 131},
+    {0x8029, 131},
+    {0xc038, 131},
+    {0x8003, 162},
+    {0x8006, 162},
+    {0x800a, 162},
+    {0x800f, 162},
+    {0x8018, 162},
+    {0x801f, 162},
+    {0x8029, 162},
+    {0xc038, 162},
+  },
+  /* 104 */
+  {
+    {0x8003, 184},
+    {0x8006, 184},
+    {0x800a, 184},
+    {0x800f, 184},
+    {0x8018, 184},
+    {0x801f, 184},
+    {0x8029, 184},
+    {0xc038, 184},
+    {0x8003, 194},
+    {0x8006, 194},
+    {0x800a, 194},
+    {0x800f, 194},
+    {0x8018, 194},
+    {0x801f, 194},
+    {0x8029, 194},
+    {0xc038, 194},
+  },
+  /* 105 */
+  {
+    {0x8002, 224},
+    {0x8009, 224},
+    {0x8017, 224},
+    {0xc028, 224},
+    {0x8002, 226},
+    {0x8009, 226},
+    {0x8017, 226},
+    {0xc028, 226},
+    {0x8001, 153},
+    {0xc016, 153},
+    {0x8001, 161},
+    {0xc016, 161},
+    {0x8001, 167},
+    {0xc016, 167},
+    {0x8001, 172},
+    {0xc016, 172},
+  },
+  /* 106 */
+  {
+    {0x8003, 224},
+    {0x8006, 224},
+    {0x800a, 224},
+    {0x800f, 224},
+    {0x8018, 224},
+    {0x801f, 224},
+    {0x8029, 224},
+    {0xc038, 224},
+    {0x8003, 226},
+    {0x8006, 226},
+    {0x800a, 226},
+    {0x800f, 226},
+    {0x8018, 226},
+    {0x801f, 226},
+    {0x8029, 226},
+    {0xc038, 226},
+  },
+  /* 107 */
+  {
+    {0x8002, 153},
+    {0x8009, 153},
+    {0x8017, 153},
+    {0xc028, 153},
+    {0x8002, 161},
+    {0x8009, 161},
+    {0x8017, 161},
+    {0xc028, 161},
+    {0x8002, 167},
+    {0x8009, 167},
+    {0x8017, 167},
+    {0xc028, 167},
+    {0x8002, 172},
+    {0x8009, 172},
+    {0x8017, 172},
+    {0xc028, 172},
+  },
+  /* 108 */
+  {
+    {0x8003, 153},
+    {0x8006, 153},
+    {0x800a, 153},
+    {0x800f, 153},
+    {0x8018, 153},
+    {0x801f, 153},
+    {0x8029, 153},
+    {0xc038, 153},
+    {0x8003, 161},
+    {0x8006, 161},
+    {0x800a, 161},
+    {0x800f, 161},
+    {0x8018, 161},
+    {0x801f, 161},
+    {0x8029, 161},
+    {0xc038, 161},
+  },
+  /* 109 */
+  {
+    {0x8003, 167},
+    {0x8006, 167},
+    {0x800a, 167},
+    {0x800f, 167},
+    {0x8018, 167},
+    {0x801f, 167},
+    {0x8029, 167},
+    {0xc038, 167},
+    {0x8003, 172},
+    {0x8006, 172},
+    {0x800a, 172},
+    {0x800f, 172},
+    {0x8018, 172},
+    {0x801f, 172},
+    {0x8029, 172},
+    {0xc038, 172},
+  },
+  /* 110 */
+  {
+    {0x72, 0},
+    {0x73, 0},
+    {0x75, 0},
+    {0x76, 0},
+    {0x79, 0},
+    {0x7b, 0},
+    {0x7f, 0},
+    {0x82, 0},
+    {0x88, 0},
+    {0x8b, 0},
+    {0x8f, 0},
+    {0x92, 0},
+    {0x9b, 0},
+    {0xa2, 0},
+    {0xaa, 0},
+    {0xb4, 0},
+  },
+  /* 111 */
+  {
+    {0xc000, 176},
+    {0xc000, 177},
+    {0xc000, 179},
+    {0xc000, 209},
+    {0xc000, 216},
+    {0xc000, 217},
+    {0xc000, 227},
+    {0xc000, 229},
+    {0xc000, 230},
+    {0x7a, 0},
+    {0x7c, 0},
+    {0x7d, 0},
+    {0x80, 0},
+    {0x81, 0},
+    {0x83, 0},
+    {0x84, 0},
+  },
+  /* 112 */
+  {
+    {0x8001, 176},
+    {0xc016, 176},
+    {0x8001, 177},
+    {0xc016, 177},
+    {0x8001, 179},
+    {0xc016, 179},
+    {0x8001, 209},
+    {0xc016, 209},
+    {0x8001, 216},
+    {0xc016, 216},
+    {0x8001, 217},
+    {0xc016, 217},
+    {0x8001, 227},
+    {0xc016, 227},
+    {0x8001, 229},
+    {0xc016, 229},
+  },
+  /* 113 */
+  {
+    {0x8002, 176},
+    {0x8009, 176},
+    {0x8017, 176},
+    {0xc028, 176},
+    {0x8002, 177},
+    {0x8009, 177},
+    {0x8017, 177},
+    {0xc028, 177},
+    {0x8002, 179},
+    {0x8009, 179},
+    {0x8017, 179},
+    {0xc028, 179},
+    {0x8002, 209},
+    {0x8009, 209},
+    {0x8017, 209},
+    {0xc028, 209},
+  },
+  /* 114 */
+  {
+    {0x8003, 176},
+    {0x8006, 176},
+    {0x800a, 176},
+    {0x800f, 176},
+    {0x8018, 176},
+    {0x801f, 176},
+    {0x8029, 176},
+    {0xc038, 176},
+    {0x8003, 177},
+    {0x8006, 177},
+    {0x800a, 177},
+    {0x800f, 177},
+    {0x8018, 177},
+    {0x801f, 177},
+    {0x8029, 177},
+    {0xc038, 177},
+  },
+  /* 115 */
+  {
+    {0x8003, 179},
+    {0x8006, 179},
+    {0x800a, 179},
+    {0x800f, 179},
+    {0x8018, 179},
+    {0x801f, 179},
+    {0x8029, 179},
+    {0xc038, 179},
+    {0x8003, 209},
+    {0x8006, 209},
+    {0x800a, 209},
+    {0x800f, 209},
+    {0x8018, 209},
+    {0x801f, 209},
+    {0x8029, 209},
+    {0xc038, 209},
+  },
+  /* 116 */
+  {
+    {0x8002, 216},
+    {0x8009, 216},
+    {0x8017, 216},
+    {0xc028, 216},
+    {0x8002, 217},
+    {0x8009, 217},
+    {0x8017, 217},
+    {0xc028, 217},
+    {0x8002, 227},
+    {0x8009, 227},
+    {0x8017, 227},
+    {0xc028, 227},
+    {0x8002, 229},
+    {0x8009, 229},
+    {0x8017, 229},
+    {0xc028, 229},
+  },
+  /* 117 */
+  {
+    {0x8003, 216},
+    {0x8006, 216},
+    {0x800a, 216},
+    {0x800f, 216},
+    {0x8018, 216},
+    {0x801f, 216},
+    {0x8029, 216},
+    {0xc038, 216},
+    {0x8003, 217},
+    {0x8006, 217},
+    {0x800a, 217},
+    {0x800f, 217},
+    {0x8018, 217},
+    {0x801f, 217},
+    {0x8029, 217},
+    {0xc038, 217},
+  },
+  /* 118 */
+  {
+    {0x8003, 227},
+    {0x8006, 227},
+    {0x800a, 227},
+    {0x800f, 227},
+    {0x8018, 227},
+    {0x801f, 227},
+    {0x8029, 227},
+    {0xc038, 227},
+    {0x8003, 229},
+    {0x8006, 229},
+    {0x800a, 229},
+    {0x800f, 229},
+    {0x8018, 229},
+    {0x801f, 229},
+    {0x8029, 229},
+    {0xc038, 229},
+  },
+  /* 119 */
+  {
+    {0x8001, 230},
+    {0xc016, 230},
+    {0xc000, 129},
+    {0xc000, 132},
+    {0xc000, 133},
+    {0xc000, 134},
+    {0xc000, 136},
+    {0xc000, 146},
+    {0xc000, 154},
+    {0xc000, 156},
+    {0xc000, 160},
+    {0xc000, 163},
+    {0xc000, 164},
+    {0xc000, 169},
+    {0xc000, 170},
+    {0xc000, 173},
+  },
+  /* 120 */
+  {
+    {0x8002, 230},
+    {0x8009, 230},
+    {0x8017, 230},
+    {0xc028, 230},
+    {0x8001, 129},
+    {0xc016, 129},
+    {0x8001, 132},
+    {0xc016, 132},
+    {0x8001, 133},
+    {0xc016, 133},
+    {0x8001, 134},
+    {0xc016, 134},
+    {0x8001, 136},
+    {0xc016, 136},
+    {0x8001, 146},
+    {0xc016, 146},
+  },
+  /* 121 */
+  {
+    {0x8003, 230},
+    {0x8006, 230},
+    {0x800a, 230},
+    {0x800f, 230},
+    {0x8018, 230},
+    {0x801f, 230},
+    {0x8029, 230},
+    {0xc038, 230},
+    {0x8002, 129},
+    {0x8009, 129},
+    {0x8017, 129},
+    {0xc028, 129},
+    {0x8002, 132},
+    {0x8009, 132},
+    {0x8017, 132},
+    {0xc028, 132},
+  },
+  /* 122 */
+  {
+    {0x8003, 129},
+    {0x8006, 129},
+    {0x800a, 129},
+    {0x800f, 129},
+    {0x8018, 129},
+    {0x801f, 129},
+    {0x8029, 129},
+    {0xc038, 129},
+    {0x8003, 132},
+    {0x8006, 132},
+    {0x800a, 132},
+    {0x800f, 132},
+    {0x8018, 132},
+    {0x801f, 132},
+    {0x8029, 132},
+    {0xc038, 132},
+  },
+  /* 123 */
+  {
+    {0x8002, 133},
+    {0x8009, 133},
+    {0x8017, 133},
+    {0xc028, 133},
+    {0x8002, 134},
+    {0x8009, 134},
+    {0x8017, 134},
+    {0xc028, 134},
+    {0x8002, 136},
+    {0x8009, 136},
+    {0x8017, 136},
+    {0xc028, 136},
+    {0x8002, 146},
+    {0x8009, 146},
+    {0x8017, 146},
+    {0xc028, 146},
+  },
+  /* 124 */
+  {
+    {0x8003, 133},
+    {0x8006, 133},
+    {0x800a, 133},
+    {0x800f, 133},
+    {0x8018, 133},
+    {0x801f, 133},
+    {0x8029, 133},
+    {0xc038, 133},
+    {0x8003, 134},
+    {0x8006, 134},
+    {0x800a, 134},
+    {0x800f, 134},
+    {0x8018, 134},
+    {0x801f, 134},
+    {0x8029, 134},
+    {0xc038, 134},
+  },
+  /* 125 */
+  {
+    {0x8003, 136},
+    {0x8006, 136},
+    {0x800a, 136},
+    {0x800f, 136},
+    {0x8018, 136},
+    {0x801f, 136},
+    {0x8029, 136},
+    {0xc038, 136},
+    {0x8003, 146},
+    {0x8006, 146},
+    {0x800a, 146},
+    {0x800f, 146},
+    {0x8018, 146},
+    {0x801f, 146},
+    {0x8029, 146},
+    {0xc038, 146},
+  },
+  /* 126 */
+  {
+    {0x8001, 154},
+    {0xc016, 154},
+    {0x8001, 156},
+    {0xc016, 156},
+    {0x8001, 160},
+    {0xc016, 160},
+    {0x8001, 163},
+    {0xc016, 163},
+    {0x8001, 164},
+    {0xc016, 164},
+    {0x8001, 169},
+    {0xc016, 169},
+    {0x8001, 170},
+    {0xc016, 170},
+    {0x8001, 173},
+    {0xc016, 173},
+  },
+  /* 127 */
+  {
+    {0x8002, 154},
+    {0x8009, 154},
+    {0x8017, 154},
+    {0xc028, 154},
+    {0x8002, 156},
+    {0x8009, 156},
+    {0x8017, 156},
+    {0xc028, 156},
+    {0x8002, 160},
+    {0x8009, 160},
+    {0x8017, 160},
+    {0xc028, 160},
+    {0x8002, 163},
+    {0x8009, 163},
+    {0x8017, 163},
+    {0xc028, 163},
+  },
+  /* 128 */
+  {
+    {0x8003, 154},
+    {0x8006, 154},
+    {0x800a, 154},
+    {0x800f, 154},
+    {0x8018, 154},
+    {0x801f, 154},
+    {0x8029, 154},
+    {0xc038, 154},
+    {0x8003, 156},
+    {0x8006, 156},
+    {0x800a, 156},
+    {0x800f, 156},
+    {0x8018, 156},
+    {0x801f, 156},
+    {0x8029, 156},
+    {0xc038, 156},
+  },
+  /* 129 */
+  {
+    {0x8003, 160},
+    {0x8006, 160},
+    {0x800a, 160},
+    {0x800f, 160},
+    {0x8018, 160},
+    {0x801f, 160},
+    {0x8029, 160},
+    {0xc038, 160},
+    {0x8003, 163},
+    {0x8006, 163},
+    {0x800a, 163},
+    {0x800f, 163},
+    {0x8018, 163},
+    {0x801f, 163},
+    {0x8029, 163},
+    {0xc038, 163},
+  },
+  /* 130 */
+  {
+    {0x8002, 164},
+    {0x8009, 164},
+    {0x8017, 164},
+    {0xc028, 164},
+    {0x8002, 169},
+    {0x8009, 169},
+    {0x8017, 169},
+    {0xc028, 169},
+    {0x8002, 170},
+    {0x8009, 170},
+    {0x8017, 170},
+    {0xc028, 170},
+    {0x8002, 173},
+    {0x8009, 173},
+    {0x8017, 173},
+    {0xc028, 173},
+  },
+  /* 131 */
+  {
+    {0x8003, 164},
+    {0x8006, 164},
+    {0x800a, 164},
+    {0x800f, 164},
+    {0x8018, 164},
+    {0x801f, 164},
+    {0x8029, 164},
+    {0xc038, 164},
+    {0x8003, 169},
+    {0x8006, 169},
+    {0x800a, 169},
+    {0x800f, 169},
+    {0x8018, 169},
+    {0x801f, 169},
+    {0x8029, 169},
+    {0xc038, 169},
+  },
+  /* 132 */
+  {
+    {0x8003, 170},
+    {0x8006, 170},
+    {0x800a, 170},
+    {0x800f, 170},
+    {0x8018, 170},
+    {0x801f, 170},
+    {0x8029, 170},
+    {0xc038, 170},
+    {0x8003, 173},
+    {0x8006, 173},
+    {0x800a, 173},
+    {0x800f, 173},
+    {0x8018, 173},
+    {0x801f, 173},
+    {0x8029, 173},
+    {0xc038, 173},
+  },
+  /* 133 */
+  {
+    {0x89, 0},
+    {0x8a, 0},
+    {0x8c, 0},
+    {0x8d, 0},
+    {0x90, 0},
+    {0x91, 0},
+    {0x93, 0},
+    {0x96, 0},
+    {0x9c, 0},
+    {0x9f, 0},
+    {0xa3, 0},
+    {0xa6, 0},
+    {0xab, 0},
+    {0xae, 0},
+    {0xb5, 0},
+    {0xbe, 0},
+  },
+  /* 134 */
+  {
+    {0xc000, 178},
+    {0xc000, 181},
+    {0xc000, 185},
+    {0xc000, 186},
+    {0xc000, 187},
+    {0xc000, 189},
+    {0xc000, 190},
+    {0xc000, 196},
+    {0xc000, 198},
+    {0xc000, 228},
+    {0xc000, 232},
+    {0xc000, 233},
+    {0x94, 0},
+    {0x95, 0},
+    {0x97, 0},
+    {0x98, 0},
+  },
+  /* 135 */
+  {
+    {0x8001, 178},
+    {0xc016, 178},
+    {0x8001, 181},
+    {0xc016, 181},
+    {0x8001, 185},
+    {0xc016, 185},
+    {0x8001, 186},
+    {0xc016, 186},
+    {0x8001, 187},
+    {0xc016, 187},
+    {0x8001, 189},
+    {0xc016, 189},
+    {0x8001, 190},
+    {0xc016, 190},
+    {0x8001, 196},
+    {0xc016, 196},
+  },
+  /* 136 */
+  {
+    {0x8002, 178},
+    {0x8009, 178},
+    {0x8017, 178},
+    {0xc028, 178},
+    {0x8002, 181},
+    {0x8009, 181},
+    {0x8017, 181},
+    {0xc028, 181},
+    {0x8002, 185},
+    {0x8009, 185},
+    {0x8017, 185},
+    {0xc028, 185},
+    {0x8002, 186},
+    {0x8009, 186},
+    {0x8017, 186},
+    {0xc028, 186},
+  },
+  /* 137 */
+  {
+    {0x8003, 178},
+    {0x8006, 178},
+    {0x800a, 178},
+    {0x800f, 178},
+    {0x8018, 178},
+    {0x801f, 178},
+    {0x8029, 178},
+    {0xc038, 178},
+    {0x8003, 181},
+    {0x8006, 181},
+    {0x800a, 181},
+    {0x800f, 181},
+    {0x8018, 181},
+    {0x801f, 181},
+    {0x8029, 181},
+    {0xc038, 181},
+  },
+  /* 138 */
+  {
+    {0x8003, 185},
+    {0x8006, 185},
+    {0x800a, 185},
+    {0x800f, 185},
+    {0x8018, 185},
+    {0x801f, 185},
+    {0x8029, 185},
+    {0xc038, 185},
+    {0x8003, 186},
+    {0x8006, 186},
+    {0x800a, 186},
+    {0x800f, 186},
+    {0x8018, 186},
+    {0x801f, 186},
+    {0x8029, 186},
+    {0xc038, 186},
+  },
+  /* 139 */
+  {
+    {0x8002, 187},
+    {0x8009, 187},
+    {0x8017, 187},
+    {0xc028, 187},
+    {0x8002, 189},
+    {0x8009, 189},
+    {0x8017, 189},
+    {0xc028, 189},
+    {0x8002, 190},
+    {0x8009, 190},
+    {0x8017, 190},
+    {0xc028, 190},
+    {0x8002, 196},
+    {0x8009, 196},
+    {0x8017, 196},
+    {0xc028, 196},
+  },
+  /* 140 */
+  {
+    {0x8003, 187},
+    {0x8006, 187},
+    {0x800a, 187},
+    {0x800f, 187},
+    {0x8018, 187},
+    {0x801f, 187},
+    {0x8029, 187},
+    {0xc038, 187},
+    {0x8003, 189},
+    {0x8006, 189},
+    {0x800a, 189},
+    {0x800f, 189},
+    {0x8018, 189},
+    {0x801f, 189},
+    {0x8029, 189},
+    {0xc038, 189},
+  },
+  /* 141 */
+  {
+    {0x8003, 190},
+    {0x8006, 190},
+    {0x800a, 190},
+    {0x800f, 190},
+    {0x8018, 190},
+    {0x801f, 190},
+    {0x8029, 190},
+    {0xc038, 190},
+    {0x8003, 196},
+    {0x8006, 196},
+    {0x800a, 196},
+    {0x800f, 196},
+    {0x8018, 196},
+    {0x801f, 196},
+    {0x8029, 196},
+    {0xc038, 196},
+  },
+  /* 142 */
+  {
+    {0x8001, 198},
+    {0xc016, 198},
+    {0x8001, 228},
+    {0xc016, 228},
+    {0x8001, 232},
+    {0xc016, 232},
+    {0x8001, 233},
+    {0xc016, 233},
+    {0xc000, 1},
+    {0xc000, 135},
+    {0xc000, 137},
+    {0xc000, 138},
+    {0xc000, 139},
+    {0xc000, 140},
+    {0xc000, 141},
+    {0xc000, 143},
+  },
+  /* 143 */
+  {
+    {0x8002, 198},
+    {0x8009, 198},
+    {0x8017, 198},
+    {0xc028, 198},
+    {0x8002, 228},
+    {0x8009, 228},
+    {0x8017, 228},
+    {0xc028, 228},
+    {0x8002, 232},
+    {0x8009, 232},
+    {0x8017, 232},
+    {0xc028, 232},
+    {0x8002, 233},
+    {0x8009, 233},
+    {0x8017, 233},
+    {0xc028, 233},
+  },
+  /* 144 */
+  {
+    {0x8003, 198},
+    {0x8006, 198},
+    {0x800a, 198},
+    {0x800f, 198},
+    {0x8018, 198},
+    {0x801f, 198},
+    {0x8029, 198},
+    {0xc038, 198},
+    {0x8003, 228},
+    {0x8006, 228},
+    {0x800a, 228},
+    {0x800f, 228},
+    {0x8018, 228},
+    {0x801f, 228},
+    {0x8029, 228},
+    {0xc038, 228},
+  },
+  /* 145 */
+  {
+    {0x8003, 232},
+    {0x8006, 232},
+    {0x800a, 232},
+    {0x800f, 232},
+    {0x8018, 232},
+    {0x801f, 232},
+    {0x8029, 232},
+    {0xc038, 232},
+    {0x8003, 233},
+    {0x8006, 233},
+    {0x800a, 233},
+    {0x800f, 233},
+    {0x8018, 233},
+    {0x801f, 233},
+    {0x8029, 233},
+    {0xc038, 233},
+  },
+  /* 146 */
+  {
+    {0x8001, 1},
+    {0xc016, 1},
+    {0x8001, 135},
+    {0xc016, 135},
+    {0x8001, 137},
+    {0xc016, 137},
+    {0x8001, 138},
+    {0xc016, 138},
+    {0x8001, 139},
+    {0xc016, 139},
+    {0x8001, 140},
+    {0xc016, 140},
+    {0x8001, 141},
+    {0xc016, 141},
+    {0x8001, 143},
+    {0xc016, 143},
+  },
+  /* 147 */
+  {
+    {0x8002, 1},
+    {0x8009, 1},
+    {0x8017, 1},
+    {0xc028, 1},
+    {0x8002, 135},
+    {0x8009, 135},
+    {0x8017, 135},
+    {0xc028, 135},
+    {0x8002, 137},
+    {0x8009, 137},
+    {0x8017, 137},
+    {0xc028, 137},
+    {0x8002, 138},
+    {0x8009, 138},
+    {0x8017, 138},
+    {0xc028, 138},
+  },
+  /* 148 */
+  {
+    {0x8003, 1},
+    {0x8006, 1},
+    {0x800a, 1},
+    {0x800f, 1},
+    {0x8018, 1},
+    {0x801f, 1},
+    {0x8029, 1},
+    {0xc038, 1},
+    {0x8003, 135},
+    {0x8006, 135},
+    {0x800a, 135},
+    {0x800f, 135},
+    {0x8018, 135},
+    {0x801f, 135},
+    {0x8029, 135},
+    {0xc038, 135},
+  },
+  /* 149 */
+  {
+    {0x8003, 137},
+    {0x8006, 137},
+    {0x800a, 137},
+    {0x800f, 137},
+    {0x8018, 137},
+    {0x801f, 137},
+    {0x8029, 137},
+    {0xc038, 137},
+    {0x8003, 138},
+    {0x8006, 138},
+    {0x800a, 138},
+    {0x800f, 138},
+    {0x8018, 138},
+    {0x801f, 138},
+    {0x8029, 138},
+    {0xc038, 138},
+  },
+  /* 150 */
+  {
+    {0x8002, 139},
+    {0x8009, 139},
+    {0x8017, 139},
+    {0xc028, 139},
+    {0x8002, 140},
+    {0x8009, 140},
+    {0x8017, 140},
+    {0xc028, 140},
+    {0x8002, 141},
+    {0x8009, 141},
+    {0x8017, 141},
+    {0xc028, 141},
+    {0x8002, 143},
+    {0x8009, 143},
+    {0x8017, 143},
+    {0xc028, 143},
+  },
+  /* 151 */
+  {
+    {0x8003, 139},
+    {0x8006, 139},
+    {0x800a, 139},
+    {0x800f, 139},
+    {0x8018, 139},
+    {0x801f, 139},
+    {0x8029, 139},
+    {0xc038, 139},
+    {0x8003, 140},
+    {0x8006, 140},
+    {0x800a, 140},
+    {0x800f, 140},
+    {0x8018, 140},
+    {0x801f, 140},
+    {0x8029, 140},
+    {0xc038, 140},
+  },
+  /* 152 */
+  {
+    {0x8003, 141},
+    {0x8006, 141},
+    {0x800a, 141},
+    {0x800f, 141},
+    {0x8018, 141},
+    {0x801f, 141},
+    {0x8029, 141},
+    {0xc038, 141},
+    {0x8003, 143},
+    {0x8006, 143},
+    {0x800a, 143},
+    {0x800f, 143},
+    {0x8018, 143},
+    {0x801f, 143},
+    {0x8029, 143},
+    {0xc038, 143},
+  },
+  /* 153 */
+  {
+    {0x9d, 0},
+    {0x9e, 0},
+    {0xa0, 0},
+    {0xa1, 0},
+    {0xa4, 0},
+    {0xa5, 0},
+    {0xa7, 0},
+    {0xa8, 0},
+    {0xac, 0},
+    {0xad, 0},
+    {0xaf, 0},
+    {0xb1, 0},
+    {0xb6, 0},
+    {0xb9, 0},
+    {0xbf, 0},
+    {0xcf, 0},
+  },
+  /* 154 */
+  {
+    {0xc000, 147},
+    {0xc000, 149},
+    {0xc000, 150},
+    {0xc000, 151},
+    {0xc000, 152},
+    {0xc000, 155},
+    {0xc000, 157},
+    {0xc000, 158},
+    {0xc000, 165},
+    {0xc000, 166},
+    {0xc000, 168},
+    {0xc000, 174},
+    {0xc000, 175},
+    {0xc000, 180},
+    {0xc000, 182},
+    {0xc000, 183},
+  },
+  /* 155 */
+  {
+    {0x8001, 147},
+    {0xc016, 147},
+    {0x8001, 149},
+    {0xc016, 149},
+    {0x8001, 150},
+    {0xc016, 150},
+    {0x8001, 151},
+    {0xc016, 151},
+    {0x8001, 152},
+    {0xc016, 152},
+    {0x8001, 155},
+    {0xc016, 155},
+    {0x8001, 157},
+    {0xc016, 157},
+    {0x8001, 158},
+    {0xc016, 158},
+  },
+  /* 156 */
+  {
+    {0x8002, 147},
+    {0x8009, 147},
+    {0x8017, 147},
+    {0xc028, 147},
+    {0x8002, 149},
+    {0x8009, 149},
+    {0x8017, 149},
+    {0xc028, 149},
+    {0x8002, 150},
+    {0x8009, 150},
+    {0x8017, 150},
+    {0xc028, 150},
+    {0x8002, 151},
+    {0x8009, 151},
+    {0x8017, 151},
+    {0xc028, 151},
+  },
+  /* 157 */
+  {
+    {0x8003, 147},
+    {0x8006, 147},
+    {0x800a, 147},
+    {0x800f, 147},
+    {0x8018, 147},
+    {0x801f, 147},
+    {0x8029, 147},
+    {0xc038, 147},
+    {0x8003, 149},
+    {0x8006, 149},
+    {0x800a, 149},
+    {0x800f, 149},
+    {0x8018, 149},
+    {0x801f, 149},
+    {0x8029, 149},
+    {0xc038, 149},
+  },
+  /* 158 */
+  {
+    {0x8003, 150},
+    {0x8006, 150},
+    {0x800a, 150},
+    {0x800f, 150},
+    {0x8018, 150},
+    {0x801f, 150},
+    {0x8029, 150},
+    {0xc038, 150},
+    {0x8003, 151},
+    {0x8006, 151},
+    {0x800a, 151},
+    {0x800f, 151},
+    {0x8018, 151},
+    {0x801f, 151},
+    {0x8029, 151},
+    {0xc038, 151},
+  },
+  /* 159 */
+  {
+    {0x8002, 152},
+    {0x8009, 152},
+    {0x8017, 152},
+    {0xc028, 152},
+    {0x8002, 155},
+    {0x8009, 155},
+    {0x8017, 155},
+    {0xc028, 155},
+    {0x8002, 157},
+    {0x8009, 157},
+    {0x8017, 157},
+    {0xc028, 157},
+    {0x8002, 158},
+    {0x8009, 158},
+    {0x8017, 158},
+    {0xc028, 158},
+  },
+  /* 160 */
+  {
+    {0x8003, 152},
+    {0x8006, 152},
+    {0x800a, 152},
+    {0x800f, 152},
+    {0x8018, 152},
+    {0x801f, 152},
+    {0x8029, 152},
+    {0xc038, 152},
+    {0x8003, 155},
+    {0x8006, 155},
+    {0x800a, 155},
+    {0x800f, 155},
+    {0x8018, 155},
+    {0x801f, 155},
+    {0x8029, 155},
+    {0xc038, 155},
+  },
+  /* 161 */
+  {
+    {0x8003, 157},
+    {0x8006, 157},
+    {0x800a, 157},
+    {0x800f, 157},
+    {0x8018, 157},
+    {0x801f, 157},
+    {0x8029, 157},
+    {0xc038, 157},
+    {0x8003, 158},
+    {0x8006, 158},
+    {0x800a, 158},
+    {0x800f, 158},
+    {0x8018, 158},
+    {0x801f, 158},
+    {0x8029, 158},
+    {0xc038, 158},
+  },
+  /* 162 */
+  {
+    {0x8001, 165},
+    {0xc016, 165},
+    {0x8001, 166},
+    {0xc016, 166},
+    {0x8001, 168},
+    {0xc016, 168},
+    {0x8001, 174},
+    {0xc016, 174},
+    {0x8001, 175},
+    {0xc016, 175},
+    {0x8001, 180},
+    {0xc016, 180},
+    {0x8001, 182},
+    {0xc016, 182},
+    {0x8001, 183},
+    {0xc016, 183},
+  },
+  /* 163 */
+  {
+    {0x8002, 165},
+    {0x8009, 165},
+    {0x8017, 165},
+    {0xc028, 165},
+    {0x8002, 166},
+    {0x8009, 166},
+    {0x8017, 166},
+    {0xc028, 166},
+    {0x8002, 168},
+    {0x8009, 168},
+    {0x8017, 168},
+    {0xc028, 168},
+    {0x8002, 174},
+    {0x8009, 174},
+    {0x8017, 174},
+    {0xc028, 174},
+  },
+  /* 164 */
+  {
+    {0x8003, 165},
+    {0x8006, 165},
+    {0x800a, 165},
+    {0x800f, 165},
+    {0x8018, 165},
+    {0x801f, 165},
+    {0x8029, 165},
+    {0xc038, 165},
+    {0x8003, 166},
+    {0x8006, 166},
+    {0x800a, 166},
+    {0x800f, 166},
+    {0x8018, 166},
+    {0x801f, 166},
+    {0x8029, 166},
+    {0xc038, 166},
+  },
+  /* 165 */
+  {
+    {0x8003, 168},
+    {0x8006, 168},
+    {0x800a, 168},
+    {0x800f, 168},
+    {0x8018, 168},
+    {0x801f, 168},
+    {0x8029, 168},
+    {0xc038, 168},
+    {0x8003, 174},
+    {0x8006, 174},
+    {0x800a, 174},
+    {0x800f, 174},
+    {0x8018, 174},
+    {0x801f, 174},
+    {0x8029, 174},
+    {0xc038, 174},
+  },
+  /* 166 */
+  {
+    {0x8002, 175},
+    {0x8009, 175},
+    {0x8017, 175},
+    {0xc028, 175},
+    {0x8002, 180},
+    {0x8009, 180},
+    {0x8017, 180},
+    {0xc028, 180},
+    {0x8002, 182},
+    {0x8009, 182},
+    {0x8017, 182},
+    {0xc028, 182},
+    {0x8002, 183},
+    {0x8009, 183},
+    {0x8017, 183},
+    {0xc028, 183},
+  },
+  /* 167 */
+  {
+    {0x8003, 175},
+    {0x8006, 175},
+    {0x800a, 175},
+    {0x800f, 175},
+    {0x8018, 175},
+    {0x801f, 175},
+    {0x8029, 175},
+    {0xc038, 175},
+    {0x8003, 180},
+    {0x8006, 180},
+    {0x800a, 180},
+    {0x800f, 180},
+    {0x8018, 180},
+    {0x801f, 180},
+    {0x8029, 180},
+    {0xc038, 180},
+  },
+  /* 168 */
+  {
+    {0x8003, 182},
+    {0x8006, 182},
+    {0x800a, 182},
+    {0x800f, 182},
+    {0x8018, 182},
+    {0x801f, 182},
+    {0x8029, 182},
+    {0xc038, 182},
+    {0x8003, 183},
+    {0x8006, 183},
+    {0x800a, 183},
+    {0x800f, 183},
+    {0x8018, 183},
+    {0x801f, 183},
+    {0x8029, 183},
+    {0xc038, 183},
+  },
+  /* 169 */
+  {
+    {0xc000, 188},
+    {0xc000, 191},
+    {0xc000, 197},
+    {0xc000, 231},
+    {0xc000, 239},
+    {0xb0, 0},
+    {0xb2, 0},
+    {0xb3, 0},
+    {0xb7, 0},
+    {0xb8, 0},
+    {0xba, 0},
+    {0xbb, 0},
+    {0xc0, 0},
+    {0xc7, 0},
+    {0xd0, 0},
+    {0xdf, 0},
+  },
+  /* 170 */
+  {
+    {0x8001, 188},
+    {0xc016, 188},
+    {0x8001, 191},
+    {0xc016, 191},
+    {0x8001, 197},
+    {0xc016, 197},
+    {0x8001, 231},
+    {0xc016, 231},
+    {0x8001, 239},
+    {0xc016, 239},
+    {0xc000, 9},
+    {0xc000, 142},
+    {0xc000, 144},
+    {0xc000, 145},
+    {0xc000, 148},
+    {0xc000, 159},
+  },
+  /* 171 */
+  {
+    {0x8002, 188},
+    {0x8009, 188},
+    {0x8017, 188},
+    {0xc028, 188},
+    {0x8002, 191},
+    {0x8009, 191},
+    {0x8017, 191},
+    {0xc028, 191},
+    {0x8002, 197},
+    {0x8009, 197},
+    {0x8017, 197},
+    {0xc028, 197},
+    {0x8002, 231},
+    {0x8009, 231},
+    {0x8017, 231},
+    {0xc028, 231},
+  },
+  /* 172 */
+  {
+    {0x8003, 188},
+    {0x8006, 188},
+    {0x800a, 188},
+    {0x800f, 188},
+    {0x8018, 188},
+    {0x801f, 188},
+    {0x8029, 188},
+    {0xc038, 188},
+    {0x8003, 191},
+    {0x8006, 191},
+    {0x800a, 191},
+    {0x800f, 191},
+    {0x8018, 191},
+    {0x801f, 191},
+    {0x8029, 191},
+    {0xc038, 191},
+  },
+  /* 173 */
+  {
+    {0x8003, 197},
+    {0x8006, 197},
+    {0x800a, 197},
+    {0x800f, 197},
+    {0x8018, 197},
+    {0x801f, 197},
+    {0x8029, 197},
+    {0xc038, 197},
+    {0x8003, 231},
+    {0x8006, 231},
+    {0x800a, 231},
+    {0x800f, 231},
+    {0x8018, 231},
+    {0x801f, 231},
+    {0x8029, 231},
+    {0xc038, 231},
+  },
+  /* 174 */
+  {
+    {0x8002, 239},
+    {0x8009, 239},
+    {0x8017, 239},
+    {0xc028, 239},
+    {0x8001, 9},
+    {0xc016, 9},
+    {0x8001, 142},
+    {0xc016, 142},
+    {0x8001, 144},
+    {0xc016, 144},
+    {0x8001, 145},
+    {0xc016, 145},
+    {0x8001, 148},
+    {0xc016, 148},
+    {0x8001, 159},
+    {0xc016, 159},
+  },
+  /* 175 */
+  {
+    {0x8003, 239},
+    {0x8006, 239},
+    {0x800a, 239},
+    {0x800f, 239},
+    {0x8018, 239},
+    {0x801f, 239},
+    {0x8029, 239},
+    {0xc038, 239},
+    {0x8002, 9},
+    {0x8009, 9},
+    {0x8017, 9},
+    {0xc028, 9},
+    {0x8002, 142},
+    {0x8009, 142},
+    {0x8017, 142},
+    {0xc028, 142},
+  },
+  /* 176 */
+  {
+    {0x8003, 9},
+    {0x8006, 9},
+    {0x800a, 9},
+    {0x800f, 9},
+    {0x8018, 9},
+    {0x801f, 9},
+    {0x8029, 9},
+    {0xc038, 9},
+    {0x8003, 142},
+    {0x8006, 142},
+    {0x800a, 142},
+    {0x800f, 142},
+    {0x8018, 142},
+    {0x801f, 142},
+    {0x8029, 142},
+    {0xc038, 142},
+  },
+  /* 177 */
+  {
+    {0x8002, 144},
+    {0x8009, 144},
+    {0x8017, 144},
+    {0xc028, 144},
+    {0x8002, 145},
+    {0x8009, 145},
+    {0x8017, 145},
+    {0xc028, 145},
+    {0x8002, 148},
+    {0x8009, 148},
+    {0x8017, 148},
+    {0xc028, 148},
+    {0x8002, 159},
+    {0x8009, 159},
+    {0x8017, 159},
+    {0xc028, 159},
+  },
+  /* 178 */
+  {
+    {0x8003, 144},
+    {0x8006, 144},
+    {0x800a, 144},
+    {0x800f, 144},
+    {0x8018, 144},
+    {0x801f, 144},
+    {0x8029, 144},
+    {0xc038, 144},
+    {0x8003, 145},
+    {0x8006, 145},
+    {0x800a, 145},
+    {0x800f, 145},
+    {0x8018, 145},
+    {0x801f, 145},
+    {0x8029, 145},
+    {0xc038, 145},
+  },
+  /* 179 */
+  {
+    {0x8003, 148},
+    {0x8006, 148},
+    {0x800a, 148},
+    {0x800f, 148},
+    {0x8018, 148},
+    {0x801f, 148},
+    {0x8029, 148},
+    {0xc038, 148},
+    {0x8003, 159},
+    {0x8006, 159},
+    {0x800a, 159},
+    {0x800f, 159},
+    {0x8018, 159},
+    {0x801f, 159},
+    {0x8029, 159},
+    {0xc038, 159},
+  },
+  /* 180 */
+  {
+    {0xc000, 171},
+    {0xc000, 206},
+    {0xc000, 215},
+    {0xc000, 225},
+    {0xc000, 236},
+    {0xc000, 237},
+    {0xbc, 0},
+    {0xbd, 0},
+    {0xc1, 0},
+    {0xc4, 0},
+    {0xc8, 0},
+    {0xcb, 0},
+    {0xd1, 0},
+    {0xd8, 0},
+    {0xe0, 0},
+    {0xee, 0},
+  },
+  /* 181 */
+  {
+    {0x8001, 171},
+    {0xc016, 171},
+    {0x8001, 206},
+    {0xc016, 206},
+    {0x8001, 215},
+    {0xc016, 215},
+    {0x8001, 225},
+    {0xc016, 225},
+    {0x8001, 236},
+    {0xc016, 236},
+    {0x8001, 237},
+    {0xc016, 237},
+    {0xc000, 199},
+    {0xc000, 207},
+    {0xc000, 234},
+    {0xc000, 235},
+  },
+  /* 182 */
+  {
+    {0x8002, 171},
+    {0x8009, 171},
+    {0x8017, 171},
+    {0xc028, 171},
+    {0x8002, 206},
+    {0x8009, 206},
+    {0x8017, 206},
+    {0xc028, 206},
+    {0x8002, 215},
+    {0x8009, 215},
+    {0x8017, 215},
+    {0xc028, 215},
+    {0x8002, 225},
+    {0x8009, 225},
+    {0x8017, 225},
+    {0xc028, 225},
+  },
+  /* 183 */
+  {
+    {0x8003, 171},
+    {0x8006, 171},
+    {0x800a, 171},
+    {0x800f, 171},
+    {0x8018, 171},
+    {0x801f, 171},
+    {0x8029, 171},
+    {0xc038, 171},
+    {0x8003, 206},
+    {0x8006, 206},
+    {0x800a, 206},
+    {0x800f, 206},
+    {0x8018, 206},
+    {0x801f, 206},
+    {0x8029, 206},
+    {0xc038, 206},
+  },
+  /* 184 */
+  {
+    {0x8003, 215},
+    {0x8006, 215},
+    {0x800a, 215},
+    {0x800f, 215},
+    {0x8018, 215},
+    {0x801f, 215},
+    {0x8029, 215},
+    {0xc038, 215},
+    {0x8003, 225},
+    {0x8006, 225},
+    {0x800a, 225},
+    {0x800f, 225},
+    {0x8018, 225},
+    {0x801f, 225},
+    {0x8029, 225},
+    {0xc038, 225},
+  },
+  /* 185 */
+  {
+    {0x8002, 236},
+    {0x8009, 236},
+    {0x8017, 236},
+    {0xc028, 236},
+    {0x8002, 237},
+    {0x8009, 237},
+    {0x8017, 237},
+    {0xc028, 237},
+    {0x8001, 199},
+    {0xc016, 199},
+    {0x8001, 207},
+    {0xc016, 207},
+    {0x8001, 234},
+    {0xc016, 234},
+    {0x8001, 235},
+    {0xc016, 235},
+  },
+  /* 186 */
+  {
+    {0x8003, 236},
+    {0x8006, 236},
+    {0x800a, 236},
+    {0x800f, 236},
+    {0x8018, 236},
+    {0x801f, 236},
+    {0x8029, 236},
+    {0xc038, 236},
+    {0x8003, 237},
+    {0x8006, 237},
+    {0x800a, 237},
+    {0x800f, 237},
+    {0x8018, 237},
+    {0x801f, 237},
+    {0x8029, 237},
+    {0xc038, 237},
+  },
+  /* 187 */
+  {
+    {0x8002, 199},
+    {0x8009, 199},
+    {0x8017, 199},
+    {0xc028, 199},
+    {0x8002, 207},
+    {0x8009, 207},
+    {0x8017, 207},
+    {0xc028, 207},
+    {0x8002, 234},
+    {0x8009, 234},
+    {0x8017, 234},
+    {0xc028, 234},
+    {0x8002, 235},
+    {0x8009, 235},
+    {0x8017, 235},
+    {0xc028, 235},
+  },
+  /* 188 */
+  {
+    {0x8003, 199},
+    {0x8006, 199},
+    {0x800a, 199},
+    {0x800f, 199},
+    {0x8018, 199},
+    {0x801f, 199},
+    {0x8029, 199},
+    {0xc038, 199},
+    {0x8003, 207},
+    {0x8006, 207},
+    {0x800a, 207},
+    {0x800f, 207},
+    {0x8018, 207},
+    {0x801f, 207},
+    {0x8029, 207},
+    {0xc038, 207},
+  },
+  /* 189 */
+  {
+    {0x8003, 234},
+    {0x8006, 234},
+    {0x800a, 234},
+    {0x800f, 234},
+    {0x8018, 234},
+    {0x801f, 234},
+    {0x8029, 234},
+    {0xc038, 234},
+    {0x8003, 235},
+    {0x8006, 235},
+    {0x800a, 235},
+    {0x800f, 235},
+    {0x8018, 235},
+    {0x801f, 235},
+    {0x8029, 235},
+    {0xc038, 235},
+  },
+  /* 190 */
+  {
+    {0xc2, 0},
+    {0xc3, 0},
+    {0xc5, 0},
+    {0xc6, 0},
+    {0xc9, 0},
+    {0xca, 0},
+    {0xcc, 0},
+    {0xcd, 0},
+    {0xd2, 0},
+    {0xd5, 0},
+    {0xd9, 0},
+    {0xdc, 0},
+    {0xe1, 0},
+    {0xe7, 0},
+    {0xef, 0},
+    {0xf6, 0},
+  },
+  /* 191 */
+  {
+    {0xc000, 192},
+    {0xc000, 193},
+    {0xc000, 200},
+    {0xc000, 201},
+    {0xc000, 202},
+    {0xc000, 205},
+    {0xc000, 210},
+    {0xc000, 213},
+    {0xc000, 218},
+    {0xc000, 219},
+    {0xc000, 238},
+    {0xc000, 240},
+    {0xc000, 242},
+    {0xc000, 243},
+    {0xc000, 255},
+    {0xce, 0},
+  },
+  /* 192 */
+  {
+    {0x8001, 192},
+    {0xc016, 192},
+    {0x8001, 193},
+    {0xc016, 193},
+    {0x8001, 200},
+    {0xc016, 200},
+    {0x8001, 201},
+    {0xc016, 201},
+    {0x8001, 202},
+    {0xc016, 202},
+    {0x8001, 205},
+    {0xc016, 205},
+    {0x8001, 210},
+    {0xc016, 210},
+    {0x8001, 213},
+    {0xc016, 213},
+  },
+  /* 193 */
+  {
+    {0x8002, 192},
+    {0x8009, 192},
+    {0x8017, 192},
+    {0xc028, 192},
+    {0x8002, 193},
+    {0x8009, 193},
+    {0x8017, 193},
+    {0xc028, 193},
+    {0x8002, 200},
+    {0x8009, 200},
+    {0x8017, 200},
+    {0xc028, 200},
+    {0x8002, 201},
+    {0x8009, 201},
+    {0x8017, 201},
+    {0xc028, 201},
+  },
+  /* 194 */
+  {
+    {0x8003, 192},
+    {0x8006, 192},
+    {0x800a, 192},
+    {0x800f, 192},
+    {0x8018, 192},
+    {0x801f, 192},
+    {0x8029, 192},
+    {0xc038, 192},
+    {0x8003, 193},
+    {0x8006, 193},
+    {0x800a, 193},
+    {0x800f, 193},
+    {0x8018, 193},
+    {0x801f, 193},
+    {0x8029, 193},
+    {0xc038, 193},
+  },
+  /* 195 */
+  {
+    {0x8003, 200},
+    {0x8006, 200},
+    {0x800a, 200},
+    {0x800f, 200},
+    {0x8018, 200},
+    {0x801f, 200},
+    {0x8029, 200},
+    {0xc038, 200},
+    {0x8003, 201},
+    {0x8006, 201},
+    {0x800a, 201},
+    {0x800f, 201},
+    {0x8018, 201},
+    {0x801f, 201},
+    {0x8029, 201},
+    {0xc038, 201},
+  },
+  /* 196 */
+  {
+    {0x8002, 202},
+    {0x8009, 202},
+    {0x8017, 202},
+    {0xc028, 202},
+    {0x8002, 205},
+    {0x8009, 205},
+    {0x8017, 205},
+    {0xc028, 205},
+    {0x8002, 210},
+    {0x8009, 210},
+    {0x8017, 210},
+    {0xc028, 210},
+    {0x8002, 213},
+    {0x8009, 213},
+    {0x8017, 213},
+    {0xc028, 213},
+  },
+  /* 197 */
+  {
+    {0x8003, 202},
+    {0x8006, 202},
+    {0x800a, 202},
+    {0x800f, 202},
+    {0x8018, 202},
+    {0x801f, 202},
+    {0x8029, 202},
+    {0xc038, 202},
+    {0x8003, 205},
+    {0x8006, 205},
+    {0x800a, 205},
+    {0x800f, 205},
+    {0x8018, 205},
+    {0x801f, 205},
+    {0x8029, 205},
+    {0xc038, 205},
+  },
+  /* 198 */
+  {
+    {0x8003, 210},
+    {0x8006, 210},
+    {0x800a, 210},
+    {0x800f, 210},
+    {0x8018, 210},
+    {0x801f, 210},
+    {0x8029, 210},
+    {0xc038, 210},
+    {0x8003, 213},
+    {0x8006, 213},
+    {0x800a, 213},
+    {0x800f, 213},
+    {0x8018, 213},
+    {0x801f, 213},
+    {0x8029, 213},
+    {0xc038, 213},
+  },
+  /* 199 */
+  {
+    {0x8001, 218},
+    {0xc016, 218},
+    {0x8001, 219},
+    {0xc016, 219},
+    {0x8001, 238},
+    {0xc016, 238},
+    {0x8001, 240},
+    {0xc016, 240},
+    {0x8001, 242},
+    {0xc016, 242},
+    {0x8001, 243},
+    {0xc016, 243},
+    {0x8001, 255},
+    {0xc016, 255},
+    {0xc000, 203},
+    {0xc000, 204},
+  },
+  /* 200 */
+  {
+    {0x8002, 218},
+    {0x8009, 218},
+    {0x8017, 218},
+    {0xc028, 218},
+    {0x8002, 219},
+    {0x8009, 219},
+    {0x8017, 219},
+    {0xc028, 219},
+    {0x8002, 238},
+    {0x8009, 238},
+    {0x8017, 238},
+    {0xc028, 238},
+    {0x8002, 240},
+    {0x8009, 240},
+    {0x8017, 240},
+    {0xc028, 240},
+  },
+  /* 201 */
+  {
+    {0x8003, 218},
+    {0x8006, 218},
+    {0x800a, 218},
+    {0x800f, 218},
+    {0x8018, 218},
+    {0x801f, 218},
+    {0x8029, 218},
+    {0xc038, 218},
+    {0x8003, 219},
+    {0x8006, 219},
+    {0x800a, 219},
+    {0x800f, 219},
+    {0x8018, 219},
+    {0x801f, 219},
+    {0x8029, 219},
+    {0xc038, 219},
+  },
+  /* 202 */
+  {
+    {0x8003, 238},
+    {0x8006, 238},
+    {0x800a, 238},
+    {0x800f, 238},
+    {0x8018, 238},
+    {0x801f, 238},
+    {0x8029, 238},
+    {0xc038, 238},
+    {0x8003, 240},
+    {0x8006, 240},
+    {0x800a, 240},
+    {0x800f, 240},
+    {0x8018, 240},
+    {0x801f, 240},
+    {0x8029, 240},
+    {0xc038, 240},
+  },
+  /* 203 */
+  {
+    {0x8002, 242},
+    {0x8009, 242},
+    {0x8017, 242},
+    {0xc028, 242},
+    {0x8002, 243},
+    {0x8009, 243},
+    {0x8017, 243},
+    {0xc028, 243},
+    {0x8002, 255},
+    {0x8009, 255},
+    {0x8017, 255},
+    {0xc028, 255},
+    {0x8001, 203},
+    {0xc016, 203},
+    {0x8001, 204},
+    {0xc016, 204},
+  },
+  /* 204 */
+  {
+    {0x8003, 242},
+    {0x8006, 242},
+    {0x800a, 242},
+    {0x800f, 242},
+    {0x8018, 242},
+    {0x801f, 242},
+    {0x8029, 242},
+    {0xc038, 242},
+    {0x8003, 243},
+    {0x8006, 243},
+    {0x800a, 243},
+    {0x800f, 243},
+    {0x8018, 243},
+    {0x801f, 243},
+    {0x8029, 243},
+    {0xc038, 243},
+  },
+  /* 205 */
+  {
+    {0x8003, 255},
+    {0x8006, 255},
+    {0x800a, 255},
+    {0x800f, 255},
+    {0x8018, 255},
+    {0x801f, 255},
+    {0x8029, 255},
+    {0xc038, 255},
+    {0x8002, 203},
+    {0x8009, 203},
+    {0x8017, 203},
+    {0xc028, 203},
+    {0x8002, 204},
+    {0x8009, 204},
+    {0x8017, 204},
+    {0xc028, 204},
+  },
+  /* 206 */
+  {
+    {0x8003, 203},
+    {0x8006, 203},
+    {0x800a, 203},
+    {0x800f, 203},
+    {0x8018, 203},
+    {0x801f, 203},
+    {0x8029, 203},
+    {0xc038, 203},
+    {0x8003, 204},
+    {0x8006, 204},
+    {0x800a, 204},
+    {0x800f, 204},
+    {0x8018, 204},
+    {0x801f, 204},
+    {0x8029, 204},
+    {0xc038, 204},
+  },
+  /* 207 */
+  {
+    {0xd3, 0},
+    {0xd4, 0},
+    {0xd6, 0},
+    {0xd7, 0},
+    {0xda, 0},
+    {0xdb, 0},
+    {0xdd, 0},
+    {0xde, 0},
+    {0xe2, 0},
+    {0xe4, 0},
+    {0xe8, 0},
+    {0xeb, 0},
+    {0xf0, 0},
+    {0xf3, 0},
+    {0xf7, 0},
+    {0xfa, 0},
+  },
+  /* 208 */
+  {
+    {0xc000, 211},
+    {0xc000, 212},
+    {0xc000, 214},
+    {0xc000, 221},
+    {0xc000, 222},
+    {0xc000, 223},
+    {0xc000, 241},
+    {0xc000, 244},
+    {0xc000, 245},
+    {0xc000, 246},
+    {0xc000, 247},
+    {0xc000, 248},
+    {0xc000, 250},
+    {0xc000, 251},
+    {0xc000, 252},
+    {0xc000, 253},
+  },
+  /* 209 */
+  {
+    {0x8001, 211},
+    {0xc016, 211},
+    {0x8001, 212},
+    {0xc016, 212},
+    {0x8001, 214},
+    {0xc016, 214},
+    {0x8001, 221},
+    {0xc016, 221},
+    {0x8001, 222},
+    {0xc016, 222},
+    {0x8001, 223},
+    {0xc016, 223},
+    {0x8001, 241},
+    {0xc016, 241},
+    {0x8001, 244},
+    {0xc016, 244},
+  },
+  /* 210 */
+  {
+    {0x8002, 211},
+    {0x8009, 211},
+    {0x8017, 211},
+    {0xc028, 211},
+    {0x8002, 212},
+    {0x8009, 212},
+    {0x8017, 212},
+    {0xc028, 212},
+    {0x8002, 214},
+    {0x8009, 214},
+    {0x8017, 214},
+    {0xc028, 214},
+    {0x8002, 221},
+    {0x8009, 221},
+    {0x8017, 221},
+    {0xc028, 221},
+  },
+  /* 211 */
+  {
+    {0x8003, 211},
+    {0x8006, 211},
+    {0x800a, 211},
+    {0x800f, 211},
+    {0x8018, 211},
+    {0x801f, 211},
+    {0x8029, 211},
+    {0xc038, 211},
+    {0x8003, 212},
+    {0x8006, 212},
+    {0x800a, 212},
+    {0x800f, 212},
+    {0x8018, 212},
+    {0x801f, 212},
+    {0x8029, 212},
+    {0xc038, 212},
+  },
+  /* 212 */
+  {
+    {0x8003, 214},
+    {0x8006, 214},
+    {0x800a, 214},
+    {0x800f, 214},
+    {0x8018, 214},
+    {0x801f, 214},
+    {0x8029, 214},
+    {0xc038, 214},
+    {0x8003, 221},
+    {0x8006, 221},
+    {0x800a, 221},
+    {0x800f, 221},
+    {0x8018, 221},
+    {0x801f, 221},
+    {0x8029, 221},
+    {0xc038, 221},
+  },
+  /* 213 */
+  {
+    {0x8002, 222},
+    {0x8009, 222},
+    {0x8017, 222},
+    {0xc028, 222},
+    {0x8002, 223},
+    {0x8009, 223},
+    {0x8017, 223},
+    {0xc028, 223},
+    {0x8002, 241},
+    {0x8009, 241},
+    {0x8017, 241},
+    {0xc028, 241},
+    {0x8002, 244},
+    {0x8009, 244},
+    {0x8017, 244},
+    {0xc028, 244},
+  },
+  /* 214 */
+  {
+    {0x8003, 222},
+    {0x8006, 222},
+    {0x800a, 222},
+    {0x800f, 222},
+    {0x8018, 222},
+    {0x801f, 222},
+    {0x8029, 222},
+    {0xc038, 222},
+    {0x8003, 223},
+    {0x8006, 223},
+    {0x800a, 223},
+    {0x800f, 223},
+    {0x8018, 223},
+    {0x801f, 223},
+    {0x8029, 223},
+    {0xc038, 223},
+  },
+  /* 215 */
+  {
+    {0x8003, 241},
+    {0x8006, 241},
+    {0x800a, 241},
+    {0x800f, 241},
+    {0x8018, 241},
+    {0x801f, 241},
+    {0x8029, 241},
+    {0xc038, 241},
+    {0x8003, 244},
+    {0x8006, 244},
+    {0x800a, 244},
+    {0x800f, 244},
+    {0x8018, 244},
+    {0x801f, 244},
+    {0x8029, 244},
+    {0xc038, 244},
+  },
+  /* 216 */
+  {
+    {0x8001, 245},
+    {0xc016, 245},
+    {0x8001, 246},
+    {0xc016, 246},
+    {0x8001, 247},
+    {0xc016, 247},
+    {0x8001, 248},
+    {0xc016, 248},
+    {0x8001, 250},
+    {0xc016, 250},
+    {0x8001, 251},
+    {0xc016, 251},
+    {0x8001, 252},
+    {0xc016, 252},
+    {0x8001, 253},
+    {0xc016, 253},
+  },
+  /* 217 */
+  {
+    {0x8002, 245},
+    {0x8009, 245},
+    {0x8017, 245},
+    {0xc028, 245},
+    {0x8002, 246},
+    {0x8009, 246},
+    {0x8017, 246},
+    {0xc028, 246},
+    {0x8002, 247},
+    {0x8009, 247},
+    {0x8017, 247},
+    {0xc028, 247},
+    {0x8002, 248},
+    {0x8009, 248},
+    {0x8017, 248},
+    {0xc028, 248},
+  },
+  /* 218 */
+  {
+    {0x8003, 245},
+    {0x8006, 245},
+    {0x800a, 245},
+    {0x800f, 245},
+    {0x8018, 245},
+    {0x801f, 245},
+    {0x8029, 245},
+    {0xc038, 245},
+    {0x8003, 246},
+    {0x8006, 246},
+    {0x800a, 246},
+    {0x800f, 246},
+    {0x8018, 246},
+    {0x801f, 246},
+    {0x8029, 246},
+    {0xc038, 246},
+  },
+  /* 219 */
+  {
+    {0x8003, 247},
+    {0x8006, 247},
+    {0x800a, 247},
+    {0x800f, 247},
+    {0x8018, 247},
+    {0x801f, 247},
+    {0x8029, 247},
+    {0xc038, 247},
+    {0x8003, 248},
+    {0x8006, 248},
+    {0x800a, 248},
+    {0x800f, 248},
+    {0x8018, 248},
+    {0x801f, 248},
+    {0x8029, 248},
+    {0xc038, 248},
+  },
+  /* 220 */
+  {
+    {0x8002, 250},
+    {0x8009, 250},
+    {0x8017, 250},
+    {0xc028, 250},
+    {0x8002, 251},
+    {0x8009, 251},
+    {0x8017, 251},
+    {0xc028, 251},
+    {0x8002, 252},
+    {0x8009, 252},
+    {0x8017, 252},
+    {0xc028, 252},
+    {0x8002, 253},
+    {0x8009, 253},
+    {0x8017, 253},
+    {0xc028, 253},
+  },
+  /* 221 */
+  {
+    {0x8003, 250},
+    {0x8006, 250},
+    {0x800a, 250},
+    {0x800f, 250},
+    {0x8018, 250},
+    {0x801f, 250},
+    {0x8029, 250},
+    {0xc038, 250},
+    {0x8003, 251},
+    {0x8006, 251},
+    {0x800a, 251},
+    {0x800f, 251},
+    {0x8018, 251},
+    {0x801f, 251},
+    {0x8029, 251},
+    {0xc038, 251},
+  },
+  /* 222 */
+  {
+    {0x8003, 252},
+    {0x8006, 252},
+    {0x800a, 252},
+    {0x800f, 252},
+    {0x8018, 252},
+    {0x801f, 252},
+    {0x8029, 252},
+    {0xc038, 252},
+    {0x8003, 253},
+    {0x8006, 253},
+    {0x800a, 253},
+    {0x800f, 253},
+    {0x8018, 253},
+    {0x801f, 253},
+    {0x8029, 253},
+    {0xc038, 253},
+  },
+  /* 223 */
+  {
+    {0xc000, 254},
+    {0xe3, 0},
+    {0xe5, 0},
+    {0xe6, 0},
+    {0xe9, 0},
+    {0xea, 0},
+    {0xec, 0},
+    {0xed, 0},
+    {0xf1, 0},
+    {0xf2, 0},
+    {0xf4, 0},
+    {0xf5, 0},
+    {0xf8, 0},
+    {0xf9, 0},
+    {0xfb, 0},
+    {0xfc, 0},
+  },
+  /* 224 */
+  {
+    {0x8001, 254},
+    {0xc016, 254},
+    {0xc000, 2},
+    {0xc000, 3},
+    {0xc000, 4},
+    {0xc000, 5},
+    {0xc000, 6},
+    {0xc000, 7},
+    {0xc000, 8},
+    {0xc000, 11},
+    {0xc000, 12},
+    {0xc000, 14},
+    {0xc000, 15},
+    {0xc000, 16},
+    {0xc000, 17},
+    {0xc000, 18},
+  },
+  /* 225 */
+  {
+    {0x8002, 254},
+    {0x8009, 254},
+    {0x8017, 254},
+    {0xc028, 254},
+    {0x8001, 2},
+    {0xc016, 2},
+    {0x8001, 3},
+    {0xc016, 3},
+    {0x8001, 4},
+    {0xc016, 4},
+    {0x8001, 5},
+    {0xc016, 5},
+    {0x8001, 6},
+    {0xc016, 6},
+    {0x8001, 7},
+    {0xc016, 7},
+  },
+  /* 226 */
+  {
+    {0x8003, 254},
+    {0x8006, 254},
+    {0x800a, 254},
+    {0x800f, 254},
+    {0x8018, 254},
+    {0x801f, 254},
+    {0x8029, 254},
+    {0xc038, 254},
+    {0x8002, 2},
+    {0x8009, 2},
+    {0x8017, 2},
+    {0xc028, 2},
+    {0x8002, 3},
+    {0x8009, 3},
+    {0x8017, 3},
+    {0xc028, 3},
+  },
+  /* 227 */
+  {
+    {0x8003, 2},
+    {0x8006, 2},
+    {0x800a, 2},
+    {0x800f, 2},
+    {0x8018, 2},
+    {0x801f, 2},
+    {0x8029, 2},
+    {0xc038, 2},
+    {0x8003, 3},
+    {0x8006, 3},
+    {0x800a, 3},
+    {0x800f, 3},
+    {0x8018, 3},
+    {0x801f, 3},
+    {0x8029, 3},
+    {0xc038, 3},
+  },
+  /* 228 */
+  {
+    {0x8002, 4},
+    {0x8009, 4},
+    {0x8017, 4},
+    {0xc028, 4},
+    {0x8002, 5},
+    {0x8009, 5},
+    {0x8017, 5},
+    {0xc028, 5},
+    {0x8002, 6},
+    {0x8009, 6},
+    {0x8017, 6},
+    {0xc028, 6},
+    {0x8002, 7},
+    {0x8009, 7},
+    {0x8017, 7},
+    {0xc028, 7},
+  },
+  /* 229 */
+  {
+    {0x8003, 4},
+    {0x8006, 4},
+    {0x800a, 4},
+    {0x800f, 4},
+    {0x8018, 4},
+    {0x801f, 4},
+    {0x8029, 4},
+    {0xc038, 4},
+    {0x8003, 5},
+    {0x8006, 5},
+    {0x800a, 5},
+    {0x800f, 5},
+    {0x8018, 5},
+    {0x801f, 5},
+    {0x8029, 5},
+    {0xc038, 5},
+  },
+  /* 230 */
+  {
+    {0x8003, 6},
+    {0x8006, 6},
+    {0x800a, 6},
+    {0x800f, 6},
+    {0x8018, 6},
+    {0x801f, 6},
+    {0x8029, 6},
+    {0xc038, 6},
+    {0x8003, 7},
+    {0x8006, 7},
+    {0x800a, 7},
+    {0x800f, 7},
+    {0x8018, 7},
+    {0x801f, 7},
+    {0x8029, 7},
+    {0xc038, 7},
+  },
+  /* 231 */
+  {
+    {0x8001, 8},
+    {0xc016, 8},
+    {0x8001, 11},
+    {0xc016, 11},
+    {0x8001, 12},
+    {0xc016, 12},
+    {0x8001, 14},
+    {0xc016, 14},
+    {0x8001, 15},
+    {0xc016, 15},
+    {0x8001, 16},
+    {0xc016, 16},
+    {0x8001, 17},
+    {0xc016, 17},
+    {0x8001, 18},
+    {0xc016, 18},
+  },
+  /* 232 */
+  {
+    {0x8002, 8},
+    {0x8009, 8},
+    {0x8017, 8},
+    {0xc028, 8},
+    {0x8002, 11},
+    {0x8009, 11},
+    {0x8017, 11},
+    {0xc028, 11},
+    {0x8002, 12},
+    {0x8009, 12},
+    {0x8017, 12},
+    {0xc028, 12},
+    {0x8002, 14},
+    {0x8009, 14},
+    {0x8017, 14},
+    {0xc028, 14},
+  },
+  /* 233 */
+  {
+    {0x8003, 8},
+    {0x8006, 8},
+    {0x800a, 8},
+    {0x800f, 8},
+    {0x8018, 8},
+    {0x801f, 8},
+    {0x8029, 8},
+    {0xc038, 8},
+    {0x8003, 11},
+    {0x8006, 11},
+    {0x800a, 11},
+    {0x800f, 11},
+    {0x8018, 11},
+    {0x801f, 11},
+    {0x8029, 11},
+    {0xc038, 11},
+  },
+  /* 234 */
+  {
+    {0x8003, 12},
+    {0x8006, 12},
+    {0x800a, 12},
+    {0x800f, 12},
+    {0x8018, 12},
+    {0x801f, 12},
+    {0x8029, 12},
+    {0xc038, 12},
+    {0x8003, 14},
+    {0x8006, 14},
+    {0x800a, 14},
+    {0x800f, 14},
+    {0x8018, 14},
+    {0x801f, 14},
+    {0x8029, 14},
+    {0xc038, 14},
+  },
+  /* 235 */
+  {
+    {0x8002, 15},
+    {0x8009, 15},
+    {0x8017, 15},
+    {0xc028, 15},
+    {0x8002, 16},
+    {0x8009, 16},
+    {0x8017, 16},
+    {0xc028, 16},
+    {0x8002, 17},
+    {0x8009, 17},
+    {0x8017, 17},
+    {0xc028, 17},
+    {0x8002, 18},
+    {0x8009, 18},
+    {0x8017, 18},
+    {0xc028, 18},
+  },
+  /* 236 */
+  {
+    {0x8003, 15},
+    {0x8006, 15},
+    {0x800a, 15},
+    {0x800f, 15},
+    {0x8018, 15},
+    {0x801f, 15},
+    {0x8029, 15},
+    {0xc038, 15},
+    {0x8003, 16},
+    {0x8006, 16},
+    {0x800a, 16},
+    {0x800f, 16},
+    {0x8018, 16},
+    {0x801f, 16},
+    {0x8029, 16},
+    {0xc038, 16},
+  },
+  /* 237 */
+  {
+    {0x8003, 17},
+    {0x8006, 17},
+    {0x800a, 17},
+    {0x800f, 17},
+    {0x8018, 17},
+    {0x801f, 17},
+    {0x8029, 17},
+    {0xc038, 17},
+    {0x8003, 18},
+    {0x8006, 18},
+    {0x800a, 18},
+    {0x800f, 18},
+    {0x8018, 18},
+    {0x801f, 18},
+    {0x8029, 18},
+    {0xc038, 18},
+  },
+  /* 238 */
+  {
+    {0xc000, 19},
+    {0xc000, 20},
+    {0xc000, 21},
+    {0xc000, 23},
+    {0xc000, 24},
+    {0xc000, 25},
+    {0xc000, 26},
+    {0xc000, 27},
+    {0xc000, 28},
+    {0xc000, 29},
+    {0xc000, 30},
+    {0xc000, 31},
+    {0xc000, 127},
+    {0xc000, 220},
+    {0xc000, 249},
+    {0xfd, 0},
+  },
+  /* 239 */
+  {
+    {0x8001, 19},
+    {0xc016, 19},
+    {0x8001, 20},
+    {0xc016, 20},
+    {0x8001, 21},
+    {0xc016, 21},
+    {0x8001, 23},
+    {0xc016, 23},
+    {0x8001, 24},
+    {0xc016, 24},
+    {0x8001, 25},
+    {0xc016, 25},
+    {0x8001, 26},
+    {0xc016, 26},
+    {0x8001, 27},
+    {0xc016, 27},
+  },
+  /* 240 */
+  {
+    {0x8002, 19},
+    {0x8009, 19},
+    {0x8017, 19},
+    {0xc028, 19},
+    {0x8002, 20},
+    {0x8009, 20},
+    {0x8017, 20},
+    {0xc028, 20},
+    {0x8002, 21},
+    {0x8009, 21},
+    {0x8017, 21},
+    {0xc028, 21},
+    {0x8002, 23},
+    {0x8009, 23},
+    {0x8017, 23},
+    {0xc028, 23},
+  },
+  /* 241 */
+  {
+    {0x8003, 19},
+    {0x8006, 19},
+    {0x800a, 19},
+    {0x800f, 19},
+    {0x8018, 19},
+    {0x801f, 19},
+    {0x8029, 19},
+    {0xc038, 19},
+    {0x8003, 20},
+    {0x8006, 20},
+    {0x800a, 20},
+    {0x800f, 20},
+    {0x8018, 20},
+    {0x801f, 20},
+    {0x8029, 20},
+    {0xc038, 20},
+  },
+  /* 242 */
+  {
+    {0x8003, 21},
+    {0x8006, 21},
+    {0x800a, 21},
+    {0x800f, 21},
+    {0x8018, 21},
+    {0x801f, 21},
+    {0x8029, 21},
+    {0xc038, 21},
+    {0x8003, 23},
+    {0x8006, 23},
+    {0x800a, 23},
+    {0x800f, 23},
+    {0x8018, 23},
+    {0x801f, 23},
+    {0x8029, 23},
+    {0xc038, 23},
+  },
+  /* 243 */
+  {
+    {0x8002, 24},
+    {0x8009, 24},
+    {0x8017, 24},
+    {0xc028, 24},
+    {0x8002, 25},
+    {0x8009, 25},
+    {0x8017, 25},
+    {0xc028, 25},
+    {0x8002, 26},
+    {0x8009, 26},
+    {0x8017, 26},
+    {0xc028, 26},
+    {0x8002, 27},
+    {0x8009, 27},
+    {0x8017, 27},
+    {0xc028, 27},
+  },
+  /* 244 */
+  {
+    {0x8003, 24},
+    {0x8006, 24},
+    {0x800a, 24},
+    {0x800f, 24},
+    {0x8018, 24},
+    {0x801f, 24},
+    {0x8029, 24},
+    {0xc038, 24},
+    {0x8003, 25},
+    {0x8006, 25},
+    {0x800a, 25},
+    {0x800f, 25},
+    {0x8018, 25},
+    {0x801f, 25},
+    {0x8029, 25},
+    {0xc038, 25},
+  },
+  /* 245 */
+  {
+    {0x8003, 26},
+    {0x8006, 26},
+    {0x800a, 26},
+    {0x800f, 26},
+    {0x8018, 26},
+    {0x801f, 26},
+    {0x8029, 26},
+    {0xc038, 26},
+    {0x8003, 27},
+    {0x8006, 27},
+    {0x800a, 27},
+    {0x800f, 27},
+    {0x8018, 27},
+    {0x801f, 27},
+    {0x8029, 27},
+    {0xc038, 27},
+  },
+  /* 246 */
+  {
+    {0x8001, 28},
+    {0xc016, 28},
+    {0x8001, 29},
+    {0xc016, 29},
+    {0x8001, 30},
+    {0xc016, 30},
+    {0x8001, 31},
+    {0xc016, 31},
+    {0x8001, 127},
+    {0xc016, 127},
+    {0x8001, 220},
+    {0xc016, 220},
+    {0x8001, 249},
+    {0xc016, 249},
+    {0xfe, 0},
+    {0xff, 0},
+  },
+  /* 247 */
+  {
+    {0x8002, 28},
+    {0x8009, 28},
+    {0x8017, 28},
+    {0xc028, 28},
+    {0x8002, 29},
+    {0x8009, 29},
+    {0x8017, 29},
+    {0xc028, 29},
+    {0x8002, 30},
+    {0x8009, 30},
+    {0x8017, 30},
+    {0xc028, 30},
+    {0x8002, 31},
+    {0x8009, 31},
+    {0x8017, 31},
+    {0xc028, 31},
+  },
+  /* 248 */
+  {
+    {0x8003, 28},
+    {0x8006, 28},
+    {0x800a, 28},
+    {0x800f, 28},
+    {0x8018, 28},
+    {0x801f, 28},
+    {0x8029, 28},
+    {0xc038, 28},
+    {0x8003, 29},
+    {0x8006, 29},
+    {0x800a, 29},
+    {0x800f, 29},
+    {0x8018, 29},
+    {0x801f, 29},
+    {0x8029, 29},
+    {0xc038, 29},
+  },
+  /* 249 */
+  {
+    {0x8003, 30},
+    {0x8006, 30},
+    {0x800a, 30},
+    {0x800f, 30},
+    {0x8018, 30},
+    {0x801f, 30},
+    {0x8029, 30},
+    {0xc038, 30},
+    {0x8003, 31},
+    {0x8006, 31},
+    {0x800a, 31},
+    {0x800f, 31},
+    {0x8018, 31},
+    {0x801f, 31},
+    {0x8029, 31},
+    {0xc038, 31},
+  },
+  /* 250 */
+  {
+    {0x8002, 127},
+    {0x8009, 127},
+    {0x8017, 127},
+    {0xc028, 127},
+    {0x8002, 220},
+    {0x8009, 220},
+    {0x8017, 220},
+    {0xc028, 220},
+    {0x8002, 249},
+    {0x8009, 249},
+    {0x8017, 249},
+    {0xc028, 249},
+    {0xc000, 10},
+    {0xc000, 13},
+    {0xc000, 22},
+    {0x100, 0},
+  },
+  /* 251 */
+  {
+    {0x8003, 127},
+    {0x8006, 127},
+    {0x800a, 127},
+    {0x800f, 127},
+    {0x8018, 127},
+    {0x801f, 127},
+    {0x8029, 127},
+    {0xc038, 127},
+    {0x8003, 220},
+    {0x8006, 220},
+    {0x800a, 220},
+    {0x800f, 220},
+    {0x8018, 220},
+    {0x801f, 220},
+    {0x8029, 220},
+    {0xc038, 220},
+  },
+  /* 252 */
+  {
+    {0x8003, 249},
+    {0x8006, 249},
+    {0x800a, 249},
+    {0x800f, 249},
+    {0x8018, 249},
+    {0x801f, 249},
+    {0x8029, 249},
+    {0xc038, 249},
+    {0x8001, 10},
+    {0xc016, 10},
+    {0x8001, 13},
+    {0xc016, 13},
+    {0x8001, 22},
+    {0xc016, 22},
+    {0x100, 0},
+    {0x100, 0},
+  },
+  /* 253 */
+  {
+    {0x8002, 10},
+    {0x8009, 10},
+    {0x8017, 10},
+    {0xc028, 10},
+    {0x8002, 13},
+    {0x8009, 13},
+    {0x8017, 13},
+    {0xc028, 13},
+    {0x8002, 22},
+    {0x8009, 22},
+    {0x8017, 22},
+    {0xc028, 22},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+  },
+  /* 254 */
+  {
+    {0x8003, 10},
+    {0x8006, 10},
+    {0x800a, 10},
+    {0x800f, 10},
+    {0x8018, 10},
+    {0x801f, 10},
+    {0x8029, 10},
+    {0xc038, 10},
+    {0x8003, 13},
+    {0x8006, 13},
+    {0x800a, 13},
+    {0x800f, 13},
+    {0x8018, 13},
+    {0x801f, 13},
+    {0x8029, 13},
+    {0xc038, 13},
+  },
+  /* 255 */
+  {
+    {0x8003, 22},
+    {0x8006, 22},
+    {0x800a, 22},
+    {0x800f, 22},
+    {0x8018, 22},
+    {0x801f, 22},
+    {0x8029, 22},
+    {0xc038, 22},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+  },
+  /* 256 */
+  {
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+    {0x100, 0},
+  },
 };

+ 389 - 387
Utilities/cmnghttp2/lib/nghttp2_helper.c

@@ -53,70 +53,70 @@ uint32_t nghttp2_get_uint32(const uint8_t *data) {
 
 /* Generated by gendowncasetbl.py */
 static const uint8_t DOWNCASE_TBL[] = {
-    0 /* NUL  */,   1 /* SOH  */,   2 /* STX  */,   3 /* ETX  */,
-    4 /* EOT  */,   5 /* ENQ  */,   6 /* ACK  */,   7 /* BEL  */,
-    8 /* BS   */,   9 /* HT   */,   10 /* LF   */,  11 /* VT   */,
-    12 /* FF   */,  13 /* CR   */,  14 /* SO   */,  15 /* SI   */,
-    16 /* DLE  */,  17 /* DC1  */,  18 /* DC2  */,  19 /* DC3  */,
-    20 /* DC4  */,  21 /* NAK  */,  22 /* SYN  */,  23 /* ETB  */,
-    24 /* CAN  */,  25 /* EM   */,  26 /* SUB  */,  27 /* ESC  */,
-    28 /* FS   */,  29 /* GS   */,  30 /* RS   */,  31 /* US   */,
-    32 /* SPC  */,  33 /* !    */,  34 /* "    */,  35 /* #    */,
-    36 /* $    */,  37 /* %    */,  38 /* &    */,  39 /* '    */,
-    40 /* (    */,  41 /* )    */,  42 /* *    */,  43 /* +    */,
-    44 /* ,    */,  45 /* -    */,  46 /* .    */,  47 /* /    */,
-    48 /* 0    */,  49 /* 1    */,  50 /* 2    */,  51 /* 3    */,
-    52 /* 4    */,  53 /* 5    */,  54 /* 6    */,  55 /* 7    */,
-    56 /* 8    */,  57 /* 9    */,  58 /* :    */,  59 /* ;    */,
-    60 /* <    */,  61 /* =    */,  62 /* >    */,  63 /* ?    */,
-    64 /* @    */,  97 /* A    */,  98 /* B    */,  99 /* C    */,
-    100 /* D    */, 101 /* E    */, 102 /* F    */, 103 /* G    */,
-    104 /* H    */, 105 /* I    */, 106 /* J    */, 107 /* K    */,
-    108 /* L    */, 109 /* M    */, 110 /* N    */, 111 /* O    */,
-    112 /* P    */, 113 /* Q    */, 114 /* R    */, 115 /* S    */,
-    116 /* T    */, 117 /* U    */, 118 /* V    */, 119 /* W    */,
-    120 /* X    */, 121 /* Y    */, 122 /* Z    */, 91 /* [    */,
-    92 /* \    */,  93 /* ]    */,  94 /* ^    */,  95 /* _    */,
-    96 /* `    */,  97 /* a    */,  98 /* b    */,  99 /* c    */,
-    100 /* d    */, 101 /* e    */, 102 /* f    */, 103 /* g    */,
-    104 /* h    */, 105 /* i    */, 106 /* j    */, 107 /* k    */,
-    108 /* l    */, 109 /* m    */, 110 /* n    */, 111 /* o    */,
-    112 /* p    */, 113 /* q    */, 114 /* r    */, 115 /* s    */,
-    116 /* t    */, 117 /* u    */, 118 /* v    */, 119 /* w    */,
-    120 /* x    */, 121 /* y    */, 122 /* z    */, 123 /* {    */,
-    124 /* |    */, 125 /* }    */, 126 /* ~    */, 127 /* DEL  */,
-    128 /* 0x80 */, 129 /* 0x81 */, 130 /* 0x82 */, 131 /* 0x83 */,
-    132 /* 0x84 */, 133 /* 0x85 */, 134 /* 0x86 */, 135 /* 0x87 */,
-    136 /* 0x88 */, 137 /* 0x89 */, 138 /* 0x8a */, 139 /* 0x8b */,
-    140 /* 0x8c */, 141 /* 0x8d */, 142 /* 0x8e */, 143 /* 0x8f */,
-    144 /* 0x90 */, 145 /* 0x91 */, 146 /* 0x92 */, 147 /* 0x93 */,
-    148 /* 0x94 */, 149 /* 0x95 */, 150 /* 0x96 */, 151 /* 0x97 */,
-    152 /* 0x98 */, 153 /* 0x99 */, 154 /* 0x9a */, 155 /* 0x9b */,
-    156 /* 0x9c */, 157 /* 0x9d */, 158 /* 0x9e */, 159 /* 0x9f */,
-    160 /* 0xa0 */, 161 /* 0xa1 */, 162 /* 0xa2 */, 163 /* 0xa3 */,
-    164 /* 0xa4 */, 165 /* 0xa5 */, 166 /* 0xa6 */, 167 /* 0xa7 */,
-    168 /* 0xa8 */, 169 /* 0xa9 */, 170 /* 0xaa */, 171 /* 0xab */,
-    172 /* 0xac */, 173 /* 0xad */, 174 /* 0xae */, 175 /* 0xaf */,
-    176 /* 0xb0 */, 177 /* 0xb1 */, 178 /* 0xb2 */, 179 /* 0xb3 */,
-    180 /* 0xb4 */, 181 /* 0xb5 */, 182 /* 0xb6 */, 183 /* 0xb7 */,
-    184 /* 0xb8 */, 185 /* 0xb9 */, 186 /* 0xba */, 187 /* 0xbb */,
-    188 /* 0xbc */, 189 /* 0xbd */, 190 /* 0xbe */, 191 /* 0xbf */,
-    192 /* 0xc0 */, 193 /* 0xc1 */, 194 /* 0xc2 */, 195 /* 0xc3 */,
-    196 /* 0xc4 */, 197 /* 0xc5 */, 198 /* 0xc6 */, 199 /* 0xc7 */,
-    200 /* 0xc8 */, 201 /* 0xc9 */, 202 /* 0xca */, 203 /* 0xcb */,
-    204 /* 0xcc */, 205 /* 0xcd */, 206 /* 0xce */, 207 /* 0xcf */,
-    208 /* 0xd0 */, 209 /* 0xd1 */, 210 /* 0xd2 */, 211 /* 0xd3 */,
-    212 /* 0xd4 */, 213 /* 0xd5 */, 214 /* 0xd6 */, 215 /* 0xd7 */,
-    216 /* 0xd8 */, 217 /* 0xd9 */, 218 /* 0xda */, 219 /* 0xdb */,
-    220 /* 0xdc */, 221 /* 0xdd */, 222 /* 0xde */, 223 /* 0xdf */,
-    224 /* 0xe0 */, 225 /* 0xe1 */, 226 /* 0xe2 */, 227 /* 0xe3 */,
-    228 /* 0xe4 */, 229 /* 0xe5 */, 230 /* 0xe6 */, 231 /* 0xe7 */,
-    232 /* 0xe8 */, 233 /* 0xe9 */, 234 /* 0xea */, 235 /* 0xeb */,
-    236 /* 0xec */, 237 /* 0xed */, 238 /* 0xee */, 239 /* 0xef */,
-    240 /* 0xf0 */, 241 /* 0xf1 */, 242 /* 0xf2 */, 243 /* 0xf3 */,
-    244 /* 0xf4 */, 245 /* 0xf5 */, 246 /* 0xf6 */, 247 /* 0xf7 */,
-    248 /* 0xf8 */, 249 /* 0xf9 */, 250 /* 0xfa */, 251 /* 0xfb */,
-    252 /* 0xfc */, 253 /* 0xfd */, 254 /* 0xfe */, 255 /* 0xff */,
+  0 /* NUL  */,   1 /* SOH  */,   2 /* STX  */,   3 /* ETX  */,
+  4 /* EOT  */,   5 /* ENQ  */,   6 /* ACK  */,   7 /* BEL  */,
+  8 /* BS   */,   9 /* HT   */,   10 /* LF   */,  11 /* VT   */,
+  12 /* FF   */,  13 /* CR   */,  14 /* SO   */,  15 /* SI   */,
+  16 /* DLE  */,  17 /* DC1  */,  18 /* DC2  */,  19 /* DC3  */,
+  20 /* DC4  */,  21 /* NAK  */,  22 /* SYN  */,  23 /* ETB  */,
+  24 /* CAN  */,  25 /* EM   */,  26 /* SUB  */,  27 /* ESC  */,
+  28 /* FS   */,  29 /* GS   */,  30 /* RS   */,  31 /* US   */,
+  32 /* SPC  */,  33 /* !    */,  34 /* "    */,  35 /* #    */,
+  36 /* $    */,  37 /* %    */,  38 /* &    */,  39 /* '    */,
+  40 /* (    */,  41 /* )    */,  42 /* *    */,  43 /* +    */,
+  44 /* ,    */,  45 /* -    */,  46 /* .    */,  47 /* /    */,
+  48 /* 0    */,  49 /* 1    */,  50 /* 2    */,  51 /* 3    */,
+  52 /* 4    */,  53 /* 5    */,  54 /* 6    */,  55 /* 7    */,
+  56 /* 8    */,  57 /* 9    */,  58 /* :    */,  59 /* ;    */,
+  60 /* <    */,  61 /* =    */,  62 /* >    */,  63 /* ?    */,
+  64 /* @    */,  97 /* A    */,  98 /* B    */,  99 /* C    */,
+  100 /* D    */, 101 /* E    */, 102 /* F    */, 103 /* G    */,
+  104 /* H    */, 105 /* I    */, 106 /* J    */, 107 /* K    */,
+  108 /* L    */, 109 /* M    */, 110 /* N    */, 111 /* O    */,
+  112 /* P    */, 113 /* Q    */, 114 /* R    */, 115 /* S    */,
+  116 /* T    */, 117 /* U    */, 118 /* V    */, 119 /* W    */,
+  120 /* X    */, 121 /* Y    */, 122 /* Z    */, 91 /* [    */,
+  92 /* \    */,  93 /* ]    */,  94 /* ^    */,  95 /* _    */,
+  96 /* `    */,  97 /* a    */,  98 /* b    */,  99 /* c    */,
+  100 /* d    */, 101 /* e    */, 102 /* f    */, 103 /* g    */,
+  104 /* h    */, 105 /* i    */, 106 /* j    */, 107 /* k    */,
+  108 /* l    */, 109 /* m    */, 110 /* n    */, 111 /* o    */,
+  112 /* p    */, 113 /* q    */, 114 /* r    */, 115 /* s    */,
+  116 /* t    */, 117 /* u    */, 118 /* v    */, 119 /* w    */,
+  120 /* x    */, 121 /* y    */, 122 /* z    */, 123 /* {    */,
+  124 /* |    */, 125 /* }    */, 126 /* ~    */, 127 /* DEL  */,
+  128 /* 0x80 */, 129 /* 0x81 */, 130 /* 0x82 */, 131 /* 0x83 */,
+  132 /* 0x84 */, 133 /* 0x85 */, 134 /* 0x86 */, 135 /* 0x87 */,
+  136 /* 0x88 */, 137 /* 0x89 */, 138 /* 0x8a */, 139 /* 0x8b */,
+  140 /* 0x8c */, 141 /* 0x8d */, 142 /* 0x8e */, 143 /* 0x8f */,
+  144 /* 0x90 */, 145 /* 0x91 */, 146 /* 0x92 */, 147 /* 0x93 */,
+  148 /* 0x94 */, 149 /* 0x95 */, 150 /* 0x96 */, 151 /* 0x97 */,
+  152 /* 0x98 */, 153 /* 0x99 */, 154 /* 0x9a */, 155 /* 0x9b */,
+  156 /* 0x9c */, 157 /* 0x9d */, 158 /* 0x9e */, 159 /* 0x9f */,
+  160 /* 0xa0 */, 161 /* 0xa1 */, 162 /* 0xa2 */, 163 /* 0xa3 */,
+  164 /* 0xa4 */, 165 /* 0xa5 */, 166 /* 0xa6 */, 167 /* 0xa7 */,
+  168 /* 0xa8 */, 169 /* 0xa9 */, 170 /* 0xaa */, 171 /* 0xab */,
+  172 /* 0xac */, 173 /* 0xad */, 174 /* 0xae */, 175 /* 0xaf */,
+  176 /* 0xb0 */, 177 /* 0xb1 */, 178 /* 0xb2 */, 179 /* 0xb3 */,
+  180 /* 0xb4 */, 181 /* 0xb5 */, 182 /* 0xb6 */, 183 /* 0xb7 */,
+  184 /* 0xb8 */, 185 /* 0xb9 */, 186 /* 0xba */, 187 /* 0xbb */,
+  188 /* 0xbc */, 189 /* 0xbd */, 190 /* 0xbe */, 191 /* 0xbf */,
+  192 /* 0xc0 */, 193 /* 0xc1 */, 194 /* 0xc2 */, 195 /* 0xc3 */,
+  196 /* 0xc4 */, 197 /* 0xc5 */, 198 /* 0xc6 */, 199 /* 0xc7 */,
+  200 /* 0xc8 */, 201 /* 0xc9 */, 202 /* 0xca */, 203 /* 0xcb */,
+  204 /* 0xcc */, 205 /* 0xcd */, 206 /* 0xce */, 207 /* 0xcf */,
+  208 /* 0xd0 */, 209 /* 0xd1 */, 210 /* 0xd2 */, 211 /* 0xd3 */,
+  212 /* 0xd4 */, 213 /* 0xd5 */, 214 /* 0xd6 */, 215 /* 0xd7 */,
+  216 /* 0xd8 */, 217 /* 0xd9 */, 218 /* 0xda */, 219 /* 0xdb */,
+  220 /* 0xdc */, 221 /* 0xdd */, 222 /* 0xde */, 223 /* 0xdf */,
+  224 /* 0xe0 */, 225 /* 0xe1 */, 226 /* 0xe2 */, 227 /* 0xe3 */,
+  228 /* 0xe4 */, 229 /* 0xe5 */, 230 /* 0xe6 */, 231 /* 0xe7 */,
+  232 /* 0xe8 */, 233 /* 0xe9 */, 234 /* 0xea */, 235 /* 0xeb */,
+  236 /* 0xec */, 237 /* 0xed */, 238 /* 0xee */, 239 /* 0xef */,
+  240 /* 0xf0 */, 241 /* 0xf1 */, 242 /* 0xf2 */, 243 /* 0xf3 */,
+  244 /* 0xf4 */, 245 /* 0xf5 */, 246 /* 0xf6 */, 247 /* 0xf7 */,
+  248 /* 0xf8 */, 249 /* 0xf9 */, 250 /* 0xfa */, 251 /* 0xfb */,
+  252 /* 0xfc */, 253 /* 0xfd */, 254 /* 0xfe */, 255 /* 0xff */,
 };
 
 void nghttp2_downcase(uint8_t *s, size_t len) {
@@ -160,7 +160,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr,
     int32_t recv_reduction_delta;
     int32_t delta;
     int32_t new_recv_window_size =
-        nghttp2_max(0, *recv_window_size_ptr) - *delta_ptr;
+      nghttp2_max_int32(0, *recv_window_size_ptr) - *delta_ptr;
 
     if (new_recv_window_size >= 0) {
       *recv_window_size_ptr = new_recv_window_size;
@@ -177,7 +177,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr,
     *local_window_size_ptr += delta;
     /* If there is recv_reduction due to earlier window_size
        reduction, we have to adjust it too. */
-    recv_reduction_delta = nghttp2_min(*recv_reduction_ptr, delta);
+    recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta);
     *recv_reduction_ptr -= recv_reduction_delta;
     if (*recv_window_size_ptr < 0) {
       *recv_window_size_ptr += recv_reduction_delta;
@@ -233,7 +233,7 @@ int nghttp2_increase_local_window_size(int32_t *local_window_size_ptr,
   *local_window_size_ptr += delta;
   /* If there is recv_reduction due to earlier window_size
      reduction, we have to adjust it too. */
-  recv_reduction_delta = nghttp2_min(*recv_reduction_ptr, delta);
+  recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta);
   *recv_reduction_ptr -= recv_reduction_delta;
 
   *recv_window_size_ptr += recv_reduction_delta;
@@ -336,6 +336,8 @@ const char *nghttp2_strerror(int error_code) {
            "closed";
   case NGHTTP2_ERR_TOO_MANY_SETTINGS:
     return "SETTINGS frame contained more than the maximum allowed entries";
+  case NGHTTP2_ERR_TOO_MANY_CONTINUATIONS:
+    return "Too many CONTINUATION frames following a HEADER frame";
   default:
     return "Unknown error code";
   }
@@ -343,70 +345,70 @@ const char *nghttp2_strerror(int error_code) {
 
 /* Generated by gennmchartbl.py */
 static const int VALID_HD_NAME_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
-    0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
-    0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
-    0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
-    0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
-    0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
-    0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
-    0 /* SPC  */, 1 /* !    */, 0 /* "    */, 1 /* #    */,
-    1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    0 /* (    */, 0 /* )    */, 1 /* *    */, 1 /* +    */,
-    0 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
-    1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
-    1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
-    1 /* 8    */, 1 /* 9    */, 0 /* :    */, 0 /* ;    */,
-    0 /* <    */, 0 /* =    */, 0 /* >    */, 0 /* ?    */,
-    0 /* @    */, 0 /* A    */, 0 /* B    */, 0 /* C    */,
-    0 /* D    */, 0 /* E    */, 0 /* F    */, 0 /* G    */,
-    0 /* H    */, 0 /* I    */, 0 /* J    */, 0 /* K    */,
-    0 /* L    */, 0 /* M    */, 0 /* N    */, 0 /* O    */,
-    0 /* P    */, 0 /* Q    */, 0 /* R    */, 0 /* S    */,
-    0 /* T    */, 0 /* U    */, 0 /* V    */, 0 /* W    */,
-    0 /* X    */, 0 /* Y    */, 0 /* Z    */, 0 /* [    */,
-    0 /* \    */, 0 /* ]    */, 1 /* ^    */, 1 /* _    */,
-    1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
-    1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
-    1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
-    1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
-    1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
-    1 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
-    0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
-    0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
-    0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
-    0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
-    0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
-    0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
-    0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
-    0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
-    0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
-    0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
-    0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
-    0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
-    0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
-    0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
-    0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
-    0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
-    0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
-    0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
-    0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
-    0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
-    0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
-    0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
-    0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
-    0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
-    0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
-    0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
+  0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
+  0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
+  0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
+  0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
+  0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
+  0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
+  0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
+  0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
+  0 /* SPC  */, 1 /* !    */, 0 /* "    */, 1 /* #    */,
+  1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
+  0 /* (    */, 0 /* )    */, 1 /* *    */, 1 /* +    */,
+  0 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
+  1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
+  1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
+  1 /* 8    */, 1 /* 9    */, 0 /* :    */, 0 /* ;    */,
+  0 /* <    */, 0 /* =    */, 0 /* >    */, 0 /* ?    */,
+  0 /* @    */, 0 /* A    */, 0 /* B    */, 0 /* C    */,
+  0 /* D    */, 0 /* E    */, 0 /* F    */, 0 /* G    */,
+  0 /* H    */, 0 /* I    */, 0 /* J    */, 0 /* K    */,
+  0 /* L    */, 0 /* M    */, 0 /* N    */, 0 /* O    */,
+  0 /* P    */, 0 /* Q    */, 0 /* R    */, 0 /* S    */,
+  0 /* T    */, 0 /* U    */, 0 /* V    */, 0 /* W    */,
+  0 /* X    */, 0 /* Y    */, 0 /* Z    */, 0 /* [    */,
+  0 /* \    */, 0 /* ]    */, 1 /* ^    */, 1 /* _    */,
+  1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
+  1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
+  1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
+  1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
+  1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
+  1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
+  1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
+  1 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
+  0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
+  0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
+  0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
+  0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
+  0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
+  0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
+  0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
+  0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
+  0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
+  0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
+  0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
+  0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
+  0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
+  0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
+  0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
+  0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
+  0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
+  0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
+  0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
+  0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
+  0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
+  0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
+  0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
+  0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
+  0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
+  0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
+  0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
+  0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
+  0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
+  0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
+  0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
+  0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
 };
 
 int nghttp2_check_header_name(const uint8_t *name, size_t len) {
@@ -431,70 +433,70 @@ int nghttp2_check_header_name(const uint8_t *name, size_t len) {
 
 /* Generated by genvchartbl.py */
 static const int VALID_HD_VALUE_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
-    0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
-    0 /* BS   */, 1 /* HT   */, 0 /* LF   */, 0 /* VT   */,
-    0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
-    0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
-    0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
-    0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
-    1 /* SPC  */, 1 /* !    */, 1 /* "    */, 1 /* #    */,
-    1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
-    1 /* ,    */, 1 /* -    */, 1 /* .    */, 1 /* /    */,
-    1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
-    1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
-    1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
-    1 /* <    */, 1 /* =    */, 1 /* >    */, 1 /* ?    */,
-    1 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
-    1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
-    1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
-    1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
-    1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
-    1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
-    1 /* \    */, 1 /* ]    */, 1 /* ^    */, 1 /* _    */,
-    1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
-    1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
-    1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
-    1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
-    1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 1 /* {    */,
-    1 /* |    */, 1 /* }    */, 1 /* ~    */, 0 /* DEL  */,
-    1 /* 0x80 */, 1 /* 0x81 */, 1 /* 0x82 */, 1 /* 0x83 */,
-    1 /* 0x84 */, 1 /* 0x85 */, 1 /* 0x86 */, 1 /* 0x87 */,
-    1 /* 0x88 */, 1 /* 0x89 */, 1 /* 0x8a */, 1 /* 0x8b */,
-    1 /* 0x8c */, 1 /* 0x8d */, 1 /* 0x8e */, 1 /* 0x8f */,
-    1 /* 0x90 */, 1 /* 0x91 */, 1 /* 0x92 */, 1 /* 0x93 */,
-    1 /* 0x94 */, 1 /* 0x95 */, 1 /* 0x96 */, 1 /* 0x97 */,
-    1 /* 0x98 */, 1 /* 0x99 */, 1 /* 0x9a */, 1 /* 0x9b */,
-    1 /* 0x9c */, 1 /* 0x9d */, 1 /* 0x9e */, 1 /* 0x9f */,
-    1 /* 0xa0 */, 1 /* 0xa1 */, 1 /* 0xa2 */, 1 /* 0xa3 */,
-    1 /* 0xa4 */, 1 /* 0xa5 */, 1 /* 0xa6 */, 1 /* 0xa7 */,
-    1 /* 0xa8 */, 1 /* 0xa9 */, 1 /* 0xaa */, 1 /* 0xab */,
-    1 /* 0xac */, 1 /* 0xad */, 1 /* 0xae */, 1 /* 0xaf */,
-    1 /* 0xb0 */, 1 /* 0xb1 */, 1 /* 0xb2 */, 1 /* 0xb3 */,
-    1 /* 0xb4 */, 1 /* 0xb5 */, 1 /* 0xb6 */, 1 /* 0xb7 */,
-    1 /* 0xb8 */, 1 /* 0xb9 */, 1 /* 0xba */, 1 /* 0xbb */,
-    1 /* 0xbc */, 1 /* 0xbd */, 1 /* 0xbe */, 1 /* 0xbf */,
-    1 /* 0xc0 */, 1 /* 0xc1 */, 1 /* 0xc2 */, 1 /* 0xc3 */,
-    1 /* 0xc4 */, 1 /* 0xc5 */, 1 /* 0xc6 */, 1 /* 0xc7 */,
-    1 /* 0xc8 */, 1 /* 0xc9 */, 1 /* 0xca */, 1 /* 0xcb */,
-    1 /* 0xcc */, 1 /* 0xcd */, 1 /* 0xce */, 1 /* 0xcf */,
-    1 /* 0xd0 */, 1 /* 0xd1 */, 1 /* 0xd2 */, 1 /* 0xd3 */,
-    1 /* 0xd4 */, 1 /* 0xd5 */, 1 /* 0xd6 */, 1 /* 0xd7 */,
-    1 /* 0xd8 */, 1 /* 0xd9 */, 1 /* 0xda */, 1 /* 0xdb */,
-    1 /* 0xdc */, 1 /* 0xdd */, 1 /* 0xde */, 1 /* 0xdf */,
-    1 /* 0xe0 */, 1 /* 0xe1 */, 1 /* 0xe2 */, 1 /* 0xe3 */,
-    1 /* 0xe4 */, 1 /* 0xe5 */, 1 /* 0xe6 */, 1 /* 0xe7 */,
-    1 /* 0xe8 */, 1 /* 0xe9 */, 1 /* 0xea */, 1 /* 0xeb */,
-    1 /* 0xec */, 1 /* 0xed */, 1 /* 0xee */, 1 /* 0xef */,
-    1 /* 0xf0 */, 1 /* 0xf1 */, 1 /* 0xf2 */, 1 /* 0xf3 */,
-    1 /* 0xf4 */, 1 /* 0xf5 */, 1 /* 0xf6 */, 1 /* 0xf7 */,
-    1 /* 0xf8 */, 1 /* 0xf9 */, 1 /* 0xfa */, 1 /* 0xfb */,
-    1 /* 0xfc */, 1 /* 0xfd */, 1 /* 0xfe */, 1 /* 0xff */
+  0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
+  0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
+  0 /* BS   */, 1 /* HT   */, 0 /* LF   */, 0 /* VT   */,
+  0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
+  0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
+  0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
+  0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
+  0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
+  1 /* SPC  */, 1 /* !    */, 1 /* "    */, 1 /* #    */,
+  1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
+  1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
+  1 /* ,    */, 1 /* -    */, 1 /* .    */, 1 /* /    */,
+  1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
+  1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
+  1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
+  1 /* <    */, 1 /* =    */, 1 /* >    */, 1 /* ?    */,
+  1 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
+  1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
+  1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
+  1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
+  1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
+  1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
+  1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
+  1 /* \    */, 1 /* ]    */, 1 /* ^    */, 1 /* _    */,
+  1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
+  1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
+  1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
+  1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
+  1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
+  1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
+  1 /* x    */, 1 /* y    */, 1 /* z    */, 1 /* {    */,
+  1 /* |    */, 1 /* }    */, 1 /* ~    */, 0 /* DEL  */,
+  1 /* 0x80 */, 1 /* 0x81 */, 1 /* 0x82 */, 1 /* 0x83 */,
+  1 /* 0x84 */, 1 /* 0x85 */, 1 /* 0x86 */, 1 /* 0x87 */,
+  1 /* 0x88 */, 1 /* 0x89 */, 1 /* 0x8a */, 1 /* 0x8b */,
+  1 /* 0x8c */, 1 /* 0x8d */, 1 /* 0x8e */, 1 /* 0x8f */,
+  1 /* 0x90 */, 1 /* 0x91 */, 1 /* 0x92 */, 1 /* 0x93 */,
+  1 /* 0x94 */, 1 /* 0x95 */, 1 /* 0x96 */, 1 /* 0x97 */,
+  1 /* 0x98 */, 1 /* 0x99 */, 1 /* 0x9a */, 1 /* 0x9b */,
+  1 /* 0x9c */, 1 /* 0x9d */, 1 /* 0x9e */, 1 /* 0x9f */,
+  1 /* 0xa0 */, 1 /* 0xa1 */, 1 /* 0xa2 */, 1 /* 0xa3 */,
+  1 /* 0xa4 */, 1 /* 0xa5 */, 1 /* 0xa6 */, 1 /* 0xa7 */,
+  1 /* 0xa8 */, 1 /* 0xa9 */, 1 /* 0xaa */, 1 /* 0xab */,
+  1 /* 0xac */, 1 /* 0xad */, 1 /* 0xae */, 1 /* 0xaf */,
+  1 /* 0xb0 */, 1 /* 0xb1 */, 1 /* 0xb2 */, 1 /* 0xb3 */,
+  1 /* 0xb4 */, 1 /* 0xb5 */, 1 /* 0xb6 */, 1 /* 0xb7 */,
+  1 /* 0xb8 */, 1 /* 0xb9 */, 1 /* 0xba */, 1 /* 0xbb */,
+  1 /* 0xbc */, 1 /* 0xbd */, 1 /* 0xbe */, 1 /* 0xbf */,
+  1 /* 0xc0 */, 1 /* 0xc1 */, 1 /* 0xc2 */, 1 /* 0xc3 */,
+  1 /* 0xc4 */, 1 /* 0xc5 */, 1 /* 0xc6 */, 1 /* 0xc7 */,
+  1 /* 0xc8 */, 1 /* 0xc9 */, 1 /* 0xca */, 1 /* 0xcb */,
+  1 /* 0xcc */, 1 /* 0xcd */, 1 /* 0xce */, 1 /* 0xcf */,
+  1 /* 0xd0 */, 1 /* 0xd1 */, 1 /* 0xd2 */, 1 /* 0xd3 */,
+  1 /* 0xd4 */, 1 /* 0xd5 */, 1 /* 0xd6 */, 1 /* 0xd7 */,
+  1 /* 0xd8 */, 1 /* 0xd9 */, 1 /* 0xda */, 1 /* 0xdb */,
+  1 /* 0xdc */, 1 /* 0xdd */, 1 /* 0xde */, 1 /* 0xdf */,
+  1 /* 0xe0 */, 1 /* 0xe1 */, 1 /* 0xe2 */, 1 /* 0xe3 */,
+  1 /* 0xe4 */, 1 /* 0xe5 */, 1 /* 0xe6 */, 1 /* 0xe7 */,
+  1 /* 0xe8 */, 1 /* 0xe9 */, 1 /* 0xea */, 1 /* 0xeb */,
+  1 /* 0xec */, 1 /* 0xed */, 1 /* 0xee */, 1 /* 0xef */,
+  1 /* 0xf0 */, 1 /* 0xf1 */, 1 /* 0xf2 */, 1 /* 0xf3 */,
+  1 /* 0xf4 */, 1 /* 0xf5 */, 1 /* 0xf6 */, 1 /* 0xf7 */,
+  1 /* 0xf8 */, 1 /* 0xf9 */, 1 /* 0xfa */, 1 /* 0xfb */,
+  1 /* 0xfc */, 1 /* 0xfd */, 1 /* 0xfe */, 1 /* 0xff */
 };
 
 int nghttp2_check_header_value(const uint8_t *value, size_t len) {
@@ -522,70 +524,70 @@ int nghttp2_check_header_value_rfc9113(const uint8_t *value, size_t len) {
 
 /* Generated by genmethodchartbl.py */
 static char VALID_METHOD_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
-    0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
-    0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
-    0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
-    0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
-    0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
-    0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
-    0 /* SPC  */, 1 /* !    */, 0 /* "    */, 1 /* #    */,
-    1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    0 /* (    */, 0 /* )    */, 1 /* *    */, 1 /* +    */,
-    0 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
-    1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
-    1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
-    1 /* 8    */, 1 /* 9    */, 0 /* :    */, 0 /* ;    */,
-    0 /* <    */, 0 /* =    */, 0 /* >    */, 0 /* ?    */,
-    0 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
-    1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
-    1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
-    1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
-    1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
-    1 /* X    */, 1 /* Y    */, 1 /* Z    */, 0 /* [    */,
-    0 /* \    */, 0 /* ]    */, 1 /* ^    */, 1 /* _    */,
-    1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
-    1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
-    1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
-    1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
-    1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
-    1 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
-    0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
-    0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
-    0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
-    0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
-    0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
-    0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
-    0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
-    0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
-    0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
-    0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
-    0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
-    0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
-    0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
-    0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
-    0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
-    0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
-    0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
-    0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
-    0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
-    0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
-    0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
-    0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
-    0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
-    0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
-    0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
-    0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
+  0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
+  0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
+  0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
+  0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
+  0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
+  0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
+  0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
+  0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
+  0 /* SPC  */, 1 /* !    */, 0 /* "    */, 1 /* #    */,
+  1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
+  0 /* (    */, 0 /* )    */, 1 /* *    */, 1 /* +    */,
+  0 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
+  1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
+  1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
+  1 /* 8    */, 1 /* 9    */, 0 /* :    */, 0 /* ;    */,
+  0 /* <    */, 0 /* =    */, 0 /* >    */, 0 /* ?    */,
+  0 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
+  1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
+  1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
+  1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
+  1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
+  1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
+  1 /* X    */, 1 /* Y    */, 1 /* Z    */, 0 /* [    */,
+  0 /* \    */, 0 /* ]    */, 1 /* ^    */, 1 /* _    */,
+  1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
+  1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
+  1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
+  1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
+  1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
+  1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
+  1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
+  1 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
+  0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
+  0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
+  0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
+  0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
+  0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
+  0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
+  0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
+  0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
+  0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
+  0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
+  0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
+  0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
+  0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
+  0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
+  0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
+  0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
+  0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
+  0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
+  0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
+  0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
+  0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
+  0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
+  0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
+  0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
+  0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
+  0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
+  0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
+  0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
+  0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
+  0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
+  0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
+  0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
 };
 
 int nghttp2_check_method(const uint8_t *value, size_t len) {
@@ -603,70 +605,70 @@ int nghttp2_check_method(const uint8_t *value, size_t len) {
 
 /* Generated by genpathchartbl.py */
 static char VALID_PATH_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
-    0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
-    0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
-    0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
-    0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
-    0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
-    0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
-    0 /* SPC  */, 1 /* !    */, 1 /* "    */, 1 /* #    */,
-    1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
-    1 /* ,    */, 1 /* -    */, 1 /* .    */, 1 /* /    */,
-    1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
-    1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
-    1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
-    1 /* <    */, 1 /* =    */, 1 /* >    */, 1 /* ?    */,
-    1 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
-    1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
-    1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
-    1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
-    1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
-    1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
-    1 /* \    */, 1 /* ]    */, 1 /* ^    */, 1 /* _    */,
-    1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
-    1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
-    1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
-    1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
-    1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 1 /* {    */,
-    1 /* |    */, 1 /* }    */, 1 /* ~    */, 0 /* DEL  */,
-    1 /* 0x80 */, 1 /* 0x81 */, 1 /* 0x82 */, 1 /* 0x83 */,
-    1 /* 0x84 */, 1 /* 0x85 */, 1 /* 0x86 */, 1 /* 0x87 */,
-    1 /* 0x88 */, 1 /* 0x89 */, 1 /* 0x8a */, 1 /* 0x8b */,
-    1 /* 0x8c */, 1 /* 0x8d */, 1 /* 0x8e */, 1 /* 0x8f */,
-    1 /* 0x90 */, 1 /* 0x91 */, 1 /* 0x92 */, 1 /* 0x93 */,
-    1 /* 0x94 */, 1 /* 0x95 */, 1 /* 0x96 */, 1 /* 0x97 */,
-    1 /* 0x98 */, 1 /* 0x99 */, 1 /* 0x9a */, 1 /* 0x9b */,
-    1 /* 0x9c */, 1 /* 0x9d */, 1 /* 0x9e */, 1 /* 0x9f */,
-    1 /* 0xa0 */, 1 /* 0xa1 */, 1 /* 0xa2 */, 1 /* 0xa3 */,
-    1 /* 0xa4 */, 1 /* 0xa5 */, 1 /* 0xa6 */, 1 /* 0xa7 */,
-    1 /* 0xa8 */, 1 /* 0xa9 */, 1 /* 0xaa */, 1 /* 0xab */,
-    1 /* 0xac */, 1 /* 0xad */, 1 /* 0xae */, 1 /* 0xaf */,
-    1 /* 0xb0 */, 1 /* 0xb1 */, 1 /* 0xb2 */, 1 /* 0xb3 */,
-    1 /* 0xb4 */, 1 /* 0xb5 */, 1 /* 0xb6 */, 1 /* 0xb7 */,
-    1 /* 0xb8 */, 1 /* 0xb9 */, 1 /* 0xba */, 1 /* 0xbb */,
-    1 /* 0xbc */, 1 /* 0xbd */, 1 /* 0xbe */, 1 /* 0xbf */,
-    1 /* 0xc0 */, 1 /* 0xc1 */, 1 /* 0xc2 */, 1 /* 0xc3 */,
-    1 /* 0xc4 */, 1 /* 0xc5 */, 1 /* 0xc6 */, 1 /* 0xc7 */,
-    1 /* 0xc8 */, 1 /* 0xc9 */, 1 /* 0xca */, 1 /* 0xcb */,
-    1 /* 0xcc */, 1 /* 0xcd */, 1 /* 0xce */, 1 /* 0xcf */,
-    1 /* 0xd0 */, 1 /* 0xd1 */, 1 /* 0xd2 */, 1 /* 0xd3 */,
-    1 /* 0xd4 */, 1 /* 0xd5 */, 1 /* 0xd6 */, 1 /* 0xd7 */,
-    1 /* 0xd8 */, 1 /* 0xd9 */, 1 /* 0xda */, 1 /* 0xdb */,
-    1 /* 0xdc */, 1 /* 0xdd */, 1 /* 0xde */, 1 /* 0xdf */,
-    1 /* 0xe0 */, 1 /* 0xe1 */, 1 /* 0xe2 */, 1 /* 0xe3 */,
-    1 /* 0xe4 */, 1 /* 0xe5 */, 1 /* 0xe6 */, 1 /* 0xe7 */,
-    1 /* 0xe8 */, 1 /* 0xe9 */, 1 /* 0xea */, 1 /* 0xeb */,
-    1 /* 0xec */, 1 /* 0xed */, 1 /* 0xee */, 1 /* 0xef */,
-    1 /* 0xf0 */, 1 /* 0xf1 */, 1 /* 0xf2 */, 1 /* 0xf3 */,
-    1 /* 0xf4 */, 1 /* 0xf5 */, 1 /* 0xf6 */, 1 /* 0xf7 */,
-    1 /* 0xf8 */, 1 /* 0xf9 */, 1 /* 0xfa */, 1 /* 0xfb */,
-    1 /* 0xfc */, 1 /* 0xfd */, 1 /* 0xfe */, 1 /* 0xff */
+  0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
+  0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
+  0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
+  0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
+  0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
+  0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
+  0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
+  0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
+  0 /* SPC  */, 1 /* !    */, 1 /* "    */, 1 /* #    */,
+  1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
+  1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
+  1 /* ,    */, 1 /* -    */, 1 /* .    */, 1 /* /    */,
+  1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
+  1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
+  1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
+  1 /* <    */, 1 /* =    */, 1 /* >    */, 1 /* ?    */,
+  1 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
+  1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
+  1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
+  1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
+  1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
+  1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
+  1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
+  1 /* \    */, 1 /* ]    */, 1 /* ^    */, 1 /* _    */,
+  1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
+  1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
+  1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
+  1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
+  1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
+  1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
+  1 /* x    */, 1 /* y    */, 1 /* z    */, 1 /* {    */,
+  1 /* |    */, 1 /* }    */, 1 /* ~    */, 0 /* DEL  */,
+  1 /* 0x80 */, 1 /* 0x81 */, 1 /* 0x82 */, 1 /* 0x83 */,
+  1 /* 0x84 */, 1 /* 0x85 */, 1 /* 0x86 */, 1 /* 0x87 */,
+  1 /* 0x88 */, 1 /* 0x89 */, 1 /* 0x8a */, 1 /* 0x8b */,
+  1 /* 0x8c */, 1 /* 0x8d */, 1 /* 0x8e */, 1 /* 0x8f */,
+  1 /* 0x90 */, 1 /* 0x91 */, 1 /* 0x92 */, 1 /* 0x93 */,
+  1 /* 0x94 */, 1 /* 0x95 */, 1 /* 0x96 */, 1 /* 0x97 */,
+  1 /* 0x98 */, 1 /* 0x99 */, 1 /* 0x9a */, 1 /* 0x9b */,
+  1 /* 0x9c */, 1 /* 0x9d */, 1 /* 0x9e */, 1 /* 0x9f */,
+  1 /* 0xa0 */, 1 /* 0xa1 */, 1 /* 0xa2 */, 1 /* 0xa3 */,
+  1 /* 0xa4 */, 1 /* 0xa5 */, 1 /* 0xa6 */, 1 /* 0xa7 */,
+  1 /* 0xa8 */, 1 /* 0xa9 */, 1 /* 0xaa */, 1 /* 0xab */,
+  1 /* 0xac */, 1 /* 0xad */, 1 /* 0xae */, 1 /* 0xaf */,
+  1 /* 0xb0 */, 1 /* 0xb1 */, 1 /* 0xb2 */, 1 /* 0xb3 */,
+  1 /* 0xb4 */, 1 /* 0xb5 */, 1 /* 0xb6 */, 1 /* 0xb7 */,
+  1 /* 0xb8 */, 1 /* 0xb9 */, 1 /* 0xba */, 1 /* 0xbb */,
+  1 /* 0xbc */, 1 /* 0xbd */, 1 /* 0xbe */, 1 /* 0xbf */,
+  1 /* 0xc0 */, 1 /* 0xc1 */, 1 /* 0xc2 */, 1 /* 0xc3 */,
+  1 /* 0xc4 */, 1 /* 0xc5 */, 1 /* 0xc6 */, 1 /* 0xc7 */,
+  1 /* 0xc8 */, 1 /* 0xc9 */, 1 /* 0xca */, 1 /* 0xcb */,
+  1 /* 0xcc */, 1 /* 0xcd */, 1 /* 0xce */, 1 /* 0xcf */,
+  1 /* 0xd0 */, 1 /* 0xd1 */, 1 /* 0xd2 */, 1 /* 0xd3 */,
+  1 /* 0xd4 */, 1 /* 0xd5 */, 1 /* 0xd6 */, 1 /* 0xd7 */,
+  1 /* 0xd8 */, 1 /* 0xd9 */, 1 /* 0xda */, 1 /* 0xdb */,
+  1 /* 0xdc */, 1 /* 0xdd */, 1 /* 0xde */, 1 /* 0xdf */,
+  1 /* 0xe0 */, 1 /* 0xe1 */, 1 /* 0xe2 */, 1 /* 0xe3 */,
+  1 /* 0xe4 */, 1 /* 0xe5 */, 1 /* 0xe6 */, 1 /* 0xe7 */,
+  1 /* 0xe8 */, 1 /* 0xe9 */, 1 /* 0xea */, 1 /* 0xeb */,
+  1 /* 0xec */, 1 /* 0xed */, 1 /* 0xee */, 1 /* 0xef */,
+  1 /* 0xf0 */, 1 /* 0xf1 */, 1 /* 0xf2 */, 1 /* 0xf3 */,
+  1 /* 0xf4 */, 1 /* 0xf5 */, 1 /* 0xf6 */, 1 /* 0xf7 */,
+  1 /* 0xf8 */, 1 /* 0xf9 */, 1 /* 0xfa */, 1 /* 0xfb */,
+  1 /* 0xfc */, 1 /* 0xfd */, 1 /* 0xfe */, 1 /* 0xff */
 };
 
 int nghttp2_check_path(const uint8_t *value, size_t len) {
@@ -681,70 +683,70 @@ int nghttp2_check_path(const uint8_t *value, size_t len) {
 
 /* Generated by genauthoritychartbl.py */
 static char VALID_AUTHORITY_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
-    0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
-    0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
-    0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
-    0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
-    0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
-    0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
-    0 /* SPC  */, 1 /* !    */, 0 /* "    */, 0 /* #    */,
-    1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
-    1 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
-    1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
-    1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
-    1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
-    0 /* <    */, 1 /* =    */, 0 /* >    */, 0 /* ?    */,
-    1 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
-    1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
-    1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
-    1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
-    1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
-    1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
-    0 /* \    */, 1 /* ]    */, 0 /* ^    */, 1 /* _    */,
-    0 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
-    1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
-    1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
-    1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
-    1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
-    0 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
-    0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
-    0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
-    0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
-    0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
-    0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
-    0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
-    0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
-    0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
-    0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
-    0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
-    0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
-    0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
-    0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
-    0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
-    0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
-    0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
-    0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
-    0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
-    0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
-    0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
-    0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
-    0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
-    0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
-    0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
-    0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
-    0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
+  0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
+  0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
+  0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
+  0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
+  0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
+  0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
+  0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
+  0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
+  0 /* SPC  */, 1 /* !    */, 0 /* "    */, 0 /* #    */,
+  1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
+  1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
+  1 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
+  1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
+  1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
+  1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
+  0 /* <    */, 1 /* =    */, 0 /* >    */, 0 /* ?    */,
+  1 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
+  1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
+  1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
+  1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
+  1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
+  1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
+  1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
+  0 /* \    */, 1 /* ]    */, 0 /* ^    */, 1 /* _    */,
+  0 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
+  1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
+  1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
+  1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
+  1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
+  1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
+  1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
+  0 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
+  0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
+  0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
+  0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
+  0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
+  0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
+  0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
+  0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
+  0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
+  0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
+  0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
+  0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
+  0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
+  0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
+  0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
+  0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
+  0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
+  0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
+  0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
+  0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
+  0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
+  0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
+  0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
+  0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
+  0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
+  0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
+  0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
+  0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
+  0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
+  0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
+  0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
+  0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
+  0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
 };
 
 int nghttp2_check_authority(const uint8_t *value, size_t len) {

+ 28 - 5
Utilities/cmnghttp2/lib/nghttp2_helper.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <string.h>
 #include <stddef.h>
@@ -35,13 +35,36 @@
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_mem.h"
 
-#define nghttp2_min(A, B) ((A) < (B) ? (A) : (B))
-#define nghttp2_max(A, B) ((A) > (B) ? (A) : (B))
+#define nghttp2_max_def(SUFFIX, T)                                             \
+  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
+
+nghttp2_max_def(int8, int8_t)
+nghttp2_max_def(int16, int16_t)
+nghttp2_max_def(int32, int32_t)
+nghttp2_max_def(int64, int64_t)
+nghttp2_max_def(uint8, uint8_t)
+nghttp2_max_def(uint16, uint16_t)
+nghttp2_max_def(uint32, uint32_t)
+nghttp2_max_def(uint64, uint64_t)
+nghttp2_max_def(size, size_t)
+
+#define nghttp2_min_def(SUFFIX, T)                                             \
+  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
+
+nghttp2_min_def(int8, int8_t)
+nghttp2_min_def(int16, int16_t)
+nghttp2_min_def(int32, int32_t)
+nghttp2_min_def(int64, int64_t)
+nghttp2_min_def(uint8, uint8_t)
+nghttp2_min_def(uint16, uint16_t)
+nghttp2_min_def(uint32, uint32_t)
+nghttp2_min_def(uint64, uint64_t)
+nghttp2_min_def(size, size_t)
 
 #define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0)
 
 #define nghttp2_struct_of(ptr, type, member)                                   \
-  ((type *)(void *)((char *)(ptr)-offsetof(type, member)))
+  ((type *)(void *)((char *)(ptr) - offsetof(type, member)))
 
 /*
  * Copies 2 byte unsigned integer |n| in host byte order to |buf| in
@@ -119,4 +142,4 @@ int nghttp2_should_send_window_update(int32_t local_window_size,
  */
 uint8_t *nghttp2_cpymem(uint8_t *dest, const void *src, size_t len);
 
-#endif /* NGHTTP2_HELPER_H */
+#endif /* !defined(NGHTTP2_HELPER_H) */

+ 112 - 695
Utilities/cmnghttp2/lib/nghttp2_http.c

@@ -31,6 +31,7 @@
 #include "nghttp2_hd.h"
 #include "nghttp2_helper.h"
 #include "nghttp2_extpri.h"
+#include "sfparse.h"
 
 static uint8_t downcase(uint8_t c) {
   return 'A' <= c && c <= 'Z' ? (uint8_t)(c - 'A' + 'a') : c;
@@ -206,7 +207,6 @@ static int http_request_on_header(nghttp2_stream *stream, nghttp2_hd_nv *nv,
     if (!trailer &&
         /* Do not parse the header field in PUSH_PROMISE. */
         (stream->stream_id & 1) &&
-        (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) &&
         !(stream->http_flags & NGHTTP2_HTTP_FLAG_BAD_PRIORITY)) {
       nghttp2_extpri_from_uint8(&extpri, stream->http_extpri);
       if (nghttp2_http_parse_priority(&extpri, nv->value->base,
@@ -346,6 +346,84 @@ static int lws(const uint8_t *s, size_t n) {
   return 1;
 }
 
+/* Generated by genauthoritychartbl.py, but '@' is not allowed */
+static char VALID_AUTHORITY_CHARS[] = {
+  0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */,
+  0 /* EOT  */, 0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */,
+  0 /* BS   */, 0 /* HT   */, 0 /* LF   */, 0 /* VT   */,
+  0 /* FF   */, 0 /* CR   */, 0 /* SO   */, 0 /* SI   */,
+  0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
+  0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */,
+  0 /* CAN  */, 0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */,
+  0 /* FS   */, 0 /* GS   */, 0 /* RS   */, 0 /* US   */,
+  0 /* SPC  */, 1 /* !    */, 0 /* "    */, 0 /* #    */,
+  1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
+  1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */,
+  1 /* ,    */, 1 /* -    */, 1 /* .    */, 0 /* /    */,
+  1 /* 0    */, 1 /* 1    */, 1 /* 2    */, 1 /* 3    */,
+  1 /* 4    */, 1 /* 5    */, 1 /* 6    */, 1 /* 7    */,
+  1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
+  0 /* <    */, 1 /* =    */, 0 /* >    */, 0 /* ?    */,
+  0 /* @    */, 1 /* A    */, 1 /* B    */, 1 /* C    */,
+  1 /* D    */, 1 /* E    */, 1 /* F    */, 1 /* G    */,
+  1 /* H    */, 1 /* I    */, 1 /* J    */, 1 /* K    */,
+  1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
+  1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */,
+  1 /* T    */, 1 /* U    */, 1 /* V    */, 1 /* W    */,
+  1 /* X    */, 1 /* Y    */, 1 /* Z    */, 1 /* [    */,
+  0 /* \    */, 1 /* ]    */, 0 /* ^    */, 1 /* _    */,
+  0 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
+  1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */,
+  1 /* h    */, 1 /* i    */, 1 /* j    */, 1 /* k    */,
+  1 /* l    */, 1 /* m    */, 1 /* n    */, 1 /* o    */,
+  1 /* p    */, 1 /* q    */, 1 /* r    */, 1 /* s    */,
+  1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
+  1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */,
+  0 /* |    */, 0 /* }    */, 1 /* ~    */, 0 /* DEL  */,
+  0 /* 0x80 */, 0 /* 0x81 */, 0 /* 0x82 */, 0 /* 0x83 */,
+  0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */, 0 /* 0x87 */,
+  0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
+  0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */,
+  0 /* 0x90 */, 0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */,
+  0 /* 0x94 */, 0 /* 0x95 */, 0 /* 0x96 */, 0 /* 0x97 */,
+  0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */, 0 /* 0x9b */,
+  0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
+  0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */,
+  0 /* 0xa4 */, 0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */,
+  0 /* 0xa8 */, 0 /* 0xa9 */, 0 /* 0xaa */, 0 /* 0xab */,
+  0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */, 0 /* 0xaf */,
+  0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
+  0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */,
+  0 /* 0xb8 */, 0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */,
+  0 /* 0xbc */, 0 /* 0xbd */, 0 /* 0xbe */, 0 /* 0xbf */,
+  0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */, 0 /* 0xc3 */,
+  0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
+  0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */,
+  0 /* 0xcc */, 0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */,
+  0 /* 0xd0 */, 0 /* 0xd1 */, 0 /* 0xd2 */, 0 /* 0xd3 */,
+  0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */, 0 /* 0xd7 */,
+  0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
+  0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */,
+  0 /* 0xe0 */, 0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */,
+  0 /* 0xe4 */, 0 /* 0xe5 */, 0 /* 0xe6 */, 0 /* 0xe7 */,
+  0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */, 0 /* 0xeb */,
+  0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
+  0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */,
+  0 /* 0xf4 */, 0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */,
+  0 /* 0xf8 */, 0 /* 0xf9 */, 0 /* 0xfa */, 0 /* 0xfb */,
+  0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */, 0 /* 0xff */
+};
+
+static int check_authority(const uint8_t *value, size_t len) {
+  const uint8_t *last;
+  for (last = value + len; value != last; ++value) {
+    if (!VALID_AUTHORITY_CHARS[*value]) {
+      return 0;
+    }
+  }
+  return 1;
+}
+
 int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
                            nghttp2_frame *frame, nghttp2_hd_nv *nv,
                            int trailer) {
@@ -387,10 +465,10 @@ int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
   case NGHTTP2_TOKEN__AUTHORITY:
   case NGHTTP2_TOKEN_HOST:
     if (session->server || frame->hd.type == NGHTTP2_PUSH_PROMISE) {
-      rv = nghttp2_check_authority(nv->value->base, nv->value->len);
+      rv = check_authority(nv->value->base, nv->value->len);
     } else if (
-        stream->flags &
-        NGHTTP2_STREAM_FLAG_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) {
+      stream->flags &
+      NGHTTP2_STREAM_FLAG_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) {
       rv = nghttp2_check_header_value(nv->value->base, nv->value->len);
     } else {
       rv = nghttp2_check_header_value_rfc9113(nv->value->base, nv->value->len);
@@ -434,7 +512,7 @@ int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
   if (session->server || frame->hd.type == NGHTTP2_PUSH_PROMISE) {
     return http_request_on_header(stream, nv, trailer,
                                   session->server &&
-                                      session->pending_enable_connect_protocol);
+                                    session->pending_enable_connect_protocol);
   }
 
   return http_response_on_header(stream, nv, trailer);
@@ -452,7 +530,7 @@ int nghttp2_http_on_request_headers(nghttp2_stream *stream,
     stream->content_length = -1;
   } else {
     if ((stream->http_flags & NGHTTP2_HTTP_FLAG_REQ_HEADERS) !=
-            NGHTTP2_HTTP_FLAG_REQ_HEADERS ||
+          NGHTTP2_HTTP_FLAG_REQ_HEADERS ||
         (stream->http_flags &
          (NGHTTP2_HTTP_FLAG__AUTHORITY | NGHTTP2_HTTP_FLAG_HOST)) == 0) {
       return -1;
@@ -492,7 +570,7 @@ int nghttp2_http_on_response_headers(nghttp2_stream *stream) {
   }
 
   stream->http_flags =
-      stream->http_flags & (uint32_t)~NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE;
+    stream->http_flags & (uint32_t)~NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE;
 
   if (!expect_response_body(stream)) {
     stream->content_length = 0;
@@ -578,713 +656,52 @@ void nghttp2_http_record_request_method(nghttp2_stream *stream,
   }
 }
 
-/* Generated by genchartbl.py */
-static const int SF_KEY_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */, 0 /* EOT  */,
-    0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */, 0 /* BS   */, 0 /* HT   */,
-    0 /* LF   */, 0 /* VT   */, 0 /* FF   */, 0 /* CR   */, 0 /* SO   */,
-    0 /* SI   */, 0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */, 0 /* CAN  */,
-    0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */, 0 /* FS   */, 0 /* GS   */,
-    0 /* RS   */, 0 /* US   */, 0 /* SPC  */, 0 /* !    */, 0 /* "    */,
-    0 /* #    */, 0 /* $    */, 0 /* %    */, 0 /* &    */, 0 /* '    */,
-    0 /* (    */, 0 /* )    */, 1 /* *    */, 0 /* +    */, 0 /* ,    */,
-    1 /* -    */, 1 /* .    */, 0 /* /    */, 1 /* 0    */, 1 /* 1    */,
-    1 /* 2    */, 1 /* 3    */, 1 /* 4    */, 1 /* 5    */, 1 /* 6    */,
-    1 /* 7    */, 1 /* 8    */, 1 /* 9    */, 0 /* :    */, 0 /* ;    */,
-    0 /* <    */, 0 /* =    */, 0 /* >    */, 0 /* ?    */, 0 /* @    */,
-    0 /* A    */, 0 /* B    */, 0 /* C    */, 0 /* D    */, 0 /* E    */,
-    0 /* F    */, 0 /* G    */, 0 /* H    */, 0 /* I    */, 0 /* J    */,
-    0 /* K    */, 0 /* L    */, 0 /* M    */, 0 /* N    */, 0 /* O    */,
-    0 /* P    */, 0 /* Q    */, 0 /* R    */, 0 /* S    */, 0 /* T    */,
-    0 /* U    */, 0 /* V    */, 0 /* W    */, 0 /* X    */, 0 /* Y    */,
-    0 /* Z    */, 0 /* [    */, 0 /* \    */, 0 /* ]    */, 0 /* ^    */,
-    1 /* _    */, 0 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */, 1 /* h    */,
-    1 /* i    */, 1 /* j    */, 1 /* k    */, 1 /* l    */, 1 /* m    */,
-    1 /* n    */, 1 /* o    */, 1 /* p    */, 1 /* q    */, 1 /* r    */,
-    1 /* s    */, 1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */, 0 /* |    */,
-    0 /* }    */, 0 /* ~    */, 0 /* DEL  */, 0 /* 0x80 */, 0 /* 0x81 */,
-    0 /* 0x82 */, 0 /* 0x83 */, 0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */,
-    0 /* 0x87 */, 0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */, 0 /* 0x90 */,
-    0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */, 0 /* 0x94 */, 0 /* 0x95 */,
-    0 /* 0x96 */, 0 /* 0x97 */, 0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */,
-    0 /* 0x9b */, 0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */, 0 /* 0xa4 */,
-    0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */, 0 /* 0xa8 */, 0 /* 0xa9 */,
-    0 /* 0xaa */, 0 /* 0xab */, 0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */,
-    0 /* 0xaf */, 0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */, 0 /* 0xb8 */,
-    0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */, 0 /* 0xbc */, 0 /* 0xbd */,
-    0 /* 0xbe */, 0 /* 0xbf */, 0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */,
-    0 /* 0xc3 */, 0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */, 0 /* 0xcc */,
-    0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */, 0 /* 0xd0 */, 0 /* 0xd1 */,
-    0 /* 0xd2 */, 0 /* 0xd3 */, 0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */,
-    0 /* 0xd7 */, 0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */, 0 /* 0xe0 */,
-    0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */, 0 /* 0xe4 */, 0 /* 0xe5 */,
-    0 /* 0xe6 */, 0 /* 0xe7 */, 0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */,
-    0 /* 0xeb */, 0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */, 0 /* 0xf4 */,
-    0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */, 0 /* 0xf8 */, 0 /* 0xf9 */,
-    0 /* 0xfa */, 0 /* 0xfb */, 0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */,
-    0 /* 0xff */,
-};
-
-static ssize_t sf_parse_key(const uint8_t *begin, const uint8_t *end) {
-  const uint8_t *p = begin;
-
-  if ((*p < 'a' || 'z' < *p) && *p != '*') {
-    return -1;
-  }
-
-  for (; p != end && SF_KEY_CHARS[*p]; ++p)
-    ;
-
-  return p - begin;
-}
-
-static ssize_t sf_parse_integer_or_decimal(nghttp2_sf_value *dest,
-                                           const uint8_t *begin,
-                                           const uint8_t *end) {
-  const uint8_t *p = begin;
-  int sign = 1;
-  int64_t value = 0;
-  int type = NGHTTP2_SF_VALUE_TYPE_INTEGER;
-  size_t len = 0;
-  size_t fpos = 0;
-  size_t i;
-
-  if (*p == '-') {
-    if (++p == end) {
-      return -1;
-    }
-
-    sign = -1;
-  }
-
-  if (*p < '0' || '9' < *p) {
-    return -1;
-  }
-
-  for (; p != end; ++p) {
-    switch (*p) {
-    case '0':
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9':
-      value *= 10;
-      value += *p - '0';
-
-      if (++len > 15) {
-        return -1;
-      }
-
-      break;
-    case '.':
-      if (type != NGHTTP2_SF_VALUE_TYPE_INTEGER) {
-        goto fin;
-      }
-
-      if (len > 12) {
-        return -1;
-      }
-      fpos = len;
-      type = NGHTTP2_SF_VALUE_TYPE_DECIMAL;
-
-      break;
-    default:
-      goto fin;
-    };
-  }
-
-fin:
-  switch (type) {
-  case NGHTTP2_SF_VALUE_TYPE_INTEGER:
-    if (dest) {
-      dest->type = (uint8_t)type;
-      dest->i = value * sign;
-    }
-
-    return p - begin;
-  case NGHTTP2_SF_VALUE_TYPE_DECIMAL:
-    if (fpos == len || len - fpos > 3) {
-      return -1;
-    }
-
-    if (dest) {
-      dest->type = (uint8_t)type;
-      dest->d = (double)value;
-      for (i = len - fpos; i > 0; --i) {
-        dest->d /= (double)10;
-      }
-      dest->d *= sign;
-    }
-
-    return p - begin;
-  default:
-    assert(0);
-    abort();
-  }
-}
-
-/* Generated by genchartbl.py */
-static const int SF_DQUOTE_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */, 0 /* EOT  */,
-    0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */, 0 /* BS   */, 0 /* HT   */,
-    0 /* LF   */, 0 /* VT   */, 0 /* FF   */, 0 /* CR   */, 0 /* SO   */,
-    0 /* SI   */, 0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */, 0 /* CAN  */,
-    0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */, 0 /* FS   */, 0 /* GS   */,
-    0 /* RS   */, 0 /* US   */, 1 /* SPC  */, 1 /* !    */, 0 /* "    */,
-    1 /* #    */, 1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    1 /* (    */, 1 /* )    */, 1 /* *    */, 1 /* +    */, 1 /* ,    */,
-    1 /* -    */, 1 /* .    */, 1 /* /    */, 1 /* 0    */, 1 /* 1    */,
-    1 /* 2    */, 1 /* 3    */, 1 /* 4    */, 1 /* 5    */, 1 /* 6    */,
-    1 /* 7    */, 1 /* 8    */, 1 /* 9    */, 1 /* :    */, 1 /* ;    */,
-    1 /* <    */, 1 /* =    */, 1 /* >    */, 1 /* ?    */, 1 /* @    */,
-    1 /* A    */, 1 /* B    */, 1 /* C    */, 1 /* D    */, 1 /* E    */,
-    1 /* F    */, 1 /* G    */, 1 /* H    */, 1 /* I    */, 1 /* J    */,
-    1 /* K    */, 1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */, 1 /* T    */,
-    1 /* U    */, 1 /* V    */, 1 /* W    */, 1 /* X    */, 1 /* Y    */,
-    1 /* Z    */, 1 /* [    */, 0 /* \    */, 1 /* ]    */, 1 /* ^    */,
-    1 /* _    */, 1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */, 1 /* h    */,
-    1 /* i    */, 1 /* j    */, 1 /* k    */, 1 /* l    */, 1 /* m    */,
-    1 /* n    */, 1 /* o    */, 1 /* p    */, 1 /* q    */, 1 /* r    */,
-    1 /* s    */, 1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 1 /* {    */, 1 /* |    */,
-    1 /* }    */, 1 /* ~    */, 0 /* DEL  */, 0 /* 0x80 */, 0 /* 0x81 */,
-    0 /* 0x82 */, 0 /* 0x83 */, 0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */,
-    0 /* 0x87 */, 0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */, 0 /* 0x90 */,
-    0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */, 0 /* 0x94 */, 0 /* 0x95 */,
-    0 /* 0x96 */, 0 /* 0x97 */, 0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */,
-    0 /* 0x9b */, 0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */, 0 /* 0xa4 */,
-    0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */, 0 /* 0xa8 */, 0 /* 0xa9 */,
-    0 /* 0xaa */, 0 /* 0xab */, 0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */,
-    0 /* 0xaf */, 0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */, 0 /* 0xb8 */,
-    0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */, 0 /* 0xbc */, 0 /* 0xbd */,
-    0 /* 0xbe */, 0 /* 0xbf */, 0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */,
-    0 /* 0xc3 */, 0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */, 0 /* 0xcc */,
-    0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */, 0 /* 0xd0 */, 0 /* 0xd1 */,
-    0 /* 0xd2 */, 0 /* 0xd3 */, 0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */,
-    0 /* 0xd7 */, 0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */, 0 /* 0xe0 */,
-    0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */, 0 /* 0xe4 */, 0 /* 0xe5 */,
-    0 /* 0xe6 */, 0 /* 0xe7 */, 0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */,
-    0 /* 0xeb */, 0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */, 0 /* 0xf4 */,
-    0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */, 0 /* 0xf8 */, 0 /* 0xf9 */,
-    0 /* 0xfa */, 0 /* 0xfb */, 0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */,
-    0 /* 0xff */,
-};
-
-static ssize_t sf_parse_string(nghttp2_sf_value *dest, const uint8_t *begin,
-                               const uint8_t *end) {
-  const uint8_t *p = begin;
-
-  if (*p++ != '"') {
-    return -1;
-  }
-
-  for (; p != end; ++p) {
-    switch (*p) {
-    case '\\':
-      if (++p == end) {
-        return -1;
-      }
-
-      switch (*p) {
-      case '"':
-      case '\\':
-        break;
-      default:
-        return -1;
-      }
-
-      break;
-    case '"':
-      if (dest) {
-        dest->type = NGHTTP2_SF_VALUE_TYPE_STRING;
-        dest->s.base = begin + 1;
-        dest->s.len = (size_t)(p - dest->s.base);
-      }
-
-      ++p;
-
-      return p - begin;
-    default:
-      if (!SF_DQUOTE_CHARS[*p]) {
-        return -1;
-      }
-    }
-  }
-
-  return -1;
-}
-
-/* Generated by genchartbl.py */
-static const int SF_TOKEN_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */, 0 /* EOT  */,
-    0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */, 0 /* BS   */, 0 /* HT   */,
-    0 /* LF   */, 0 /* VT   */, 0 /* FF   */, 0 /* CR   */, 0 /* SO   */,
-    0 /* SI   */, 0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */, 0 /* CAN  */,
-    0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */, 0 /* FS   */, 0 /* GS   */,
-    0 /* RS   */, 0 /* US   */, 0 /* SPC  */, 1 /* !    */, 0 /* "    */,
-    1 /* #    */, 1 /* $    */, 1 /* %    */, 1 /* &    */, 1 /* '    */,
-    0 /* (    */, 0 /* )    */, 1 /* *    */, 1 /* +    */, 0 /* ,    */,
-    1 /* -    */, 1 /* .    */, 1 /* /    */, 1 /* 0    */, 1 /* 1    */,
-    1 /* 2    */, 1 /* 3    */, 1 /* 4    */, 1 /* 5    */, 1 /* 6    */,
-    1 /* 7    */, 1 /* 8    */, 1 /* 9    */, 1 /* :    */, 0 /* ;    */,
-    0 /* <    */, 0 /* =    */, 0 /* >    */, 0 /* ?    */, 0 /* @    */,
-    1 /* A    */, 1 /* B    */, 1 /* C    */, 1 /* D    */, 1 /* E    */,
-    1 /* F    */, 1 /* G    */, 1 /* H    */, 1 /* I    */, 1 /* J    */,
-    1 /* K    */, 1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */, 1 /* T    */,
-    1 /* U    */, 1 /* V    */, 1 /* W    */, 1 /* X    */, 1 /* Y    */,
-    1 /* Z    */, 0 /* [    */, 0 /* \    */, 0 /* ]    */, 1 /* ^    */,
-    1 /* _    */, 1 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */, 1 /* h    */,
-    1 /* i    */, 1 /* j    */, 1 /* k    */, 1 /* l    */, 1 /* m    */,
-    1 /* n    */, 1 /* o    */, 1 /* p    */, 1 /* q    */, 1 /* r    */,
-    1 /* s    */, 1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */, 1 /* |    */,
-    0 /* }    */, 1 /* ~    */, 0 /* DEL  */, 0 /* 0x80 */, 0 /* 0x81 */,
-    0 /* 0x82 */, 0 /* 0x83 */, 0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */,
-    0 /* 0x87 */, 0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */, 0 /* 0x90 */,
-    0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */, 0 /* 0x94 */, 0 /* 0x95 */,
-    0 /* 0x96 */, 0 /* 0x97 */, 0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */,
-    0 /* 0x9b */, 0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */, 0 /* 0xa4 */,
-    0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */, 0 /* 0xa8 */, 0 /* 0xa9 */,
-    0 /* 0xaa */, 0 /* 0xab */, 0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */,
-    0 /* 0xaf */, 0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */, 0 /* 0xb8 */,
-    0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */, 0 /* 0xbc */, 0 /* 0xbd */,
-    0 /* 0xbe */, 0 /* 0xbf */, 0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */,
-    0 /* 0xc3 */, 0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */, 0 /* 0xcc */,
-    0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */, 0 /* 0xd0 */, 0 /* 0xd1 */,
-    0 /* 0xd2 */, 0 /* 0xd3 */, 0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */,
-    0 /* 0xd7 */, 0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */, 0 /* 0xe0 */,
-    0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */, 0 /* 0xe4 */, 0 /* 0xe5 */,
-    0 /* 0xe6 */, 0 /* 0xe7 */, 0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */,
-    0 /* 0xeb */, 0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */, 0 /* 0xf4 */,
-    0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */, 0 /* 0xf8 */, 0 /* 0xf9 */,
-    0 /* 0xfa */, 0 /* 0xfb */, 0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */,
-    0 /* 0xff */,
-};
-
-static ssize_t sf_parse_token(nghttp2_sf_value *dest, const uint8_t *begin,
-                              const uint8_t *end) {
-  const uint8_t *p = begin;
-
-  if ((*p < 'A' || 'Z' < *p) && (*p < 'a' || 'z' < *p) && *p != '*') {
-    return -1;
-  }
-
-  for (; p != end && SF_TOKEN_CHARS[*p]; ++p)
-    ;
-
-  if (dest) {
-    dest->type = NGHTTP2_SF_VALUE_TYPE_TOKEN;
-    dest->s.base = begin;
-    dest->s.len = (size_t)(p - begin);
-  }
-
-  return p - begin;
-}
-
-/* Generated by genchartbl.py */
-static const int SF_BYTESEQ_CHARS[] = {
-    0 /* NUL  */, 0 /* SOH  */, 0 /* STX  */, 0 /* ETX  */, 0 /* EOT  */,
-    0 /* ENQ  */, 0 /* ACK  */, 0 /* BEL  */, 0 /* BS   */, 0 /* HT   */,
-    0 /* LF   */, 0 /* VT   */, 0 /* FF   */, 0 /* CR   */, 0 /* SO   */,
-    0 /* SI   */, 0 /* DLE  */, 0 /* DC1  */, 0 /* DC2  */, 0 /* DC3  */,
-    0 /* DC4  */, 0 /* NAK  */, 0 /* SYN  */, 0 /* ETB  */, 0 /* CAN  */,
-    0 /* EM   */, 0 /* SUB  */, 0 /* ESC  */, 0 /* FS   */, 0 /* GS   */,
-    0 /* RS   */, 0 /* US   */, 0 /* SPC  */, 0 /* !    */, 0 /* "    */,
-    0 /* #    */, 0 /* $    */, 0 /* %    */, 0 /* &    */, 0 /* '    */,
-    0 /* (    */, 0 /* )    */, 0 /* *    */, 1 /* +    */, 0 /* ,    */,
-    0 /* -    */, 0 /* .    */, 1 /* /    */, 1 /* 0    */, 1 /* 1    */,
-    1 /* 2    */, 1 /* 3    */, 1 /* 4    */, 1 /* 5    */, 1 /* 6    */,
-    1 /* 7    */, 1 /* 8    */, 1 /* 9    */, 0 /* :    */, 0 /* ;    */,
-    0 /* <    */, 1 /* =    */, 0 /* >    */, 0 /* ?    */, 0 /* @    */,
-    1 /* A    */, 1 /* B    */, 1 /* C    */, 1 /* D    */, 1 /* E    */,
-    1 /* F    */, 1 /* G    */, 1 /* H    */, 1 /* I    */, 1 /* J    */,
-    1 /* K    */, 1 /* L    */, 1 /* M    */, 1 /* N    */, 1 /* O    */,
-    1 /* P    */, 1 /* Q    */, 1 /* R    */, 1 /* S    */, 1 /* T    */,
-    1 /* U    */, 1 /* V    */, 1 /* W    */, 1 /* X    */, 1 /* Y    */,
-    1 /* Z    */, 0 /* [    */, 0 /* \    */, 0 /* ]    */, 0 /* ^    */,
-    0 /* _    */, 0 /* `    */, 1 /* a    */, 1 /* b    */, 1 /* c    */,
-    1 /* d    */, 1 /* e    */, 1 /* f    */, 1 /* g    */, 1 /* h    */,
-    1 /* i    */, 1 /* j    */, 1 /* k    */, 1 /* l    */, 1 /* m    */,
-    1 /* n    */, 1 /* o    */, 1 /* p    */, 1 /* q    */, 1 /* r    */,
-    1 /* s    */, 1 /* t    */, 1 /* u    */, 1 /* v    */, 1 /* w    */,
-    1 /* x    */, 1 /* y    */, 1 /* z    */, 0 /* {    */, 0 /* |    */,
-    0 /* }    */, 0 /* ~    */, 0 /* DEL  */, 0 /* 0x80 */, 0 /* 0x81 */,
-    0 /* 0x82 */, 0 /* 0x83 */, 0 /* 0x84 */, 0 /* 0x85 */, 0 /* 0x86 */,
-    0 /* 0x87 */, 0 /* 0x88 */, 0 /* 0x89 */, 0 /* 0x8a */, 0 /* 0x8b */,
-    0 /* 0x8c */, 0 /* 0x8d */, 0 /* 0x8e */, 0 /* 0x8f */, 0 /* 0x90 */,
-    0 /* 0x91 */, 0 /* 0x92 */, 0 /* 0x93 */, 0 /* 0x94 */, 0 /* 0x95 */,
-    0 /* 0x96 */, 0 /* 0x97 */, 0 /* 0x98 */, 0 /* 0x99 */, 0 /* 0x9a */,
-    0 /* 0x9b */, 0 /* 0x9c */, 0 /* 0x9d */, 0 /* 0x9e */, 0 /* 0x9f */,
-    0 /* 0xa0 */, 0 /* 0xa1 */, 0 /* 0xa2 */, 0 /* 0xa3 */, 0 /* 0xa4 */,
-    0 /* 0xa5 */, 0 /* 0xa6 */, 0 /* 0xa7 */, 0 /* 0xa8 */, 0 /* 0xa9 */,
-    0 /* 0xaa */, 0 /* 0xab */, 0 /* 0xac */, 0 /* 0xad */, 0 /* 0xae */,
-    0 /* 0xaf */, 0 /* 0xb0 */, 0 /* 0xb1 */, 0 /* 0xb2 */, 0 /* 0xb3 */,
-    0 /* 0xb4 */, 0 /* 0xb5 */, 0 /* 0xb6 */, 0 /* 0xb7 */, 0 /* 0xb8 */,
-    0 /* 0xb9 */, 0 /* 0xba */, 0 /* 0xbb */, 0 /* 0xbc */, 0 /* 0xbd */,
-    0 /* 0xbe */, 0 /* 0xbf */, 0 /* 0xc0 */, 0 /* 0xc1 */, 0 /* 0xc2 */,
-    0 /* 0xc3 */, 0 /* 0xc4 */, 0 /* 0xc5 */, 0 /* 0xc6 */, 0 /* 0xc7 */,
-    0 /* 0xc8 */, 0 /* 0xc9 */, 0 /* 0xca */, 0 /* 0xcb */, 0 /* 0xcc */,
-    0 /* 0xcd */, 0 /* 0xce */, 0 /* 0xcf */, 0 /* 0xd0 */, 0 /* 0xd1 */,
-    0 /* 0xd2 */, 0 /* 0xd3 */, 0 /* 0xd4 */, 0 /* 0xd5 */, 0 /* 0xd6 */,
-    0 /* 0xd7 */, 0 /* 0xd8 */, 0 /* 0xd9 */, 0 /* 0xda */, 0 /* 0xdb */,
-    0 /* 0xdc */, 0 /* 0xdd */, 0 /* 0xde */, 0 /* 0xdf */, 0 /* 0xe0 */,
-    0 /* 0xe1 */, 0 /* 0xe2 */, 0 /* 0xe3 */, 0 /* 0xe4 */, 0 /* 0xe5 */,
-    0 /* 0xe6 */, 0 /* 0xe7 */, 0 /* 0xe8 */, 0 /* 0xe9 */, 0 /* 0xea */,
-    0 /* 0xeb */, 0 /* 0xec */, 0 /* 0xed */, 0 /* 0xee */, 0 /* 0xef */,
-    0 /* 0xf0 */, 0 /* 0xf1 */, 0 /* 0xf2 */, 0 /* 0xf3 */, 0 /* 0xf4 */,
-    0 /* 0xf5 */, 0 /* 0xf6 */, 0 /* 0xf7 */, 0 /* 0xf8 */, 0 /* 0xf9 */,
-    0 /* 0xfa */, 0 /* 0xfb */, 0 /* 0xfc */, 0 /* 0xfd */, 0 /* 0xfe */,
-    0 /* 0xff */,
-};
-
-static ssize_t sf_parse_byteseq(nghttp2_sf_value *dest, const uint8_t *begin,
-                                const uint8_t *end) {
-  const uint8_t *p = begin;
-
-  if (*p++ != ':') {
-    return -1;
-  }
-
-  for (; p != end; ++p) {
-    switch (*p) {
-    case ':':
-      if (dest) {
-        dest->type = NGHTTP2_SF_VALUE_TYPE_BYTESEQ;
-        dest->s.base = begin + 1;
-        dest->s.len = (size_t)(p - dest->s.base);
-      }
-
-      ++p;
-
-      return p - begin;
-    default:
-      if (!SF_BYTESEQ_CHARS[*p]) {
-        return -1;
-      }
-    }
-  }
-
-  return -1;
-}
-
-static ssize_t sf_parse_boolean(nghttp2_sf_value *dest, const uint8_t *begin,
-                                const uint8_t *end) {
-  const uint8_t *p = begin;
-  int b;
-
-  if (*p++ != '?') {
-    return -1;
-  }
-
-  if (p == end) {
-    return -1;
-  }
-
-  switch (*p++) {
-  case '0':
-    b = 0;
-    break;
-  case '1':
-    b = 1;
-    break;
-  default:
-    return -1;
-  }
-
-  if (dest) {
-    dest->type = NGHTTP2_SF_VALUE_TYPE_BOOLEAN;
-    dest->b = b;
-  }
-
-  return p - begin;
-}
-
-static ssize_t sf_parse_bare_item(nghttp2_sf_value *dest, const uint8_t *begin,
-                                  const uint8_t *end) {
-  switch (*begin) {
-  case '-':
-  case '0':
-  case '1':
-  case '2':
-  case '3':
-  case '4':
-  case '5':
-  case '6':
-  case '7':
-  case '8':
-  case '9':
-    return sf_parse_integer_or_decimal(dest, begin, end);
-  case '"':
-    return sf_parse_string(dest, begin, end);
-  case '*':
-    return sf_parse_token(dest, begin, end);
-  case ':':
-    return sf_parse_byteseq(dest, begin, end);
-  case '?':
-    return sf_parse_boolean(dest, begin, end);
-  default:
-    if (('A' <= *begin && *begin <= 'Z') || ('a' <= *begin && *begin <= 'z')) {
-      return sf_parse_token(dest, begin, end);
-    }
-    return -1;
-  }
-}
-
-#define sf_discard_sp_end_err(BEGIN, END, ERR)                                 \
-  for (;; ++(BEGIN)) {                                                         \
-    if ((BEGIN) == (END)) {                                                    \
-      return (ERR);                                                            \
-    }                                                                          \
-    if (*(BEGIN) != ' ') {                                                     \
-      break;                                                                   \
-    }                                                                          \
-  }
-
-static ssize_t sf_parse_params(const uint8_t *begin, const uint8_t *end) {
-  const uint8_t *p = begin;
-  ssize_t slen;
-
-  for (; p != end && *p == ';';) {
-    ++p;
-
-    sf_discard_sp_end_err(p, end, -1);
-
-    slen = sf_parse_key(p, end);
-    if (slen < 0) {
-      return -1;
-    }
-
-    p += slen;
-
-    if (p == end || *p != '=') {
-      /* Boolean true */
-    } else if (++p == end) {
-      return -1;
-    } else {
-      slen = sf_parse_bare_item(NULL, p, end);
-      if (slen < 0) {
-        return -1;
-      }
-
-      p += slen;
-    }
-  }
-
-  return p - begin;
-}
-
-static ssize_t sf_parse_item(nghttp2_sf_value *dest, const uint8_t *begin,
-                             const uint8_t *end) {
-  const uint8_t *p = begin;
-  ssize_t slen;
-
-  slen = sf_parse_bare_item(dest, p, end);
-  if (slen < 0) {
-    return -1;
-  }
-
-  p += slen;
-
-  slen = sf_parse_params(p, end);
-  if (slen < 0) {
-    return -1;
-  }
-
-  p += slen;
-
-  return p - begin;
-}
-
-ssize_t nghttp2_sf_parse_item(nghttp2_sf_value *dest, const uint8_t *begin,
-                              const uint8_t *end) {
-  return sf_parse_item(dest, begin, end);
-}
-
-static ssize_t sf_parse_inner_list(nghttp2_sf_value *dest, const uint8_t *begin,
-                                   const uint8_t *end) {
-  const uint8_t *p = begin;
-  ssize_t slen;
-
-  if (*p++ != '(') {
-    return -1;
-  }
-
-  for (;;) {
-    sf_discard_sp_end_err(p, end, -1);
-
-    if (*p == ')') {
-      ++p;
-
-      slen = sf_parse_params(p, end);
-      if (slen < 0) {
-        return -1;
-      }
-
-      p += slen;
-
-      if (dest) {
-        dest->type = NGHTTP2_SF_VALUE_TYPE_INNER_LIST;
-      }
-
-      return p - begin;
-    }
-
-    slen = sf_parse_item(NULL, p, end);
-    if (slen < 0) {
-      return -1;
-    }
-
-    p += slen;
-
-    if (p == end || (*p != ' ' && *p != ')')) {
-      return -1;
-    }
-  }
-}
-
-ssize_t nghttp2_sf_parse_inner_list(nghttp2_sf_value *dest,
-                                    const uint8_t *begin, const uint8_t *end) {
-  return sf_parse_inner_list(dest, begin, end);
-}
-
-static ssize_t sf_parse_item_or_inner_list(nghttp2_sf_value *dest,
-                                           const uint8_t *begin,
-                                           const uint8_t *end) {
-  if (*begin == '(') {
-    return sf_parse_inner_list(dest, begin, end);
-  }
-
-  return sf_parse_item(dest, begin, end);
-}
-
-#define sf_discard_ows(BEGIN, END)                                             \
-  for (;; ++(BEGIN)) {                                                         \
-    if ((BEGIN) == (END)) {                                                    \
-      goto fin;                                                                \
-    }                                                                          \
-    if (*(BEGIN) != ' ' && *(BEGIN) != '\t') {                                 \
-      break;                                                                   \
-    }                                                                          \
-  }
-
-#define sf_discard_ows_end_err(BEGIN, END, ERR)                                \
-  for (;; ++(BEGIN)) {                                                         \
-    if ((BEGIN) == (END)) {                                                    \
-      return (ERR);                                                            \
-    }                                                                          \
-    if (*(BEGIN) != ' ' && *(BEGIN) != '\t') {                                 \
-      break;                                                                   \
-    }                                                                          \
-  }
-
 int nghttp2_http_parse_priority(nghttp2_extpri *dest, const uint8_t *value,
                                 size_t valuelen) {
-  const uint8_t *p = value, *end = value + valuelen;
-  ssize_t slen;
-  nghttp2_sf_value val;
   nghttp2_extpri pri = *dest;
-  const uint8_t *key;
-  size_t keylen;
+  sfparse_parser sfp;
+  sfparse_vec key;
+  sfparse_value val;
+  int rv;
 
-  for (; p != end && *p == ' '; ++p)
-    ;
+  sfparse_parser_init(&sfp, value, valuelen);
+
+  for (;;) {
+    rv = sfparse_parser_dict(&sfp, &key, &val);
+    if (rv != 0) {
+      if (rv == SFPARSE_ERR_EOF) {
+        break;
+      }
 
-  for (; p != end;) {
-    slen = sf_parse_key(p, end);
-    if (slen < 0) {
       return NGHTTP2_ERR_INVALID_ARGUMENT;
     }
 
-    key = p;
-    keylen = (size_t)slen;
-
-    p += slen;
-
-    if (p == end || *p != '=') {
-      /* Boolean true */
-      val.type = NGHTTP2_SF_VALUE_TYPE_BOOLEAN;
-      val.b = 1;
+    if (key.len != 1) {
+      continue;
+    }
 
-      slen = sf_parse_params(p, end);
-      if (slen < 0) {
+    switch (key.base[0]) {
+    case 'i':
+      if (val.type != SFPARSE_TYPE_BOOLEAN) {
         return NGHTTP2_ERR_INVALID_ARGUMENT;
       }
-    } else if (++p == end) {
-      return NGHTTP2_ERR_INVALID_ARGUMENT;
-    } else {
-      slen = sf_parse_item_or_inner_list(&val, p, end);
-      if (slen < 0) {
-        return NGHTTP2_ERR_INVALID_ARGUMENT;
-      }
-    }
 
-    p += slen;
+      pri.inc = val.boolean;
 
-    if (keylen == 1) {
-      switch (key[0]) {
-      case 'i':
-        if (val.type != NGHTTP2_SF_VALUE_TYPE_BOOLEAN) {
-          return NGHTTP2_ERR_INVALID_ARGUMENT;
-        }
-
-        pri.inc = val.b;
-
-        break;
-      case 'u':
-        if (val.type != NGHTTP2_SF_VALUE_TYPE_INTEGER ||
-            val.i < NGHTTP2_EXTPRI_URGENCY_HIGH ||
-            NGHTTP2_EXTPRI_URGENCY_LOW < val.i) {
-          return NGHTTP2_ERR_INVALID_ARGUMENT;
-        }
-
-        pri.urgency = (uint32_t)val.i;
-
-        break;
+      break;
+    case 'u':
+      if (val.type != SFPARSE_TYPE_INTEGER ||
+          val.integer < NGHTTP2_EXTPRI_URGENCY_HIGH ||
+          NGHTTP2_EXTPRI_URGENCY_LOW < val.integer) {
+        return NGHTTP2_ERR_INVALID_ARGUMENT;
       }
-    }
 
-    sf_discard_ows(p, end);
+      pri.urgency = (uint32_t)val.integer;
 
-    if (*p++ != ',') {
-      return NGHTTP2_ERR_INVALID_ARGUMENT;
+      break;
     }
-
-    sf_discard_ows_end_err(p, end, NGHTTP2_ERR_INVALID_ARGUMENT);
   }
 
-fin:
   *dest = pri;
 
   return 0;

+ 2 - 50
Utilities/cmnghttp2/lib/nghttp2_http.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_session.h"
@@ -94,55 +94,7 @@ int nghttp2_http_on_data_chunk(nghttp2_stream *stream, size_t n);
 void nghttp2_http_record_request_method(nghttp2_stream *stream,
                                         nghttp2_frame *frame);
 
-/*
- * RFC 8941 Structured Field Values.
- */
-typedef enum nghttp2_sf_value_type {
-  NGHTTP2_SF_VALUE_TYPE_BOOLEAN,
-  NGHTTP2_SF_VALUE_TYPE_INTEGER,
-  NGHTTP2_SF_VALUE_TYPE_DECIMAL,
-  NGHTTP2_SF_VALUE_TYPE_STRING,
-  NGHTTP2_SF_VALUE_TYPE_TOKEN,
-  NGHTTP2_SF_VALUE_TYPE_BYTESEQ,
-  NGHTTP2_SF_VALUE_TYPE_INNER_LIST,
-} nghttp2_sf_value_type;
-
-/*
- * nghttp2_sf_value stores Structured Field Values item.  For Inner
- * List, only type is set to NGHTTP2_SF_VALUE_TYPE_INNER_LIST.
- */
-typedef struct nghttp2_sf_value {
-  uint8_t type;
-  union {
-    int b;
-    int64_t i;
-    double d;
-    struct {
-      const uint8_t *base;
-      size_t len;
-    } s;
-  };
-} nghttp2_sf_value;
-
-/*
- * nghttp2_sf_parse_item parses the input sequence [|begin|, |end|)
- * and stores the parsed an Item in |dest|.  It returns the number of
- * bytes consumed if it succeeds, or -1.  This function is declared
- * here for unit tests.
- */
-ssize_t nghttp2_sf_parse_item(nghttp2_sf_value *dest, const uint8_t *begin,
-                              const uint8_t *end);
-
-/*
- * nghttp2_sf_parse_inner_list parses the input sequence [|begin|, |end|)
- * and stores the parsed an Inner List in |dest|.  It returns the number of
- * bytes consumed if it succeeds, or -1.  This function is declared
- * here for unit tests.
- */
-ssize_t nghttp2_sf_parse_inner_list(nghttp2_sf_value *dest,
-                                    const uint8_t *begin, const uint8_t *end);
-
 int nghttp2_http_parse_priority(nghttp2_extpri *dest, const uint8_t *value,
                                 size_t valuelen);
 
-#endif /* NGHTTP2_HTTP_H */
+#endif /* !defined(NGHTTP2_HTTP_H) */

+ 7 - 3
Utilities/cmnghttp2/lib/nghttp2_int.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -52,7 +52,11 @@ typedef enum {
    * Unlike NGHTTP2_ERR_IGN_HTTP_HEADER, this does not invoke
    * nghttp2_on_invalid_header_callback.
    */
-  NGHTTP2_ERR_REMOVE_HTTP_HEADER = -106
+  NGHTTP2_ERR_REMOVE_HTTP_HEADER = -106,
+  /*
+   * Cancel pushed stream.
+   */
+  NGHTTP2_ERR_PUSH_CANCEL = -107,
 } nghttp2_internal_error;
 
-#endif /* NGHTTP2_INT_H */
+#endif /* !defined(NGHTTP2_INT_H) */

+ 139 - 138
Utilities/cmnghttp2/lib/nghttp2_map.c

@@ -31,21 +31,14 @@
 
 #include "nghttp2_helper.h"
 
-#define NGHTTP2_INITIAL_TABLE_LENBITS 8
+#define NGHTTP2_INITIAL_HASHBITS 4
 
-int nghttp2_map_init(nghttp2_map *map, nghttp2_mem *mem) {
+void nghttp2_map_init(nghttp2_map *map, uint32_t seed, nghttp2_mem *mem) {
   map->mem = mem;
-  map->tablelen = 1 << NGHTTP2_INITIAL_TABLE_LENBITS;
-  map->tablelenbits = NGHTTP2_INITIAL_TABLE_LENBITS;
-  map->table =
-      nghttp2_mem_calloc(mem, map->tablelen, sizeof(nghttp2_map_bucket));
-  if (map->table == NULL) {
-    return NGHTTP2_ERR_NOMEM;
-  }
-
+  map->hashbits = 0;
+  map->table = NULL;
+  map->seed = seed;
   map->size = 0;
-
-  return 0;
 }
 
 void nghttp2_map_free(nghttp2_map *map) {
@@ -56,29 +49,20 @@ void nghttp2_map_free(nghttp2_map *map) {
   nghttp2_mem_free(map->mem, map->table);
 }
 
-void nghttp2_map_each_free(nghttp2_map *map, int (*func)(void *data, void *ptr),
-                           void *ptr) {
-  uint32_t i;
+int nghttp2_map_each(const nghttp2_map *map, int (*func)(void *data, void *ptr),
+                     void *ptr) {
+  int rv;
+  size_t i;
   nghttp2_map_bucket *bkt;
+  size_t tablelen;
 
-  for (i = 0; i < map->tablelen; ++i) {
-    bkt = &map->table[i];
-
-    if (bkt->data == NULL) {
-      continue;
-    }
-
-    func(bkt->data, ptr);
+  if (map->size == 0) {
+    return 0;
   }
-}
 
-int nghttp2_map_each(nghttp2_map *map, int (*func)(void *data, void *ptr),
-                     void *ptr) {
-  int rv;
-  uint32_t i;
-  nghttp2_map_bucket *bkt;
+  tablelen = 1u << map->hashbits;
 
-  for (i = 0; i < map->tablelen; ++i) {
+  for (i = 0; i < tablelen; ++i) {
     bkt = &map->table[i];
 
     if (bkt->data == NULL) {
@@ -94,80 +78,70 @@ int nghttp2_map_each(nghttp2_map *map, int (*func)(void *data, void *ptr),
   return 0;
 }
 
-static uint32_t hash(nghttp2_map_key_type key) {
-  return (uint32_t)key * 2654435769u;
-}
-
-static size_t h2idx(uint32_t hash, uint32_t bits) {
-  return hash >> (32 - bits);
-}
-
-static size_t distance(uint32_t tablelen, uint32_t tablelenbits,
-                       nghttp2_map_bucket *bkt, size_t idx) {
-  return (idx - h2idx(bkt->hash, tablelenbits)) & (tablelen - 1);
+static size_t map_hash(const nghttp2_map *map, nghttp2_map_key_type key) {
+  /* hasher from
+     https://github.com/rust-lang/rustc-hash/blob/dc5c33f1283de2da64d8d7a06401d91aded03ad4/src/lib.rs
+     We do not perform finalization here because we use top bits
+     anyway. */
+  uint32_t h = ((uint32_t)key + map->seed) * 0x93d765dd;
+  return (size_t)((h * 2654435769u) >> (32 - map->hashbits));
 }
 
-static void map_bucket_swap(nghttp2_map_bucket *bkt, uint32_t *phash,
-                            nghttp2_map_key_type *pkey, void **pdata) {
-  uint32_t h = bkt->hash;
-  nghttp2_map_key_type key = bkt->key;
-  void *data = bkt->data;
+static void map_bucket_swap(nghttp2_map_bucket *a, nghttp2_map_bucket *b) {
+  nghttp2_map_bucket c = *a;
 
-  bkt->hash = *phash;
-  bkt->key = *pkey;
-  bkt->data = *pdata;
-
-  *phash = h;
-  *pkey = key;
-  *pdata = data;
-}
-
-static void map_bucket_set_data(nghttp2_map_bucket *bkt, uint32_t hash,
-                                nghttp2_map_key_type key, void *data) {
-  bkt->hash = hash;
-  bkt->key = key;
-  bkt->data = data;
+  *a = *b;
+  *b = c;
 }
 
-void nghttp2_map_print_distance(nghttp2_map *map) {
-  uint32_t i;
+#ifndef WIN32
+void nghttp2_map_print_distance(const nghttp2_map *map) {
+  size_t i;
   size_t idx;
   nghttp2_map_bucket *bkt;
+  size_t tablelen;
+
+  if (map->size == 0) {
+    return;
+  }
+
+  tablelen = 1u << map->hashbits;
 
-  for (i = 0; i < map->tablelen; ++i) {
+  for (i = 0; i < tablelen; ++i) {
     bkt = &map->table[i];
 
     if (bkt->data == NULL) {
-      fprintf(stderr, "@%u <EMPTY>\n", i);
+      fprintf(stderr, "@%zu <EMPTY>\n", i);
       continue;
     }
 
-    idx = h2idx(bkt->hash, map->tablelenbits);
-    fprintf(stderr, "@%u hash=%08x key=%d base=%zu distance=%zu\n", i,
-            bkt->hash, bkt->key, idx,
-            distance(map->tablelen, map->tablelenbits, bkt, idx));
+    idx = map_hash(map, bkt->key);
+    fprintf(stderr, "@%zu hash=%zu key=%d base=%zu distance=%u\n", i,
+            map_hash(map, bkt->key), bkt->key, idx, bkt->psl);
   }
 }
-
-static int insert(nghttp2_map_bucket *table, uint32_t tablelen,
-                  uint32_t tablelenbits, uint32_t hash,
-                  nghttp2_map_key_type key, void *data) {
-  size_t idx = h2idx(hash, tablelenbits);
-  size_t d = 0, dd;
+#endif /* !defined(WIN32) */
+
+static int map_insert(nghttp2_map *map, nghttp2_map_key_type key, void *data) {
+  size_t idx = map_hash(map, key);
+  nghttp2_map_bucket b = {
+    .key = key,
+    .data = data,
+  };
   nghttp2_map_bucket *bkt;
+  size_t mask = (1u << map->hashbits) - 1;
 
   for (;;) {
-    bkt = &table[idx];
+    bkt = &map->table[idx];
 
     if (bkt->data == NULL) {
-      map_bucket_set_data(bkt, hash, key, data);
+      *bkt = b;
+      ++map->size;
       return 0;
     }
 
-    dd = distance(tablelen, tablelenbits, bkt, idx);
-    if (d > dd) {
-      map_bucket_swap(bkt, &hash, &key, &data);
-      d = dd;
+    if (b.psl > bkt->psl) {
+      map_bucket_swap(bkt, &b);
     } else if (bkt->key == key) {
       /* TODO This check is just a waste after first swap or if this
          function is called from map_resize.  That said, there is no
@@ -176,42 +150,47 @@ static int insert(nghttp2_map_bucket *table, uint32_t tablelen,
       return NGHTTP2_ERR_INVALID_ARGUMENT;
     }
 
-    ++d;
-    idx = (idx + 1) & (tablelen - 1);
+    ++b.psl;
+    idx = (idx + 1) & mask;
   }
 }
 
-/* new_tablelen must be power of 2 and new_tablelen == (1 <<
-   new_tablelenbits) must hold. */
-static int map_resize(nghttp2_map *map, uint32_t new_tablelen,
-                      uint32_t new_tablelenbits) {
-  uint32_t i;
-  nghttp2_map_bucket *new_table;
+static int map_resize(nghttp2_map *map, size_t new_hashbits) {
+  size_t i;
   nghttp2_map_bucket *bkt;
+  size_t tablelen;
   int rv;
+  nghttp2_map new_map = {
+    .table = nghttp2_mem_calloc(map->mem, 1u << new_hashbits,
+                                sizeof(nghttp2_map_bucket)),
+    .mem = map->mem,
+    .seed = map->seed,
+    .hashbits = new_hashbits,
+  };
   (void)rv;
 
-  new_table =
-      nghttp2_mem_calloc(map->mem, new_tablelen, sizeof(nghttp2_map_bucket));
-  if (new_table == NULL) {
+  if (new_map.table == NULL) {
     return NGHTTP2_ERR_NOMEM;
   }
 
-  for (i = 0; i < map->tablelen; ++i) {
-    bkt = &map->table[i];
-    if (bkt->data == NULL) {
-      continue;
-    }
-    rv = insert(new_table, new_tablelen, new_tablelenbits, bkt->hash, bkt->key,
-                bkt->data);
+  if (map->size) {
+    tablelen = 1u << map->hashbits;
+
+    for (i = 0; i < tablelen; ++i) {
+      bkt = &map->table[i];
+      if (bkt->data == NULL) {
+        continue;
+      }
+
+      rv = map_insert(&new_map, bkt->key, bkt->data);
 
-    assert(0 == rv);
+      assert(0 == rv);
+    }
   }
 
   nghttp2_mem_free(map->mem, map->table);
-  map->tablelen = new_tablelen;
-  map->tablelenbits = new_tablelenbits;
-  map->table = new_table;
+  map->table = new_map.table;
+  map->hashbits = new_hashbits;
 
   return 0;
 }
@@ -221,34 +200,48 @@ int nghttp2_map_insert(nghttp2_map *map, nghttp2_map_key_type key, void *data) {
 
   assert(data);
 
-  /* Load factor is 0.75 */
-  if ((map->size + 1) * 4 > map->tablelen * 3) {
-    rv = map_resize(map, map->tablelen * 2, map->tablelenbits + 1);
-    if (rv != 0) {
-      return rv;
+  /* Load factor is 7/8 */
+  /* Under the very initial condition, that is map->size == 0 and
+     map->hashbits == 0, 8 > 7 still holds nicely. */
+  if ((map->size + 1) * 8 > (1u << map->hashbits) * 7) {
+    if (map->hashbits) {
+      rv = map_resize(map, map->hashbits + 1);
+      if (rv != 0) {
+        return rv;
+      }
+    } else {
+      rv = map_resize(map, NGHTTP2_INITIAL_HASHBITS);
+      if (rv != 0) {
+        return rv;
+      }
     }
   }
 
-  rv = insert(map->table, map->tablelen, map->tablelenbits, hash(key), key,
-              data);
+  rv = map_insert(map, key, data);
   if (rv != 0) {
     return rv;
   }
-  ++map->size;
+
   return 0;
 }
 
-void *nghttp2_map_find(nghttp2_map *map, nghttp2_map_key_type key) {
-  uint32_t h = hash(key);
-  size_t idx = h2idx(h, map->tablelenbits);
+void *nghttp2_map_find(const nghttp2_map *map, nghttp2_map_key_type key) {
+  size_t idx;
   nghttp2_map_bucket *bkt;
-  size_t d = 0;
+  size_t psl = 0;
+  size_t mask;
+
+  if (map->size == 0) {
+    return NULL;
+  }
+
+  idx = map_hash(map, key);
+  mask = (1u << map->hashbits) - 1;
 
   for (;;) {
     bkt = &map->table[idx];
 
-    if (bkt->data == NULL ||
-        d > distance(map->tablelen, map->tablelenbits, bkt, idx)) {
+    if (bkt->data == NULL || psl > bkt->psl) {
       return NULL;
     }
 
@@ -256,43 +249,47 @@ void *nghttp2_map_find(nghttp2_map *map, nghttp2_map_key_type key) {
       return bkt->data;
     }
 
-    ++d;
-    idx = (idx + 1) & (map->tablelen - 1);
+    ++psl;
+    idx = (idx + 1) & mask;
   }
 }
 
 int nghttp2_map_remove(nghttp2_map *map, nghttp2_map_key_type key) {
-  uint32_t h = hash(key);
-  size_t idx = h2idx(h, map->tablelenbits), didx;
-  nghttp2_map_bucket *bkt;
-  size_t d = 0;
+  size_t idx;
+  nghttp2_map_bucket *b, *bkt;
+  size_t psl = 0;
+  size_t mask;
+
+  if (map->size == 0) {
+    return NGHTTP2_ERR_INVALID_ARGUMENT;
+  }
+
+  idx = map_hash(map, key);
+  mask = (1u << map->hashbits) - 1;
 
   for (;;) {
     bkt = &map->table[idx];
 
-    if (bkt->data == NULL ||
-        d > distance(map->tablelen, map->tablelenbits, bkt, idx)) {
+    if (bkt->data == NULL || psl > bkt->psl) {
       return NGHTTP2_ERR_INVALID_ARGUMENT;
     }
 
     if (bkt->key == key) {
-      map_bucket_set_data(bkt, 0, 0, NULL);
-
-      didx = idx;
-      idx = (idx + 1) & (map->tablelen - 1);
+      b = bkt;
+      idx = (idx + 1) & mask;
 
       for (;;) {
         bkt = &map->table[idx];
-        if (bkt->data == NULL ||
-            distance(map->tablelen, map->tablelenbits, bkt, idx) == 0) {
+        if (bkt->data == NULL || bkt->psl == 0) {
+          b->data = NULL;
           break;
         }
 
-        map->table[didx] = *bkt;
-        map_bucket_set_data(bkt, 0, 0, NULL);
-        didx = idx;
+        --bkt->psl;
+        *b = *bkt;
+        b = bkt;
 
-        idx = (idx + 1) & (map->tablelen - 1);
+        idx = (idx + 1) & mask;
       }
 
       --map->size;
@@ -300,14 +297,18 @@ int nghttp2_map_remove(nghttp2_map *map, nghttp2_map_key_type key) {
       return 0;
     }
 
-    ++d;
-    idx = (idx + 1) & (map->tablelen - 1);
+    ++psl;
+    idx = (idx + 1) & mask;
   }
 }
 
 void nghttp2_map_clear(nghttp2_map *map) {
-  memset(map->table, 0, sizeof(*map->table) * map->tablelen);
+  if (map->size == 0) {
+    return;
+  }
+
+  memset(map->table, 0, sizeof(*map->table) * (1u << map->hashbits));
   map->size = 0;
 }
 
-size_t nghttp2_map_size(nghttp2_map *map) { return map->size; }
+size_t nghttp2_map_size(const nghttp2_map *map) { return map->size; }

+ 31 - 44
Utilities/cmnghttp2/lib/nghttp2_map.h

@@ -28,7 +28,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -39,7 +39,7 @@
 typedef int32_t nghttp2_map_key_type;
 
 typedef struct nghttp2_map_bucket {
-  uint32_t hash;
+  uint32_t psl;
   nghttp2_map_key_type key;
   void *data;
 } nghttp2_map_bucket;
@@ -47,40 +47,26 @@ typedef struct nghttp2_map_bucket {
 typedef struct nghttp2_map {
   nghttp2_map_bucket *table;
   nghttp2_mem *mem;
+  uint32_t seed;
   size_t size;
-  uint32_t tablelen;
-  uint32_t tablelenbits;
+  size_t hashbits;
 } nghttp2_map;
 
 /*
- * Initializes the map |map|.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *   Out of memory
+ * nghttp2_map_init initializes the map |map|.
  */
-int nghttp2_map_init(nghttp2_map *map, nghttp2_mem *mem);
+void nghttp2_map_init(nghttp2_map *map, uint32_t seed, nghttp2_mem *mem);
 
 /*
- * Deallocates any resources allocated for |map|. The stored entries
- * are not freed by this function. Use nghttp2_map_each_free() to free
- * each entries.
+ * nghttp2_map_free deallocates any resources allocated for |map|.
+ * The stored entries are not freed by this function.  Use
+ * nghttp2_map_each() to free each entry.
  */
 void nghttp2_map_free(nghttp2_map *map);
 
 /*
- * Deallocates each entries using |func| function and any resources
- * allocated for |map|. The |func| function is responsible for freeing
- * given the |data| object. The |ptr| will be passed to the |func| as
- * send argument. The return value of the |func| will be ignored.
- */
-void nghttp2_map_each_free(nghttp2_map *map, int (*func)(void *data, void *ptr),
-                           void *ptr);
-
-/*
- * Inserts the new |data| with the |key| to the map |map|.
+ * nghttp2_map_insert inserts the new |data| with the |key| to the map
+ * |map|.
  *
  * This function returns 0 if it succeeds, or one of the following
  * negative error codes:
@@ -88,55 +74,56 @@ void nghttp2_map_each_free(nghttp2_map *map, int (*func)(void *data, void *ptr),
  * NGHTTP2_ERR_INVALID_ARGUMENT
  *     The item associated by |key| already exists.
  * NGHTTP2_ERR_NOMEM
- *   Out of memory
+ *     Out of memory
  */
 int nghttp2_map_insert(nghttp2_map *map, nghttp2_map_key_type key, void *data);
 
 /*
- * Returns the data associated by the key |key|.  If there is no such
- * data, this function returns NULL.
+ * nghttp2_map_find returns the entry associated by the key |key|.  If
+ * there is no such entry, this function returns NULL.
  */
-void *nghttp2_map_find(nghttp2_map *map, nghttp2_map_key_type key);
+void *nghttp2_map_find(const nghttp2_map *map, nghttp2_map_key_type key);
 
 /*
- * Removes the data associated by the key |key| from the |map|.  The
- * removed data is not freed by this function.
+ * nghttp2_map_remove removes the entry associated by the key |key|
+ * from the |map|.  The removed entry is not freed by this function.
  *
  * This function returns 0 if it succeeds, or one of the following
  * negative error codes:
  *
  * NGHTTP2_ERR_INVALID_ARGUMENT
- *     The data associated by |key| does not exist.
+ *     The entry associated by |key| does not exist.
  */
 int nghttp2_map_remove(nghttp2_map *map, nghttp2_map_key_type key);
 
 /*
- * Removes all entries from |map|.
+ * nghttp2_map_clear removes all entries from |map|.  The removed
+ * entry is not freed by this function.
  */
 void nghttp2_map_clear(nghttp2_map *map);
 
 /*
- * Returns the number of items stored in the map |map|.
+ * nghttp2_map_size returns the number of items stored in the map
+ * |map|.
  */
-size_t nghttp2_map_size(nghttp2_map *map);
+size_t nghttp2_map_size(const nghttp2_map *map);
 
 /*
- * Applies the function |func| to each data in the |map| with the
- * optional user supplied pointer |ptr|.
+ * nghttp2_map_each applies the function |func| to each entry in the
+ * |map| with the optional user supplied pointer |ptr|.
  *
  * If the |func| returns 0, this function calls the |func| with the
- * next data.  If the |func| returns nonzero, it will not call the
+ * next entry.  If the |func| returns nonzero, it will not call the
  * |func| for further entries and return the return value of the
  * |func| immediately.  Thus, this function returns 0 if all the
  * invocations of the |func| return 0, or nonzero value which the last
  * invocation of |func| returns.
- *
- * Don't use this function to free each data. Use
- * nghttp2_map_each_free() instead.
  */
-int nghttp2_map_each(nghttp2_map *map, int (*func)(void *data, void *ptr),
+int nghttp2_map_each(const nghttp2_map *map, int (*func)(void *data, void *ptr),
                      void *ptr);
 
-void nghttp2_map_print_distance(nghttp2_map *map);
+#ifndef WIN32
+void nghttp2_map_print_distance(const nghttp2_map *map);
+#endif /* !defined(WIN32) */
 
-#endif /* NGHTTP2_MAP_H */
+#endif /* !defined(NGHTTP2_MAP_H) */

+ 2 - 2
Utilities/cmnghttp2/lib/nghttp2_mem.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -42,4 +42,4 @@ void nghttp2_mem_free2(nghttp2_free free_func, void *ptr, void *mem_user_data);
 void *nghttp2_mem_calloc(nghttp2_mem *mem, size_t nmemb, size_t size);
 void *nghttp2_mem_realloc(nghttp2_mem *mem, void *ptr, size_t size);
 
-#endif /* NGHTTP2_MEM_H */
+#endif /* !defined(NGHTTP2_MEM_H) */

+ 8 - 8
Utilities/cmnghttp2/lib/nghttp2_net.h

@@ -27,28 +27,28 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #ifdef HAVE_ARPA_INET_H
 #  include <arpa/inet.h>
-#endif /* HAVE_ARPA_INET_H */
+#endif /* defined(HAVE_ARPA_INET_H) */
 
 #ifdef HAVE_NETINET_IN_H
 #  include <netinet/in.h>
-#endif /* HAVE_NETINET_IN_H */
+#endif /* defined(HAVE_NETINET_IN_H) */
 
 #include <nghttp2/nghttp2.h>
 
-#if defined(WIN32)
+#ifdef WIN32
 /* Windows requires ws2_32 library for ntonl family functions.  We
    define inline functions for those function so that we don't have
    dependency on that lib. */
 
 #  ifdef _MSC_VER
 #    define STIN static __inline
-#  else
+#  else /* !defined(_MSC_VER) */
 #    define STIN static inline
-#  endif
+#  endif /* !defined(_MSC_VER) */
 
 STIN uint32_t htonl(uint32_t hostlong) {
   uint32_t res;
@@ -86,6 +86,6 @@ STIN uint16_t ntohs(uint16_t netshort) {
   return res;
 }
 
-#endif /* WIN32 */
+#endif /* defined(WIN32) */
 
-#endif /* NGHTTP2_NET_H */
+#endif /* !defined(NGHTTP2_NET_H) */

+ 22 - 3
Utilities/cmnghttp2/lib/nghttp2_option.c

@@ -132,14 +132,33 @@ void nghttp2_option_set_max_settings(nghttp2_option *option, size_t val) {
 }
 
 void nghttp2_option_set_server_fallback_rfc7540_priorities(
-    nghttp2_option *option, int val) {
+  nghttp2_option *option, int val) {
   option->opt_set_mask |= NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES;
   option->server_fallback_rfc7540_priorities = val;
 }
 
 void nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation(
-    nghttp2_option *option, int val) {
+  nghttp2_option *option, int val) {
   option->opt_set_mask |=
-      NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION;
+    NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION;
   option->no_rfc9113_leading_and_trailing_ws_validation = val;
 }
+
+void nghttp2_option_set_stream_reset_rate_limit(nghttp2_option *option,
+                                                uint64_t burst, uint64_t rate) {
+  option->opt_set_mask |= NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT;
+  option->stream_reset_burst = burst;
+  option->stream_reset_rate = rate;
+}
+
+void nghttp2_option_set_max_continuations(nghttp2_option *option, size_t val) {
+  option->opt_set_mask |= NGHTTP2_OPT_MAX_CONTINUATIONS;
+  option->max_continuations = val;
+}
+
+void nghttp2_option_set_glitch_rate_limit(nghttp2_option *option,
+                                          uint64_t burst, uint64_t rate) {
+  option->opt_set_mask |= NGHTTP2_OPT_GLITCH_RATE_LIMIT;
+  option->glitch_burst = burst;
+  option->glitch_rate = rate;
+}

+ 19 - 2
Utilities/cmnghttp2/lib/nghttp2_option.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -70,12 +70,25 @@ typedef enum {
   NGHTTP2_OPT_MAX_SETTINGS = 1 << 12,
   NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES = 1 << 13,
   NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION = 1 << 14,
+  NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT = 1 << 15,
+  NGHTTP2_OPT_MAX_CONTINUATIONS = 1 << 16,
+  NGHTTP2_OPT_GLITCH_RATE_LIMIT = 1 << 17,
 } nghttp2_option_flag;
 
 /**
  * Struct to store option values for nghttp2_session.
  */
 struct nghttp2_option {
+  /**
+   * NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT
+   */
+  uint64_t stream_reset_burst;
+  uint64_t stream_reset_rate;
+  /**
+   * NGHTTP2_OPT_GLITCH_RATE_LIMIT
+   */
+  uint64_t glitch_burst;
+  uint64_t glitch_rate;
   /**
    * NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH
    */
@@ -92,6 +105,10 @@ struct nghttp2_option {
    * NGHTTP2_OPT_MAX_SETTINGS
    */
   size_t max_settings;
+  /**
+   * NGHTTP2_OPT_MAX_CONTINUATIONS
+   */
+  size_t max_continuations;
   /**
    * Bitwise OR of nghttp2_option_flag to determine that which fields
    * are specified.
@@ -143,4 +160,4 @@ struct nghttp2_option {
   uint8_t user_recv_ext_types[32];
 };
 
-#endif /* NGHTTP2_OPTION_H */
+#endif /* !defined(NGHTTP2_OPTION_H) */

+ 26 - 0
Utilities/cmnghttp2/lib/nghttp2_outbound_item.c

@@ -27,6 +27,32 @@
 #include <assert.h>
 #include <string.h>
 
+nghttp2_data_provider_wrap *
+nghttp2_data_provider_wrap_v1(nghttp2_data_provider_wrap *dpw,
+                              const nghttp2_data_provider *data_prd) {
+  if (!data_prd) {
+    return NULL;
+  }
+
+  dpw->version = NGHTTP2_DATA_PROVIDER_V1;
+  dpw->data_prd.v1 = *data_prd;
+
+  return dpw;
+}
+
+nghttp2_data_provider_wrap *
+nghttp2_data_provider_wrap_v2(nghttp2_data_provider_wrap *dpw,
+                              const nghttp2_data_provider2 *data_prd) {
+  if (!data_prd) {
+    return NULL;
+  }
+
+  dpw->version = NGHTTP2_DATA_PROVIDER_V2;
+  dpw->data_prd.v2 = *data_prd;
+
+  return dpw;
+}
+
 void nghttp2_outbound_item_init(nghttp2_outbound_item *item) {
   item->cycle = 0;
   item->qnext = NULL;

+ 27 - 4
Utilities/cmnghttp2/lib/nghttp2_outbound_item.h

@@ -27,15 +27,38 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_frame.h"
 #include "nghttp2_mem.h"
 
+#define NGHTTP2_DATA_PROVIDER_V1 1
+#define NGHTTP2_DATA_PROVIDER_V2 2
+
+typedef struct nghttp2_data_provider_wrap {
+  int version;
+  union {
+    struct {
+      nghttp2_data_source source;
+      void *read_callback;
+    };
+    nghttp2_data_provider v1;
+    nghttp2_data_provider2 v2;
+  } data_prd;
+} nghttp2_data_provider_wrap;
+
+nghttp2_data_provider_wrap *
+nghttp2_data_provider_wrap_v1(nghttp2_data_provider_wrap *dpw,
+                              const nghttp2_data_provider *data_prd);
+
+nghttp2_data_provider_wrap *
+nghttp2_data_provider_wrap_v2(nghttp2_data_provider_wrap *dpw,
+                              const nghttp2_data_provider2 *data_prd);
+
 /* struct used for HEADERS and PUSH_PROMISE frame */
 typedef struct {
-  nghttp2_data_provider data_prd;
+  nghttp2_data_provider_wrap dpw;
   void *stream_user_data;
   /* error code when request HEADERS is canceled by RST_STREAM while
      it is in queue. */
@@ -50,7 +73,7 @@ typedef struct {
   /**
    * The data to be sent for this DATA frame.
    */
-  nghttp2_data_provider data_prd;
+  nghttp2_data_provider_wrap dpw;
   /**
    * The flags of DATA frame.  We use separate flags here and
    * nghttp2_data frame.  The latter contains flags actually sent to
@@ -163,4 +186,4 @@ void nghttp2_outbound_queue_pop(nghttp2_outbound_queue *q);
 /* Returns the size of the queue */
 #define nghttp2_outbound_queue_size(Q) ((Q)->n)
 
-#endif /* NGHTTP2_OUTBOUND_ITEM_H */
+#endif /* !defined(NGHTTP2_OUTBOUND_ITEM_H) */

+ 1 - 1
Utilities/cmnghttp2/lib/nghttp2_pq.c

@@ -69,7 +69,7 @@ int nghttp2_pq_push(nghttp2_pq *pq, nghttp2_pq_entry *item) {
     void *nq;
     size_t ncapacity;
 
-    ncapacity = nghttp2_max(4, (pq->capacity * 2));
+    ncapacity = nghttp2_max_size(4, (pq->capacity * 2));
 
     nq = nghttp2_mem_realloc(pq->mem, pq->q,
                              ncapacity * sizeof(nghttp2_pq_entry *));

+ 2 - 2
Utilities/cmnghttp2/lib/nghttp2_pq.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_int.h"
@@ -121,4 +121,4 @@ int nghttp2_pq_each(nghttp2_pq *pq, nghttp2_pq_item_cb fun, void *arg);
  */
 void nghttp2_pq_remove(nghttp2_pq *pq, nghttp2_pq_entry *item);
 
-#endif /* NGHTTP2_PQ_H */
+#endif /* !defined(NGHTTP2_PQ_H) */

+ 2 - 2
Utilities/cmnghttp2/lib/nghttp2_priority_spec.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -39,4 +39,4 @@
  */
 void nghttp2_priority_spec_normalize_weight(nghttp2_priority_spec *pri_spec);
 
-#endif /* NGHTTP2_PRIORITY_SPEC_H */
+#endif /* !defined(NGHTTP2_PRIORITY_SPEC_H) */

+ 1 - 1
Utilities/cmnghttp2/lib/nghttp2_queue.c

@@ -46,7 +46,7 @@ void nghttp2_queue_free(nghttp2_queue *queue) {
 
 int nghttp2_queue_push(nghttp2_queue *queue, void *data) {
   nghttp2_queue_cell *new_cell =
-      (nghttp2_queue_cell *)malloc(sizeof(nghttp2_queue_cell));
+    (nghttp2_queue_cell *)malloc(sizeof(nghttp2_queue_cell));
   if (!new_cell) {
     return NGHTTP2_ERR_NOMEM;
   }

+ 2 - 2
Utilities/cmnghttp2/lib/nghttp2_queue.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -48,4 +48,4 @@ void *nghttp2_queue_front(nghttp2_queue *queue);
 void *nghttp2_queue_back(nghttp2_queue *queue);
 int nghttp2_queue_empty(nghttp2_queue *queue);
 
-#endif /* NGHTTP2_QUEUE_H */
+#endif /* !defined(NGHTTP2_QUEUE_H) */

+ 75 - 0
Utilities/cmnghttp2/lib/nghttp2_ratelim.c

@@ -0,0 +1,75 @@
+/*
+ * nghttp2 - HTTP/2 C Library
+ *
+ * Copyright (c) 2023 nghttp2 contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "nghttp2_ratelim.h"
+#include "nghttp2_helper.h"
+
+void nghttp2_ratelim_init(nghttp2_ratelim *rl, uint64_t burst, uint64_t rate) {
+  rl->val = rl->burst = burst;
+  rl->rate = rate;
+  rl->tstamp = 0;
+}
+
+void nghttp2_ratelim_update(nghttp2_ratelim *rl, uint64_t tstamp) {
+  uint64_t d, gain;
+
+  if (tstamp == rl->tstamp) {
+    return;
+  }
+
+  if (tstamp > rl->tstamp) {
+    d = tstamp - rl->tstamp;
+  } else {
+    d = 1;
+  }
+
+  rl->tstamp = tstamp;
+
+  if (UINT64_MAX / d < rl->rate) {
+    rl->val = rl->burst;
+
+    return;
+  }
+
+  gain = rl->rate * d;
+
+  if (UINT64_MAX - gain < rl->val) {
+    rl->val = rl->burst;
+
+    return;
+  }
+
+  rl->val += gain;
+  rl->val = nghttp2_min_uint64(rl->val, rl->burst);
+}
+
+int nghttp2_ratelim_drain(nghttp2_ratelim *rl, uint64_t n) {
+  if (rl->val < n) {
+    return -1;
+  }
+
+  rl->val -= n;
+
+  return 0;
+}

+ 57 - 0
Utilities/cmnghttp2/lib/nghttp2_ratelim.h

@@ -0,0 +1,57 @@
+/*
+ * nghttp2 - HTTP/2 C Library
+ *
+ * Copyright (c) 2023 nghttp2 contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef NGHTTP2_RATELIM_H
+#define NGHTTP2_RATELIM_H
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif /* defined(HAVE_CONFIG_H) */
+
+#include <nghttp2/nghttp2.h>
+
+typedef struct nghttp2_ratelim {
+  /* burst is the maximum value of val. */
+  uint64_t burst;
+  /* rate is the amount of value that is regenerated per 1 tstamp. */
+  uint64_t rate;
+  /* val is the amount of value available to drain. */
+  uint64_t val;
+  /* tstamp is the last timestamp in second resolution that is known
+     to this object. */
+  uint64_t tstamp;
+} nghttp2_ratelim;
+
+/* nghttp2_ratelim_init initializes |rl| with the given parameters. */
+void nghttp2_ratelim_init(nghttp2_ratelim *rl, uint64_t burst, uint64_t rate);
+
+/* nghttp2_ratelim_update updates rl->val with the current |tstamp|
+   given in second resolution. */
+void nghttp2_ratelim_update(nghttp2_ratelim *rl, uint64_t tstamp);
+
+/* nghttp2_ratelim_drain drains |n| from rl->val.  It returns 0 if it
+   succeeds, or -1. */
+int nghttp2_ratelim_drain(nghttp2_ratelim *rl, uint64_t n);
+
+#endif /* !defined(NGHTTP2_RATELIM_H) */

+ 2 - 2
Utilities/cmnghttp2/lib/nghttp2_rcbuf.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
@@ -77,4 +77,4 @@ int nghttp2_rcbuf_new2(nghttp2_rcbuf **rcbuf_ptr, const uint8_t *src,
  */
 void nghttp2_rcbuf_del(nghttp2_rcbuf *rcbuf);
 
-#endif /* NGHTTP2_RCBUF_H */
+#endif /* !defined(NGHTTP2_RCBUF_H) */

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 147 - 504
Utilities/cmnghttp2/lib/nghttp2_session.c


+ 50 - 119
Utilities/cmnghttp2/lib/nghttp2_session.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_map.h"
@@ -39,11 +39,14 @@
 #include "nghttp2_buf.h"
 #include "nghttp2_callbacks.h"
 #include "nghttp2_mem.h"
+#include "nghttp2_ratelim.h"
 
 /* The global variable for tests where we want to disable strict
    preface handling. */
 extern int nghttp2_enable_strict_preface;
 
+extern nghttp2_stream nghttp2_stream_root;
+
 /*
  * Option flags.
  */
@@ -52,8 +55,6 @@ typedef enum {
   NGHTTP2_OPTMASK_NO_RECV_CLIENT_MAGIC = 1 << 1,
   NGHTTP2_OPTMASK_NO_HTTP_MESSAGING = 1 << 2,
   NGHTTP2_OPTMASK_NO_AUTO_PING_ACK = 1 << 3,
-  NGHTTP2_OPTMASK_NO_CLOSED_STREAMS = 1 << 4,
-  NGHTTP2_OPTMASK_SERVER_FALLBACK_RFC7540_PRIORITIES = 1 << 5,
   NGHTTP2_OPTMASK_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION = 1 << 6,
 } nghttp2_optmask;
 
@@ -88,10 +89,6 @@ typedef struct {
 /* The default maximum number of incoming reserved streams */
 #define NGHTTP2_MAX_INCOMING_RESERVED_STREAMS 200
 
-/* Even if we have less SETTINGS_MAX_CONCURRENT_STREAMS than this
-   number, we keep NGHTTP2_MIN_IDLE_STREAMS streams in idle state */
-#define NGHTTP2_MIN_IDLE_STREAMS 16
-
 /* The maximum number of items in outbound queue, which is considered
    as flooding caused by peer.  All frames are not considered here.
    We only consider PING + ACK and SETTINGS + ACK.  This is because
@@ -105,6 +102,18 @@ typedef struct {
 /* The default value of maximum number of concurrent streams. */
 #define NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS 0xffffffffu
 
+/* The default values for stream reset rate limiter. */
+#define NGHTTP2_DEFAULT_STREAM_RESET_BURST 1000
+#define NGHTTP2_DEFAULT_STREAM_RESET_RATE 33
+
+/* The default values for glitch rate limiter. */
+#define NGHTTP2_DEFAULT_GLITCH_BURST 1000
+#define NGHTTP2_DEFAULT_GLITCH_RATE 33
+
+/* The default max number of CONTINUATION frames following an incoming
+   HEADER frame. */
+#define NGHTTP2_DEFAULT_MAX_CONTINUATIONS 8
+
 /* Internal state when receiving incoming frame */
 typedef enum {
   /* Receiving frame header */
@@ -178,7 +187,9 @@ typedef enum {
   /* Flag means GOAWAY was sent */
   NGHTTP2_GOAWAY_SENT = 0x4,
   /* Flag means GOAWAY was received */
-  NGHTTP2_GOAWAY_RECV = 0x8
+  NGHTTP2_GOAWAY_RECV = 0x8,
+  /* Flag means GOAWAY has been submitted at least once */
+  NGHTTP2_GOAWAY_SUBMITTED = 0x10
 } nghttp2_goaway_flag;
 
 /* nghttp2_inflight_settings stores the SETTINGS entries which local
@@ -194,8 +205,6 @@ typedef struct nghttp2_inflight_settings nghttp2_inflight_settings;
 
 struct nghttp2_session {
   nghttp2_map /* <nghttp2_stream*> */ streams;
-  /* root of dependency tree*/
-  nghttp2_stream root;
   /* Queue for outbound urgent frames (PING and SETTINGS) */
   nghttp2_outbound_queue ob_urgent;
   /* Queue for non-DATA frames */
@@ -218,23 +227,14 @@ struct nghttp2_session {
   /* Memory allocator */
   nghttp2_mem mem;
   void *user_data;
-  /* Points to the latest incoming closed stream.  NULL if there is no
-     closed stream.  Only used when session is initialized as
-     server. */
-  nghttp2_stream *closed_stream_head;
-  /* Points to the oldest incoming closed stream.  NULL if there is no
-     closed stream.  Only used when session is initialized as
-     server. */
-  nghttp2_stream *closed_stream_tail;
-  /* Points to the latest idle stream.  NULL if there is no idle
-     stream.  Only used when session is initialized as server .*/
-  nghttp2_stream *idle_stream_head;
-  /* Points to the oldest idle stream.  NULL if there is no idle
-     stream.  Only used when session is initialized as erver. */
-  nghttp2_stream *idle_stream_tail;
   /* Queue of In-flight SETTINGS values.  SETTINGS bearing ACK is not
      considered as in-flight. */
   nghttp2_inflight_settings *inflight_settings_head;
+  /* Stream reset rate limiter.  If receiving excessive amount of
+     stream resets, GOAWAY will be sent. */
+  nghttp2_ratelim stream_reset_ratelim;
+  /* Rate limiter for all kinds of glitches. */
+  nghttp2_ratelim glitch_ratelim;
   /* Sequential number across all streams to process streams in
      FIFO. */
   uint64_t stream_seq;
@@ -262,10 +262,9 @@ struct nghttp2_session {
      |closed_stream_head|.  The current implementation only keeps
      incoming streams and session is initialized as server. */
   size_t num_closed_streams;
-  /* The number of idle streams kept in |streams| hash.  The idle
-     streams can be accessed through doubly linked list
-     |idle_stream_head|.  The current implementation only keeps idle
-     streams if session is initialized as server. */
+  /* The number of idle streams kept in |streams| hash.  The current
+     implementation only keeps idle streams if session is initialized
+     as server. */
   size_t num_idle_streams;
   /* The number of bytes allocated for nvbuf */
   size_t nvbuflen;
@@ -280,6 +279,12 @@ struct nghttp2_session {
   size_t max_send_header_block_length;
   /* The maximum number of settings accepted per SETTINGS frame. */
   size_t max_settings;
+  /* The maximum number of CONTINUATION frames following an incoming
+     HEADER frame. */
+  size_t max_continuations;
+  /* The number of CONTINUATION frames following an incoming HEADER
+     frame.  This variable is reset when END_HEADERS flag is seen. */
+  size_t num_continuations;
   /* Next Stream ID. Made unsigned int to detect >= (1 << 31). */
   uint32_t next_stream_id;
   /* The last stream ID this session initiated.  For client session,
@@ -342,8 +347,6 @@ struct nghttp2_session {
   /* Unacked local SETTINGS_NO_RFC7540_PRIORITIES value, which is
      effective before it is acknowledged. */
   uint8_t pending_no_rfc7540_priorities;
-  /* Turn on fallback to RFC 7540 priorities; for server use only. */
-  uint8_t fallback_rfc7540_priorities;
   /* Nonzero if the session is server side. */
   uint8_t server;
   /* Flags indicating GOAWAY is sent and/or received. The flags are
@@ -405,6 +408,13 @@ int nghttp2_session_is_my_stream_id(nghttp2_session *session,
 int nghttp2_session_add_item(nghttp2_session *session,
                              nghttp2_outbound_item *item);
 
+/*
+ * This function wraps around nghttp2_session_add_rst_stream_continue
+ * with continue_without_stream = 1.
+ */
+int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id,
+                                   uint32_t error_code);
+
 /*
  * Adds RST_STREAM frame for the stream |stream_id| with the error
  * code |error_code|. This is a convenient function built on top of
@@ -412,7 +422,9 @@ int nghttp2_session_add_item(nghttp2_session *session,
  *
  * This function simply returns 0 without adding RST_STREAM frame if
  * given stream is in NGHTTP2_STREAM_CLOSING state, because multiple
- * RST_STREAM for a stream is redundant.
+ * RST_STREAM for a stream is redundant.  It also returns 0 without
+ * adding the frame if |continue_without_stream| is nonzero, and
+ * stream was already gone.
  *
  * This function returns 0 if it succeeds, or one of the following
  * negative error codes:
@@ -420,8 +432,10 @@ int nghttp2_session_add_item(nghttp2_session *session,
  * NGHTTP2_ERR_NOMEM
  *     Out of memory.
  */
-int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id,
-                                   uint32_t error_code);
+int nghttp2_session_add_rst_stream_continue(nghttp2_session *session,
+                                            int32_t stream_id,
+                                            uint32_t error_code,
+                                            int continue_without_stream);
 
 /*
  * Adds PING frame. This is a convenient function built on top of
@@ -507,15 +521,9 @@ int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,
  *
  * This function returns a pointer to created new stream object, or
  * NULL.
- *
- * This function adjusts neither the number of closed streams or idle
- * streams.  The caller should manually call
- * nghttp2_session_adjust_closed_stream() or
- * nghttp2_session_adjust_idle_stream() respectively.
  */
 nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session,
                                             int32_t stream_id, uint8_t flags,
-                                            nghttp2_priority_spec *pri_spec,
                                             nghttp2_stream_state initial_state,
                                             void *stream_user_data);
 
@@ -524,11 +532,6 @@ nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session,
  * is indicated by the |error_code|. When closing the stream,
  * on_stream_close_callback will be called.
  *
- * If the session is initialized as server and |stream| is incoming
- * stream, stream is just marked closed and this function calls
- * nghttp2_session_keep_closed_stream() with |stream|.  Otherwise,
- * |stream| will be deleted from memory.
- *
  * This function returns 0 if it succeeds, or one the following
  * negative error codes:
  *
@@ -545,63 +548,9 @@ int nghttp2_session_close_stream(nghttp2_session *session, int32_t stream_id,
 /*
  * Deletes |stream| from memory.  After this function returns, stream
  * cannot be accessed.
- *
- * This function returns 0 if it succeeds, or one the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
  */
-int nghttp2_session_destroy_stream(nghttp2_session *session,
-                                   nghttp2_stream *stream);
-
-/*
- * Tries to keep incoming closed stream |stream|.  Due to the
- * limitation of maximum number of streams in memory, |stream| is not
- * closed and just deleted from memory (see
- * nghttp2_session_destroy_stream).
- */
-void nghttp2_session_keep_closed_stream(nghttp2_session *session,
-                                        nghttp2_stream *stream);
-
-/*
- * Appends |stream| to linked list |session->idle_stream_head|.  We
- * apply fixed limit for list size.  To fit into that limit, one or
- * more oldest streams are removed from list as necessary.
- */
-void nghttp2_session_keep_idle_stream(nghttp2_session *session,
-                                      nghttp2_stream *stream);
-
-/*
- * Detaches |stream| from idle streams linked list.
- */
-void nghttp2_session_detach_idle_stream(nghttp2_session *session,
-                                        nghttp2_stream *stream);
-
-/*
- * Deletes closed stream to ensure that number of incoming streams
- * including active and closed is in the maximum number of allowed
- * stream.
- *
- * This function returns 0 if it succeeds, or one the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_session_adjust_closed_stream(nghttp2_session *session);
-
-/*
- * Deletes idle stream to ensure that number of idle streams is in
- * certain limit.
- *
- * This function returns 0 if it succeeds, or one the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_session_adjust_idle_stream(nghttp2_session *session);
+void nghttp2_session_destroy_stream(nghttp2_session *session,
+                                    nghttp2_stream *stream);
 
 /*
  * If further receptions and transmissions over the stream |stream_id|
@@ -895,24 +844,6 @@ int nghttp2_session_update_local_settings(nghttp2_session *session,
                                           nghttp2_settings_entry *iv,
                                           size_t niv);
 
-/*
- * Re-prioritize |stream|. The new priority specification is
- * |pri_spec|.  Caller must ensure that stream->hd.stream_id !=
- * pri_spec->stream_id.
- *
- * This function does not adjust the number of idle streams.  The
- * caller should call nghttp2_session_adjust_idle_stream() later.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_session_reprioritize_stream(nghttp2_session *session,
-                                        nghttp2_stream *stream,
-                                        const nghttp2_priority_spec *pri_spec);
-
 /*
  * Terminates current |session| with the |error_code|.  The |reason|
  * is NULL-terminated debug string.
@@ -961,4 +892,4 @@ int nghttp2_session_update_recv_stream_window_size(nghttp2_session *session,
                                                    size_t delta_size,
                                                    int send_window_update);
 
-#endif /* NGHTTP2_SESSION_H */
+#endif /* !defined(NGHTTP2_SESSION_H) */

+ 34 - 827
Utilities/cmnghttp2/lib/nghttp2_stream.c

@@ -25,45 +25,17 @@
 #include "nghttp2_stream.h"
 
 #include <assert.h>
-#include <stdio.h>
 
 #include "nghttp2_session.h"
 #include "nghttp2_helper.h"
 #include "nghttp2_debug.h"
 #include "nghttp2_frame.h"
 
-/* Maximum distance between any two stream's cycle in the same
-   priority queue.  Imagine stream A's cycle is A, and stream B's
-   cycle is B, and A < B.  The cycle is unsigned 32 bit integer, it
-   may get overflow.  Because of how we calculate the next cycle
-   value, if B - A is less than or equals to
-   NGHTTP2_MAX_CYCLE_DISTANCE, A and B are in the same scale, in other
-   words, B is really greater than or equal to A.  Otherwise, A is a
-   result of overflow, and it is actually A > B if we consider that
-   fact. */
-#define NGHTTP2_MAX_CYCLE_DISTANCE                                             \
-  ((uint64_t)NGHTTP2_MAX_FRAME_SIZE_MAX * 256 + 255)
-
-static int stream_less(const void *lhsx, const void *rhsx) {
-  const nghttp2_stream *lhs, *rhs;
-
-  lhs = nghttp2_struct_of(lhsx, nghttp2_stream, pq_entry);
-  rhs = nghttp2_struct_of(rhsx, nghttp2_stream, pq_entry);
-
-  if (lhs->cycle == rhs->cycle) {
-    return lhs->seq < rhs->seq;
-  }
-
-  return rhs->cycle - lhs->cycle <= NGHTTP2_MAX_CYCLE_DISTANCE;
-}
-
 void nghttp2_stream_init(nghttp2_stream *stream, int32_t stream_id,
                          uint8_t flags, nghttp2_stream_state initial_state,
-                         int32_t weight, int32_t remote_initial_window_size,
+                         int32_t remote_initial_window_size,
                          int32_t local_initial_window_size,
-                         void *stream_user_data, nghttp2_mem *mem) {
-  nghttp2_pq_init(&stream->obq, stream_less, mem);
-
+                         void *stream_user_data) {
   stream->stream_id = stream_id;
   stream->flags = flags;
   stream->state = initial_state;
@@ -77,477 +49,62 @@ void nghttp2_stream_init(nghttp2_stream *stream, int32_t stream_id,
   stream->recv_reduction = 0;
   stream->window_update_queued = 0;
 
-  stream->dep_prev = NULL;
-  stream->dep_next = NULL;
-  stream->sib_prev = NULL;
-  stream->sib_next = NULL;
-
-  stream->closed_prev = NULL;
   stream->closed_next = NULL;
 
-  stream->weight = weight;
-  stream->sum_dep_weight = 0;
-
   stream->http_flags = NGHTTP2_HTTP_FLAG_NONE;
   stream->content_length = -1;
   stream->recv_content_length = 0;
   stream->status_code = -1;
 
   stream->queued = 0;
-  stream->descendant_last_cycle = 0;
   stream->cycle = 0;
   stream->pending_penalty = 0;
-  stream->descendant_next_seq = 0;
   stream->seq = 0;
   stream->last_writelen = 0;
 
   stream->extpri = stream->http_extpri = NGHTTP2_EXTPRI_DEFAULT_URGENCY;
 }
 
-void nghttp2_stream_free(nghttp2_stream *stream) {
-  nghttp2_pq_free(&stream->obq);
-  /* We don't free stream->item.  If it is assigned to aob, then
-     active_outbound_item_reset() will delete it.  Otherwise,
-     nghttp2_stream_close() or session_del() will delete it. */
-}
+void nghttp2_stream_free(nghttp2_stream *stream) { (void)stream; }
 
 void nghttp2_stream_shutdown(nghttp2_stream *stream, nghttp2_shut_flag flag) {
   stream->shut_flags = (uint8_t)(stream->shut_flags | flag);
 }
 
-/*
- * Returns nonzero if |stream| is active.  This function does not take
- * into account its descendants.
- */
-static int stream_active(nghttp2_stream *stream) {
-  return stream->item &&
-         (stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) == 0;
-}
-
-/*
- * Returns nonzero if |stream| or one of its descendants is active
- */
-static int stream_subtree_active(nghttp2_stream *stream) {
-  return stream_active(stream) || !nghttp2_pq_empty(&stream->obq);
-}
-
-/*
- * Returns next cycle for |stream|.
- */
-static void stream_next_cycle(nghttp2_stream *stream, uint64_t last_cycle) {
-  uint64_t penalty;
-
-  penalty = (uint64_t)stream->last_writelen * NGHTTP2_MAX_WEIGHT +
-            stream->pending_penalty;
-
-  stream->cycle = last_cycle + penalty / (uint32_t)stream->weight;
-  stream->pending_penalty = (uint32_t)(penalty % (uint32_t)stream->weight);
-}
-
-static int stream_obq_push(nghttp2_stream *dep_stream, nghttp2_stream *stream) {
-  int rv;
-
-  for (; dep_stream && !stream->queued;
-       stream = dep_stream, dep_stream = dep_stream->dep_prev) {
-    stream_next_cycle(stream, dep_stream->descendant_last_cycle);
-    stream->seq = dep_stream->descendant_next_seq++;
-
-    DEBUGF("stream: stream=%d obq push cycle=%lu\n", stream->stream_id,
-           stream->cycle);
-
-    DEBUGF("stream: push stream %d to stream %d\n", stream->stream_id,
-           dep_stream->stream_id);
-
-    rv = nghttp2_pq_push(&dep_stream->obq, &stream->pq_entry);
-    if (rv != 0) {
-      return rv;
-    }
-    stream->queued = 1;
-  }
-
-  return 0;
-}
-
-/*
- * Removes |stream| from parent's obq.  If removal of |stream| makes
- * parent's obq empty, and parent is not active, then parent is also
- * removed.  This process is repeated recursively.
- */
-static void stream_obq_remove(nghttp2_stream *stream) {
-  nghttp2_stream *dep_stream;
-
-  dep_stream = stream->dep_prev;
-
-  if (!stream->queued) {
-    return;
-  }
-
-  for (; dep_stream; stream = dep_stream, dep_stream = dep_stream->dep_prev) {
-    DEBUGF("stream: remove stream %d from stream %d\n", stream->stream_id,
-           dep_stream->stream_id);
-
-    nghttp2_pq_remove(&dep_stream->obq, &stream->pq_entry);
-
-    assert(stream->queued);
-
-    stream->queued = 0;
-    stream->cycle = 0;
-    stream->pending_penalty = 0;
-    stream->descendant_last_cycle = 0;
-    stream->last_writelen = 0;
-
-    if (stream_subtree_active(dep_stream)) {
-      return;
-    }
-  }
-}
-
-/*
- * Moves |stream| from |src|'s obq to |dest|'s obq.  Removal from
- * |src|'s obq is just done calling nghttp2_pq_remove(), so it does
- * not recursively remove |src| and ancestors, like
- * stream_obq_remove().
- */
-static int stream_obq_move(nghttp2_stream *dest, nghttp2_stream *src,
-                           nghttp2_stream *stream) {
-  if (!stream->queued) {
-    return 0;
-  }
-
-  DEBUGF("stream: remove stream %d from stream %d (move)\n", stream->stream_id,
-         src->stream_id);
-
-  nghttp2_pq_remove(&src->obq, &stream->pq_entry);
-  stream->queued = 0;
-
-  return stream_obq_push(dest, stream);
-}
-
-void nghttp2_stream_reschedule(nghttp2_stream *stream) {
-  nghttp2_stream *dep_stream;
-
-  assert(stream->queued);
-
-  dep_stream = stream->dep_prev;
-
-  for (; dep_stream; stream = dep_stream, dep_stream = dep_stream->dep_prev) {
-    nghttp2_pq_remove(&dep_stream->obq, &stream->pq_entry);
-
-    stream_next_cycle(stream, dep_stream->descendant_last_cycle);
-    stream->seq = dep_stream->descendant_next_seq++;
-
-    nghttp2_pq_push(&dep_stream->obq, &stream->pq_entry);
-
-    DEBUGF("stream: stream=%d obq resched cycle=%lu\n", stream->stream_id,
-           stream->cycle);
-
-    dep_stream->last_writelen = stream->last_writelen;
-  }
-}
-
-void nghttp2_stream_change_weight(nghttp2_stream *stream, int32_t weight) {
-  nghttp2_stream *dep_stream;
-  uint64_t last_cycle;
-  int32_t old_weight;
-  uint64_t wlen_penalty;
-
-  if (stream->weight == weight) {
-    return;
-  }
-
-  old_weight = stream->weight;
-  stream->weight = weight;
-
-  dep_stream = stream->dep_prev;
-
-  if (!dep_stream) {
-    return;
-  }
-
-  dep_stream->sum_dep_weight += weight - old_weight;
-
-  if (!stream->queued) {
-    return;
-  }
-
-  nghttp2_pq_remove(&dep_stream->obq, &stream->pq_entry);
-
-  wlen_penalty = (uint64_t)stream->last_writelen * NGHTTP2_MAX_WEIGHT;
-
-  /* Compute old stream->pending_penalty we used to calculate
-     stream->cycle */
-  stream->pending_penalty =
-      (uint32_t)((stream->pending_penalty + (uint32_t)old_weight -
-                  (wlen_penalty % (uint32_t)old_weight)) %
-                 (uint32_t)old_weight);
-
-  last_cycle = stream->cycle -
-               (wlen_penalty + stream->pending_penalty) / (uint32_t)old_weight;
-
-  /* Now we have old stream->pending_penalty and new stream->weight in
-     place */
-  stream_next_cycle(stream, last_cycle);
-
-  if (dep_stream->descendant_last_cycle - stream->cycle <=
-      NGHTTP2_MAX_CYCLE_DISTANCE) {
-    stream->cycle = dep_stream->descendant_last_cycle;
-  }
-
-  /* Continue to use same stream->seq */
-
-  nghttp2_pq_push(&dep_stream->obq, &stream->pq_entry);
-
-  DEBUGF("stream: stream=%d obq resched cycle=%lu\n", stream->stream_id,
-         stream->cycle);
-}
-
-static nghttp2_stream *stream_last_sib(nghttp2_stream *stream) {
-  for (; stream->sib_next; stream = stream->sib_next)
-    ;
-
-  return stream;
-}
-
-int32_t nghttp2_stream_dep_distributed_weight(nghttp2_stream *stream,
-                                              int32_t weight) {
-  weight = stream->weight * weight / stream->sum_dep_weight;
-
-  return nghttp2_max(1, weight);
-}
-
-#ifdef STREAM_DEP_DEBUG
-
-static void ensure_inactive(nghttp2_stream *stream) {
-  nghttp2_stream *si;
-
-  if (stream->queued) {
-    fprintf(stderr, "stream(%p)=%d, stream->queued = 1; want 0\n", stream,
-            stream->stream_id);
-    assert(0);
-  }
-
-  if (stream_active(stream)) {
-    fprintf(stderr, "stream(%p)=%d, stream_active(stream) = 1; want 0\n",
-            stream, stream->stream_id);
-    assert(0);
-  }
-
-  if (!nghttp2_pq_empty(&stream->obq)) {
-    fprintf(stderr, "stream(%p)=%d, nghttp2_pq_size() = %zu; want 0\n", stream,
-            stream->stream_id, nghttp2_pq_size(&stream->obq));
-    assert(0);
-  }
-
-  for (si = stream->dep_next; si; si = si->sib_next) {
-    ensure_inactive(si);
-  }
-}
-
-static void check_queued(nghttp2_stream *stream) {
-  nghttp2_stream *si;
-  int queued;
-
-  if (stream->queued) {
-    if (!stream_subtree_active(stream)) {
-      fprintf(stderr,
-              "stream(%p)=%d, stream->queued == 1, but "
-              "stream_active() == %d and nghttp2_pq_size(&stream->obq) = %zu\n",
-              stream, stream->stream_id, stream_active(stream),
-              nghttp2_pq_size(&stream->obq));
-      assert(0);
-    }
-    if (!stream_active(stream)) {
-      queued = 0;
-      for (si = stream->dep_next; si; si = si->sib_next) {
-        if (si->queued) {
-          ++queued;
-        }
-      }
-      if (queued == 0) {
-        fprintf(stderr,
-                "stream(%p)=%d, stream->queued == 1, and "
-                "!stream_active(), but no descendants is queued\n",
-                stream, stream->stream_id);
-        assert(0);
-      }
-    }
-
-    for (si = stream->dep_next; si; si = si->sib_next) {
-      check_queued(si);
-    }
-  } else {
-    if (stream_active(stream) || !nghttp2_pq_empty(&stream->obq)) {
-      fprintf(stderr,
-              "stream(%p) = %d, stream->queued == 0, but "
-              "stream_active(stream) == %d and "
-              "nghttp2_pq_size(&stream->obq) = %zu\n",
-              stream, stream->stream_id, stream_active(stream),
-              nghttp2_pq_size(&stream->obq));
-      assert(0);
-    }
-    for (si = stream->dep_next; si; si = si->sib_next) {
-      ensure_inactive(si);
-    }
-  }
-}
-
-static void check_sum_dep(nghttp2_stream *stream) {
-  nghttp2_stream *si;
-  int32_t n = 0;
-  for (si = stream->dep_next; si; si = si->sib_next) {
-    n += si->weight;
-  }
-  if (n != stream->sum_dep_weight) {
-    fprintf(stderr, "stream(%p)=%d, sum_dep_weight = %d; want %d\n", stream,
-            stream->stream_id, n, stream->sum_dep_weight);
-    assert(0);
-  }
-  for (si = stream->dep_next; si; si = si->sib_next) {
-    check_sum_dep(si);
-  }
-}
-
-static void check_dep_prev(nghttp2_stream *stream) {
-  nghttp2_stream *si;
-  for (si = stream->dep_next; si; si = si->sib_next) {
-    if (si->dep_prev != stream) {
-      fprintf(stderr, "si->dep_prev = %p; want %p\n", si->dep_prev, stream);
-      assert(0);
-    }
-    check_dep_prev(si);
-  }
-}
-
-#endif /* STREAM_DEP_DEBUG */
-
-#ifdef STREAM_DEP_DEBUG
-static void validate_tree(nghttp2_stream *stream) {
-  nghttp2_stream *si;
-
-  if (!stream) {
-    return;
-  }
-
-  for (; stream->dep_prev; stream = stream->dep_prev)
-    ;
-
-  assert(stream->stream_id == 0);
-  assert(!stream->queued);
-
-  fprintf(stderr, "checking...\n");
-  if (nghttp2_pq_empty(&stream->obq)) {
-    fprintf(stderr, "root obq empty\n");
-    for (si = stream->dep_next; si; si = si->sib_next) {
-      ensure_inactive(si);
-    }
-  } else {
-    for (si = stream->dep_next; si; si = si->sib_next) {
-      check_queued(si);
-    }
-  }
-
-  check_sum_dep(stream);
-  check_dep_prev(stream);
-}
-#else  /* !STREAM_DEP_DEBUG */
-static void validate_tree(nghttp2_stream *stream) { (void)stream; }
-#endif /* !STREAM_DEP_DEBUG*/
-
-static int stream_update_dep_on_attach_item(nghttp2_stream *stream) {
-  int rv;
-
-  rv = stream_obq_push(stream->dep_prev, stream);
-  if (rv != 0) {
-    return rv;
-  }
-
-  validate_tree(stream);
-  return 0;
-}
-
-static int stream_update_dep_on_detach_item(nghttp2_stream *stream) {
-  if (nghttp2_pq_empty(&stream->obq)) {
-    stream_obq_remove(stream);
-  }
-
-  validate_tree(stream);
-
-  return 0;
-}
-
-int nghttp2_stream_attach_item(nghttp2_stream *stream,
-                               nghttp2_outbound_item *item) {
-  int rv;
-
+void nghttp2_stream_attach_item(nghttp2_stream *stream,
+                                nghttp2_outbound_item *item) {
   assert((stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) == 0);
   assert(stream->item == NULL);
 
   DEBUGF("stream: stream=%d attach item=%p\n", stream->stream_id, item);
 
   stream->item = item;
-
-  if (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) {
-    return 0;
-  }
-
-  rv = stream_update_dep_on_attach_item(stream);
-  if (rv != 0) {
-    /* This may relave stream->queued == 1, but stream->item == NULL.
-       But only consequence of this error is fatal one, and session
-       destruction.  In that execution path, these inconsistency does
-       not matter. */
-    stream->item = NULL;
-    return rv;
-  }
-
-  return 0;
 }
 
-int nghttp2_stream_detach_item(nghttp2_stream *stream) {
+void nghttp2_stream_detach_item(nghttp2_stream *stream) {
   DEBUGF("stream: stream=%d detach item=%p\n", stream->stream_id, stream->item);
 
   stream->item = NULL;
   stream->flags = (uint8_t)(stream->flags & ~NGHTTP2_STREAM_FLAG_DEFERRED_ALL);
-
-  if (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) {
-    return 0;
-  }
-
-  return stream_update_dep_on_detach_item(stream);
 }
 
-int nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags) {
+void nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags) {
   assert(stream->item);
 
   DEBUGF("stream: stream=%d defer item=%p cause=%02x\n", stream->stream_id,
          stream->item, flags);
 
   stream->flags |= flags;
-
-  if (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) {
-    return 0;
-  }
-
-  return stream_update_dep_on_detach_item(stream);
 }
 
-int nghttp2_stream_resume_deferred_item(nghttp2_stream *stream, uint8_t flags) {
+void nghttp2_stream_resume_deferred_item(nghttp2_stream *stream,
+                                         uint8_t flags) {
   assert(stream->item);
 
   DEBUGF("stream: stream=%d resume item=%p flags=%02x\n", stream->stream_id,
          stream->item, flags);
 
   stream->flags = (uint8_t)(stream->flags & ~flags);
-
-  if (stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) {
-    return 0;
-  }
-
-  if (stream->flags & NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES) {
-    return 0;
-  }
-
-  return stream_update_dep_on_attach_item(stream);
 }
 
 int nghttp2_stream_check_deferred_item(nghttp2_stream *stream) {
@@ -573,16 +130,16 @@ static int update_initial_window_size(int32_t *window_size_ptr,
 }
 
 int nghttp2_stream_update_remote_initial_window_size(
-    nghttp2_stream *stream, int32_t new_initial_window_size,
-    int32_t old_initial_window_size) {
+  nghttp2_stream *stream, int32_t new_initial_window_size,
+  int32_t old_initial_window_size) {
   return update_initial_window_size(&stream->remote_window_size,
                                     new_initial_window_size,
                                     old_initial_window_size);
 }
 
 int nghttp2_stream_update_local_initial_window_size(
-    nghttp2_stream *stream, int32_t new_initial_window_size,
-    int32_t old_initial_window_size) {
+  nghttp2_stream *stream, int32_t new_initial_window_size,
+  int32_t old_initial_window_size) {
   return update_initial_window_size(&stream->local_window_size,
                                     new_initial_window_size,
                                     old_initial_window_size);
@@ -593,373 +150,11 @@ void nghttp2_stream_promise_fulfilled(nghttp2_stream *stream) {
   stream->flags = (uint8_t)(stream->flags & ~NGHTTP2_STREAM_FLAG_PUSH);
 }
 
-int nghttp2_stream_dep_find_ancestor(nghttp2_stream *stream,
-                                     nghttp2_stream *target) {
-  for (; stream; stream = stream->dep_prev) {
-    if (stream == target) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-int nghttp2_stream_dep_insert(nghttp2_stream *dep_stream,
-                              nghttp2_stream *stream) {
-  nghttp2_stream *si;
-  int rv;
-
-  DEBUGF("stream: dep_insert dep_stream(%p)=%d, stream(%p)=%d\n", dep_stream,
-         dep_stream->stream_id, stream, stream->stream_id);
-
-  stream->sum_dep_weight = dep_stream->sum_dep_weight;
-  dep_stream->sum_dep_weight = stream->weight;
-
-  if (dep_stream->dep_next) {
-    for (si = dep_stream->dep_next; si; si = si->sib_next) {
-      si->dep_prev = stream;
-      if (si->queued) {
-        rv = stream_obq_move(stream, dep_stream, si);
-        if (rv != 0) {
-          return rv;
-        }
-      }
-    }
-
-    if (stream_subtree_active(stream)) {
-      rv = stream_obq_push(dep_stream, stream);
-      if (rv != 0) {
-        return rv;
-      }
-    }
-
-    stream->dep_next = dep_stream->dep_next;
-  }
-
-  dep_stream->dep_next = stream;
-  stream->dep_prev = dep_stream;
-
-  validate_tree(stream);
-
-  return 0;
-}
-
-static void set_dep_prev(nghttp2_stream *stream, nghttp2_stream *dep) {
-  for (; stream; stream = stream->sib_next) {
-    stream->dep_prev = dep;
-  }
-}
-
-static void link_dep(nghttp2_stream *dep_stream, nghttp2_stream *stream) {
-  dep_stream->dep_next = stream;
-  if (stream) {
-    stream->dep_prev = dep_stream;
-  }
-}
-
-static void link_sib(nghttp2_stream *a, nghttp2_stream *b) {
-  a->sib_next = b;
-  if (b) {
-    b->sib_prev = a;
-  }
-}
-
-static void insert_link_dep(nghttp2_stream *dep_stream,
-                            nghttp2_stream *stream) {
-  nghttp2_stream *sib_next;
-
-  assert(stream->sib_prev == NULL);
-
-  sib_next = dep_stream->dep_next;
-
-  link_sib(stream, sib_next);
-
-  link_dep(dep_stream, stream);
-}
-
-static void unlink_sib(nghttp2_stream *stream) {
-  nghttp2_stream *prev, *next, *dep_next;
-
-  prev = stream->sib_prev;
-  dep_next = stream->dep_next;
-
-  assert(prev);
-
-  if (dep_next) {
-    /*
-     *  prev--stream(--sib_next--...)
-     *         |
-     *        dep_next
-     */
-
-    link_sib(prev, dep_next);
-
-    set_dep_prev(dep_next, stream->dep_prev);
-
-    if (stream->sib_next) {
-      link_sib(stream_last_sib(dep_next), stream->sib_next);
-    }
-  } else {
-    /*
-     *  prev--stream(--sib_next--...)
-     */
-    next = stream->sib_next;
-
-    prev->sib_next = next;
-
-    if (next) {
-      next->sib_prev = prev;
-    }
-  }
-}
-
-static void unlink_dep(nghttp2_stream *stream) {
-  nghttp2_stream *prev, *next, *dep_next;
-
-  prev = stream->dep_prev;
-  dep_next = stream->dep_next;
-
-  assert(prev);
-
-  if (dep_next) {
-    /*
-     * prev
-     *   |
-     * stream(--sib_next--...)
-     *   |
-     * dep_next
-     */
-    link_dep(prev, dep_next);
-
-    set_dep_prev(dep_next, stream->dep_prev);
-
-    if (stream->sib_next) {
-      link_sib(stream_last_sib(dep_next), stream->sib_next);
-    }
-
-  } else if (stream->sib_next) {
-    /*
-     * prev
-     *   |
-     * stream--sib_next
-     */
-    next = stream->sib_next;
-
-    next->sib_prev = NULL;
-
-    link_dep(prev, next);
-  } else {
-    prev->dep_next = NULL;
-  }
-}
-
-void nghttp2_stream_dep_add(nghttp2_stream *dep_stream,
-                            nghttp2_stream *stream) {
-  DEBUGF("stream: dep_add dep_stream(%p)=%d, stream(%p)=%d\n", dep_stream,
-         dep_stream->stream_id, stream, stream->stream_id);
-
-  dep_stream->sum_dep_weight += stream->weight;
-
-  if (dep_stream->dep_next == NULL) {
-    link_dep(dep_stream, stream);
-  } else {
-    insert_link_dep(dep_stream, stream);
-  }
-
-  validate_tree(stream);
-}
-
-int nghttp2_stream_dep_remove(nghttp2_stream *stream) {
-  nghttp2_stream *dep_prev, *si;
-  int32_t sum_dep_weight_delta;
-  int rv;
-
-  DEBUGF("stream: dep_remove stream(%p)=%d\n", stream, stream->stream_id);
-
-  /* Distribute weight of |stream| to direct descendants */
-  sum_dep_weight_delta = -stream->weight;
-
-  for (si = stream->dep_next; si; si = si->sib_next) {
-    si->weight = nghttp2_stream_dep_distributed_weight(stream, si->weight);
-
-    sum_dep_weight_delta += si->weight;
-
-    if (si->queued) {
-      rv = stream_obq_move(stream->dep_prev, stream, si);
-      if (rv != 0) {
-        return rv;
-      }
-    }
-  }
-
-  assert(stream->dep_prev);
-
-  dep_prev = stream->dep_prev;
-
-  dep_prev->sum_dep_weight += sum_dep_weight_delta;
-
-  if (stream->queued) {
-    stream_obq_remove(stream);
-  }
-
-  if (stream->sib_prev) {
-    unlink_sib(stream);
-  } else {
-    unlink_dep(stream);
-  }
-
-  stream->sum_dep_weight = 0;
-
-  stream->dep_prev = NULL;
-  stream->dep_next = NULL;
-  stream->sib_prev = NULL;
-  stream->sib_next = NULL;
-
-  validate_tree(dep_prev);
-
-  return 0;
-}
-
-int nghttp2_stream_dep_insert_subtree(nghttp2_stream *dep_stream,
-                                      nghttp2_stream *stream) {
-  nghttp2_stream *last_sib;
-  nghttp2_stream *dep_next;
-  nghttp2_stream *si;
-  int rv;
-
-  DEBUGF("stream: dep_insert_subtree dep_stream(%p)=%d stream(%p)=%d\n",
-         dep_stream, dep_stream->stream_id, stream, stream->stream_id);
-
-  stream->sum_dep_weight += dep_stream->sum_dep_weight;
-  dep_stream->sum_dep_weight = stream->weight;
-
-  if (dep_stream->dep_next) {
-    dep_next = dep_stream->dep_next;
-
-    link_dep(dep_stream, stream);
-
-    if (stream->dep_next) {
-      last_sib = stream_last_sib(stream->dep_next);
-
-      link_sib(last_sib, dep_next);
-    } else {
-      link_dep(stream, dep_next);
-    }
-
-    for (si = dep_next; si; si = si->sib_next) {
-      si->dep_prev = stream;
-      if (si->queued) {
-        rv = stream_obq_move(stream, dep_stream, si);
-        if (rv != 0) {
-          return rv;
-        }
-      }
-    }
-  } else {
-    link_dep(dep_stream, stream);
-  }
-
-  if (stream_subtree_active(stream)) {
-    rv = stream_obq_push(dep_stream, stream);
-    if (rv != 0) {
-      return rv;
-    }
-  }
-
-  validate_tree(dep_stream);
-
-  return 0;
-}
-
-int nghttp2_stream_dep_add_subtree(nghttp2_stream *dep_stream,
-                                   nghttp2_stream *stream) {
-  int rv;
-
-  DEBUGF("stream: dep_add_subtree dep_stream(%p)=%d stream(%p)=%d\n",
-         dep_stream, dep_stream->stream_id, stream, stream->stream_id);
-
-  dep_stream->sum_dep_weight += stream->weight;
-
-  if (dep_stream->dep_next) {
-    insert_link_dep(dep_stream, stream);
-  } else {
-    link_dep(dep_stream, stream);
-  }
-
-  if (stream_subtree_active(stream)) {
-    rv = stream_obq_push(dep_stream, stream);
-    if (rv != 0) {
-      return rv;
-    }
-  }
-
-  validate_tree(dep_stream);
-
-  return 0;
-}
-
-void nghttp2_stream_dep_remove_subtree(nghttp2_stream *stream) {
-  nghttp2_stream *next, *dep_prev;
-
-  DEBUGF("stream: dep_remove_subtree stream(%p)=%d\n", stream,
-         stream->stream_id);
-
-  assert(stream->dep_prev);
-
-  dep_prev = stream->dep_prev;
-
-  if (stream->sib_prev) {
-    link_sib(stream->sib_prev, stream->sib_next);
-  } else {
-    next = stream->sib_next;
-
-    link_dep(dep_prev, next);
-
-    if (next) {
-      next->sib_prev = NULL;
-    }
-  }
-
-  dep_prev->sum_dep_weight -= stream->weight;
-
-  if (stream->queued) {
-    stream_obq_remove(stream);
-  }
-
-  validate_tree(dep_prev);
-
-  stream->sib_prev = NULL;
-  stream->sib_next = NULL;
-  stream->dep_prev = NULL;
-}
-
-int nghttp2_stream_in_dep_tree(nghttp2_stream *stream) {
-  return stream->dep_prev || stream->dep_next || stream->sib_prev ||
-         stream->sib_next;
-}
-
-nghttp2_outbound_item *
-nghttp2_stream_next_outbound_item(nghttp2_stream *stream) {
-  nghttp2_pq_entry *ent;
-  nghttp2_stream *si;
-
-  for (;;) {
-    if (stream_active(stream)) {
-      /* Update ascendant's descendant_last_cycle here, so that we can
-         assure that new stream is scheduled based on it. */
-      for (si = stream; si->dep_prev; si = si->dep_prev) {
-        si->dep_prev->descendant_last_cycle = si->cycle;
-      }
-      return stream->item;
-    }
-    ent = nghttp2_pq_top(&stream->obq);
-    if (!ent) {
-      return NULL;
-    }
-    stream = nghttp2_struct_of(ent, nghttp2_stream, pq_entry);
+nghttp2_stream_proto_state nghttp2_stream_get_state(nghttp2_stream *stream) {
+  if (stream == &nghttp2_stream_root) {
+    return NGHTTP2_STREAM_STATE_IDLE;
   }
-}
 
-nghttp2_stream_proto_state nghttp2_stream_get_state(nghttp2_stream *stream) {
   if (stream->flags & NGHTTP2_STREAM_FLAG_CLOSED) {
     return NGHTTP2_STREAM_STATE_CLOSED;
   }
@@ -990,27 +185,39 @@ nghttp2_stream_proto_state nghttp2_stream_get_state(nghttp2_stream *stream) {
 }
 
 nghttp2_stream *nghttp2_stream_get_parent(nghttp2_stream *stream) {
-  return stream->dep_prev;
+  (void)stream;
+
+  return NULL;
 }
 
 nghttp2_stream *nghttp2_stream_get_next_sibling(nghttp2_stream *stream) {
-  return stream->sib_next;
+  (void)stream;
+
+  return NULL;
 }
 
 nghttp2_stream *nghttp2_stream_get_previous_sibling(nghttp2_stream *stream) {
-  return stream->sib_prev;
+  (void)stream;
+
+  return NULL;
 }
 
 nghttp2_stream *nghttp2_stream_get_first_child(nghttp2_stream *stream) {
-  return stream->dep_next;
+  (void)stream;
+
+  return NULL;
 }
 
 int32_t nghttp2_stream_get_weight(nghttp2_stream *stream) {
-  return stream->weight;
+  (void)stream;
+
+  return NGHTTP2_DEFAULT_WEIGHT;
 }
 
 int32_t nghttp2_stream_get_sum_dependency_weight(nghttp2_stream *stream) {
-  return stream->sum_dep_weight;
+  (void)stream;
+
+  return 0;
 }
 
 int32_t nghttp2_stream_get_stream_id(nghttp2_stream *stream) {

+ 18 - 174
Utilities/cmnghttp2/lib/nghttp2_stream.h

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 #include "nghttp2_outbound_item.h"
@@ -91,9 +91,6 @@ typedef enum {
   /* bitwise OR of NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL and
      NGHTTP2_STREAM_FLAG_DEFERRED_USER. */
   NGHTTP2_STREAM_FLAG_DEFERRED_ALL = 0x0c,
-  /* Indicates that this stream is not subject to RFC7540
-     priorities scheme. */
-  NGHTTP2_STREAM_FLAG_NO_RFC7540_PRIORITIES = 0x10,
   /* Ignore client RFC 9218 priority signal. */
   NGHTTP2_STREAM_FLAG_IGNORE_CLIENT_PRIORITIES = 0x20,
   /* Indicates that RFC 9113 leading and trailing white spaces
@@ -124,10 +121,9 @@ typedef enum {
   NGHTTP2_HTTP_FLAG_METH_HEAD = 1 << 8,
   NGHTTP2_HTTP_FLAG_METH_OPTIONS = 1 << 9,
   NGHTTP2_HTTP_FLAG_METH_UPGRADE_WORKAROUND = 1 << 10,
-  NGHTTP2_HTTP_FLAG_METH_ALL = NGHTTP2_HTTP_FLAG_METH_CONNECT |
-                               NGHTTP2_HTTP_FLAG_METH_HEAD |
-                               NGHTTP2_HTTP_FLAG_METH_OPTIONS |
-                               NGHTTP2_HTTP_FLAG_METH_UPGRADE_WORKAROUND,
+  NGHTTP2_HTTP_FLAG_METH_ALL =
+    NGHTTP2_HTTP_FLAG_METH_CONNECT | NGHTTP2_HTTP_FLAG_METH_HEAD |
+    NGHTTP2_HTTP_FLAG_METH_OPTIONS | NGHTTP2_HTTP_FLAG_METH_UPGRADE_WORKAROUND,
   /* :path category */
   /* path starts with "/" */
   NGHTTP2_HTTP_FLAG_PATH_REGULAR = 1 << 11,
@@ -147,39 +143,18 @@ typedef enum {
 } nghttp2_http_flag;
 
 struct nghttp2_stream {
-  /* Entry for dep_prev->obq */
+  nghttp2_stream_state state;
   nghttp2_pq_entry pq_entry;
-  /* Priority Queue storing direct descendant (nghttp2_stream).  Only
-     streams which itself has some data to send, or has a descendant
-     which has some data to sent. */
-  nghttp2_pq obq;
   /* Content-Length of request/response body.  -1 if unknown. */
   int64_t content_length;
   /* Received body so far */
   int64_t recv_content_length;
-  /* Base last_cycle for direct descendent streams. */
-  uint64_t descendant_last_cycle;
   /* Next scheduled time to sent item */
   uint64_t cycle;
-  /* Next seq used for direct descendant streams */
-  uint64_t descendant_next_seq;
   /* Secondary key for prioritization to break a tie for cycle.  This
      value is monotonically increased for single parent stream. */
   uint64_t seq;
-  /* pointers to form dependency tree.  If multiple streams depend on
-     a stream, only one stream (left most) has non-NULL dep_prev which
-     points to the stream it depends on. The remaining streams are
-     linked using sib_prev and sib_next.  The stream which has
-     non-NULL dep_prev always NULL sib_prev.  The right most stream
-     has NULL sib_next.  If this stream is a root of dependency tree,
-     dep_prev and sib_prev are NULL. */
-  nghttp2_stream *dep_prev, *dep_next;
-  nghttp2_stream *sib_prev, *sib_next;
-  /* When stream is kept after closure, it may be kept in doubly
-     linked list pointed by nghttp2_session closed_stream_head.
-     closed_next points to the next stream object if it is the element
-     of the list. */
-  nghttp2_stream *closed_prev, *closed_next;
+  nghttp2_stream *closed_next;
   /* The arbitrary data provided by user for this stream. */
   void *stream_user_data;
   /* Item to send */
@@ -206,13 +181,8 @@ struct nghttp2_stream {
      NGHTTP2_INITIAL_WINDOW_SIZE and could be increased/decreased by
      submitting WINDOW_UPDATE. See nghttp2_submit_window_update(). */
   int32_t local_window_size;
-  /* weight of this stream */
-  int32_t weight;
   /* This is unpaid penalty (offset) when calculating cycle. */
   uint32_t pending_penalty;
-  /* sum of weight of direct descendants */
-  int32_t sum_dep_weight;
-  nghttp2_stream_state state;
   /* status code from remote server */
   int16_t status_code;
   /* Bitwise OR of zero or more nghttp2_http_flag values */
@@ -240,9 +210,9 @@ struct nghttp2_stream {
 
 void nghttp2_stream_init(nghttp2_stream *stream, int32_t stream_id,
                          uint8_t flags, nghttp2_stream_state initial_state,
-                         int32_t weight, int32_t remote_initial_window_size,
+                         int32_t remote_initial_window_size,
                          int32_t local_initial_window_size,
-                         void *stream_user_data, nghttp2_mem *mem);
+                         void *stream_user_data);
 
 void nghttp2_stream_free(nghttp2_stream *stream);
 
@@ -258,14 +228,8 @@ void nghttp2_stream_shutdown(nghttp2_stream *stream, nghttp2_shut_flag flag);
  * more of NGHTTP2_STREAM_FLAG_DEFERRED_USER and
  * NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL.  The |flags| indicates
  * the reason of this action.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
  */
-int nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags);
+void nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags);
 
 /*
  * Put back deferred data in this stream to active state.  The |flags|
@@ -274,14 +238,8 @@ int nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags);
  * NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL and given masks are
  * cleared if they are set.  So even if this function is called, if
  * one of flag is still set, data does not become active.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
  */
-int nghttp2_stream_resume_deferred_item(nghttp2_stream *stream, uint8_t flags);
+void nghttp2_stream_resume_deferred_item(nghttp2_stream *stream, uint8_t flags);
 
 /*
  * Returns nonzero if item is deferred by whatever reason.
@@ -302,8 +260,8 @@ int nghttp2_stream_check_deferred_by_flow_control(nghttp2_stream *stream);
  * overflow.
  */
 int nghttp2_stream_update_remote_initial_window_size(
-    nghttp2_stream *stream, int32_t new_initial_window_size,
-    int32_t old_initial_window_size);
+  nghttp2_stream *stream, int32_t new_initial_window_size,
+  int32_t old_initial_window_size);
 
 /*
  * Updates the local window size with the new value
@@ -314,8 +272,8 @@ int nghttp2_stream_update_remote_initial_window_size(
  * overflow.
  */
 int nghttp2_stream_update_local_initial_window_size(
-    nghttp2_stream *stream, int32_t new_initial_window_size,
-    int32_t old_initial_window_size);
+  nghttp2_stream *stream, int32_t new_initial_window_size,
+  int32_t old_initial_window_size);
 
 /*
  * Call this function if promised stream |stream| is replied with
@@ -324,130 +282,16 @@ int nghttp2_stream_update_local_initial_window_size(
  */
 void nghttp2_stream_promise_fulfilled(nghttp2_stream *stream);
 
-/*
- * Returns nonzero if |target| is an ancestor of |stream|.
- */
-int nghttp2_stream_dep_find_ancestor(nghttp2_stream *stream,
-                                     nghttp2_stream *target);
-
-/*
- * Computes distributed weight of a stream of the |weight| under the
- * |stream| if |stream| is removed from a dependency tree.
- */
-int32_t nghttp2_stream_dep_distributed_weight(nghttp2_stream *stream,
-                                              int32_t weight);
-
-/*
- * Makes the |stream| depend on the |dep_stream|.  This dependency is
- * exclusive.  All existing direct descendants of |dep_stream| become
- * the descendants of the |stream|.  This function assumes
- * |stream->item| is NULL.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_stream_dep_insert(nghttp2_stream *dep_stream,
-                              nghttp2_stream *stream);
-
-/*
- * Makes the |stream| depend on the |dep_stream|.  This dependency is
- * not exclusive.  This function assumes |stream->item| is NULL.
- */
-void nghttp2_stream_dep_add(nghttp2_stream *dep_stream, nghttp2_stream *stream);
-
-/*
- * Removes the |stream| from the current dependency tree.  This
- * function assumes |stream->item| is NULL.
- */
-int nghttp2_stream_dep_remove(nghttp2_stream *stream);
-
 /*
  * Attaches |item| to |stream|.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
  */
-int nghttp2_stream_attach_item(nghttp2_stream *stream,
-                               nghttp2_outbound_item *item);
+void nghttp2_stream_attach_item(nghttp2_stream *stream,
+                                nghttp2_outbound_item *item);
 
 /*
  * Detaches |stream->item|.  This function does not free
  * |stream->item|.  The caller must free it.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_stream_detach_item(nghttp2_stream *stream);
-
-/*
- * Makes the |stream| depend on the |dep_stream|.  This dependency is
- * exclusive.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_stream_dep_insert_subtree(nghttp2_stream *dep_stream,
-                                      nghttp2_stream *stream);
-
-/*
- * Makes the |stream| depend on the |dep_stream|.  This dependency is
- * not exclusive.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-int nghttp2_stream_dep_add_subtree(nghttp2_stream *dep_stream,
-                                   nghttp2_stream *stream);
-
-/*
- * Removes subtree whose root stream is |stream|.  The
- * effective_weight of streams in removed subtree is not updated.
- *
- * This function returns 0 if it succeeds, or one of the following
- * negative error codes:
- *
- * NGHTTP2_ERR_NOMEM
- *     Out of memory
- */
-void nghttp2_stream_dep_remove_subtree(nghttp2_stream *stream);
-
-/*
- * Returns nonzero if |stream| is in any dependency tree.
- */
-int nghttp2_stream_in_dep_tree(nghttp2_stream *stream);
-
-/*
- * Schedules transmission of |stream|'s item, assuming stream->item is
- * attached, and stream->last_writelen was updated.
- */
-void nghttp2_stream_reschedule(nghttp2_stream *stream);
-
-/*
- * Changes |stream|'s weight to |weight|.  If |stream| is queued, it
- * will be rescheduled based on new weight.
- */
-void nghttp2_stream_change_weight(nghttp2_stream *stream, int32_t weight);
-
-/*
- * Returns a stream which has highest priority, updating
- * descendant_last_cycle of selected stream's ancestors.
  */
-nghttp2_outbound_item *
-nghttp2_stream_next_outbound_item(nghttp2_stream *stream);
+void nghttp2_stream_detach_item(nghttp2_stream *stream);
 
-#endif /* NGHTTP2_STREAM */
+#endif /* !defined(NGHTTP2_STREAM_H) */

+ 134 - 170
Utilities/cmnghttp2/lib/nghttp2_submit.c

@@ -32,43 +32,13 @@
 #include "nghttp2_helper.h"
 #include "nghttp2_priority_spec.h"
 
-/*
- * Detects the dependency error, that is stream attempted to depend on
- * itself.  If |stream_id| is -1, we use session->next_stream_id as
- * stream ID.
- *
- * This function returns 0 if it succeeds, or one of the following
- * error codes:
- *
- * NGHTTP2_ERR_INVALID_ARGUMENT
- *   Stream attempted to depend on itself.
- */
-static int detect_self_dependency(nghttp2_session *session, int32_t stream_id,
-                                  const nghttp2_priority_spec *pri_spec) {
-  assert(pri_spec);
-
-  if (stream_id == -1) {
-    if ((int32_t)session->next_stream_id == pri_spec->stream_id) {
-      return NGHTTP2_ERR_INVALID_ARGUMENT;
-    }
-    return 0;
-  }
-
-  if (stream_id == pri_spec->stream_id) {
-    return NGHTTP2_ERR_INVALID_ARGUMENT;
-  }
-
-  return 0;
-}
-
 /* This function takes ownership of |nva_copy|. Regardless of the
    return value, the caller must not free |nva_copy| after this
    function returns. */
 static int32_t submit_headers_shared(nghttp2_session *session, uint8_t flags,
-                                     int32_t stream_id,
-                                     const nghttp2_priority_spec *pri_spec,
-                                     nghttp2_nv *nva_copy, size_t nvlen,
-                                     const nghttp2_data_provider *data_prd,
+                                     int32_t stream_id, nghttp2_nv *nva_copy,
+                                     size_t nvlen,
+                                     const nghttp2_data_provider_wrap *dpw,
                                      void *stream_user_data) {
   int rv;
   uint8_t flags_copy;
@@ -87,15 +57,15 @@ static int32_t submit_headers_shared(nghttp2_session *session, uint8_t flags,
 
   nghttp2_outbound_item_init(item);
 
-  if (data_prd != NULL && data_prd->read_callback != NULL) {
-    item->aux_data.headers.data_prd = *data_prd;
+  if (dpw != NULL && dpw->data_prd.read_callback != NULL) {
+    item->aux_data.headers.dpw = *dpw;
   }
 
   item->aux_data.headers.stream_user_data = stream_user_data;
 
   flags_copy =
-      (uint8_t)((flags & (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_PRIORITY)) |
-                NGHTTP2_FLAG_END_HEADERS);
+    (uint8_t)((flags & (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_PRIORITY)) |
+              NGHTTP2_FLAG_END_HEADERS);
 
   if (stream_id == -1) {
     if (session->next_stream_id > INT32_MAX) {
@@ -114,8 +84,8 @@ static int32_t submit_headers_shared(nghttp2_session *session, uint8_t flags,
 
   frame = &item->frame;
 
-  nghttp2_frame_headers_init(&frame->headers, flags_copy, stream_id, hcat,
-                             pri_spec, nva_copy, nvlen);
+  nghttp2_frame_headers_init(&frame->headers, flags_copy, stream_id, hcat, NULL,
+                             nva_copy, nvlen);
 
   rv = nghttp2_session_add_item(session, item);
 
@@ -141,31 +111,22 @@ fail2:
 
 static int32_t submit_headers_shared_nva(nghttp2_session *session,
                                          uint8_t flags, int32_t stream_id,
-                                         const nghttp2_priority_spec *pri_spec,
                                          const nghttp2_nv *nva, size_t nvlen,
-                                         const nghttp2_data_provider *data_prd,
+                                         const nghttp2_data_provider_wrap *dpw,
                                          void *stream_user_data) {
   int rv;
   nghttp2_nv *nva_copy;
-  nghttp2_priority_spec copy_pri_spec;
   nghttp2_mem *mem;
 
   mem = &session->mem;
 
-  if (pri_spec) {
-    copy_pri_spec = *pri_spec;
-    nghttp2_priority_spec_normalize_weight(&copy_pri_spec);
-  } else {
-    nghttp2_priority_spec_default_init(&copy_pri_spec);
-  }
-
   rv = nghttp2_nv_array_copy(&nva_copy, nva, nvlen, mem);
   if (rv < 0) {
     return rv;
   }
 
-  return submit_headers_shared(session, flags, stream_id, &copy_pri_spec,
-                               nva_copy, nvlen, data_prd, stream_user_data);
+  return submit_headers_shared(session, flags, stream_id, nva_copy, nvlen, dpw,
+                               stream_user_data);
 }
 
 int nghttp2_submit_trailer(nghttp2_session *session, int32_t stream_id,
@@ -175,8 +136,7 @@ int nghttp2_submit_trailer(nghttp2_session *session, int32_t stream_id,
   }
 
   return (int)submit_headers_shared_nva(session, NGHTTP2_FLAG_END_STREAM,
-                                        stream_id, NULL, nva, nvlen, NULL,
-                                        NULL);
+                                        stream_id, nva, nvlen, NULL, NULL);
 }
 
 int32_t nghttp2_submit_headers(nghttp2_session *session, uint8_t flags,
@@ -184,7 +144,7 @@ int32_t nghttp2_submit_headers(nghttp2_session *session, uint8_t flags,
                                const nghttp2_priority_spec *pri_spec,
                                const nghttp2_nv *nva, size_t nvlen,
                                void *stream_user_data) {
-  int rv;
+  (void)pri_spec;
 
   if (stream_id == -1) {
     if (session->server) {
@@ -196,20 +156,8 @@ int32_t nghttp2_submit_headers(nghttp2_session *session, uint8_t flags,
 
   flags &= NGHTTP2_FLAG_END_STREAM;
 
-  if (pri_spec && !nghttp2_priority_spec_check_default(pri_spec) &&
-      session->remote_settings.no_rfc7540_priorities != 1) {
-    rv = detect_self_dependency(session, stream_id, pri_spec);
-    if (rv != 0) {
-      return rv;
-    }
-
-    flags |= NGHTTP2_FLAG_PRIORITY;
-  } else {
-    pri_spec = NULL;
-  }
-
-  return submit_headers_shared_nva(session, flags, stream_id, pri_spec, nva,
-                                   nvlen, NULL, stream_user_data);
+  return submit_headers_shared_nva(session, flags, stream_id, nva, nvlen, NULL,
+                                   stream_user_data);
 }
 
 int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags,
@@ -221,51 +169,10 @@ int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags,
 int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags,
                             int32_t stream_id,
                             const nghttp2_priority_spec *pri_spec) {
-  int rv;
-  nghttp2_outbound_item *item;
-  nghttp2_frame *frame;
-  nghttp2_priority_spec copy_pri_spec;
-  nghttp2_mem *mem;
+  (void)session;
   (void)flags;
-
-  mem = &session->mem;
-
-  if (session->remote_settings.no_rfc7540_priorities == 1) {
-    return 0;
-  }
-
-  if (stream_id == 0 || pri_spec == NULL) {
-    return NGHTTP2_ERR_INVALID_ARGUMENT;
-  }
-
-  if (stream_id == pri_spec->stream_id) {
-    return NGHTTP2_ERR_INVALID_ARGUMENT;
-  }
-
-  copy_pri_spec = *pri_spec;
-
-  nghttp2_priority_spec_normalize_weight(&copy_pri_spec);
-
-  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
-
-  if (item == NULL) {
-    return NGHTTP2_ERR_NOMEM;
-  }
-
-  nghttp2_outbound_item_init(item);
-
-  frame = &item->frame;
-
-  nghttp2_frame_priority_init(&frame->priority, stream_id, &copy_pri_spec);
-
-  rv = nghttp2_session_add_item(session, item);
-
-  if (rv != 0) {
-    nghttp2_frame_priority_free(&frame->priority);
-    nghttp2_mem_free(mem, item);
-
-    return rv;
-  }
+  (void)stream_id;
+  (void)pri_spec;
 
   return 0;
 }
@@ -278,7 +185,8 @@ int nghttp2_submit_rst_stream(nghttp2_session *session, uint8_t flags,
     return NGHTTP2_ERR_INVALID_ARGUMENT;
   }
 
-  return nghttp2_session_add_rst_stream(session, stream_id, error_code);
+  return nghttp2_session_add_rst_stream_continue(
+    session, stream_id, error_code, /* continue_without_stream = */ 0);
 }
 
 int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags,
@@ -389,8 +297,8 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags,
   }
   if (stream_id == 0) {
     rv = nghttp2_adjust_local_window_size(
-        &session->local_window_size, &session->recv_window_size,
-        &session->recv_reduction, &window_size_increment);
+      &session->local_window_size, &session->recv_window_size,
+      &session->recv_reduction, &window_size_increment);
     if (rv != 0) {
       return rv;
     }
@@ -401,8 +309,8 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags,
     }
 
     rv = nghttp2_adjust_local_window_size(
-        &stream->local_window_size, &stream->recv_window_size,
-        &stream->recv_reduction, &window_size_increment);
+      &stream->local_window_size, &stream->recv_window_size,
+      &stream->recv_reduction, &window_size_increment);
     if (rv != 0) {
       return rv;
     }
@@ -411,10 +319,10 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags,
   if (window_size_increment > 0) {
     if (stream_id == 0) {
       session->consumed_size =
-          nghttp2_max(0, session->consumed_size - window_size_increment);
+        nghttp2_max_int32(0, session->consumed_size - window_size_increment);
     } else {
       stream->consumed_size =
-          nghttp2_max(0, stream->consumed_size - window_size_increment);
+        nghttp2_max_int32(0, stream->consumed_size - window_size_increment);
     }
 
     return nghttp2_session_add_window_update(session, 0, stream_id,
@@ -444,13 +352,13 @@ int nghttp2_session_set_local_window_size(nghttp2_session *session,
 
     if (window_size_increment < 0) {
       return nghttp2_adjust_local_window_size(
-          &session->local_window_size, &session->recv_window_size,
-          &session->recv_reduction, &window_size_increment);
+        &session->local_window_size, &session->recv_window_size,
+        &session->recv_reduction, &window_size_increment);
     }
 
     rv = nghttp2_increase_local_window_size(
-        &session->local_window_size, &session->recv_window_size,
-        &session->recv_reduction, &window_size_increment);
+      &session->local_window_size, &session->recv_window_size,
+      &session->recv_reduction, &window_size_increment);
 
     if (rv != 0) {
       return rv;
@@ -477,13 +385,13 @@ int nghttp2_session_set_local_window_size(nghttp2_session *session,
 
     if (window_size_increment < 0) {
       return nghttp2_adjust_local_window_size(
-          &stream->local_window_size, &stream->recv_window_size,
-          &stream->recv_reduction, &window_size_increment);
+        &stream->local_window_size, &stream->recv_window_size,
+        &stream->recv_reduction, &window_size_increment);
     }
 
     rv = nghttp2_increase_local_window_size(
-        &stream->local_window_size, &stream->recv_window_size,
-        &stream->recv_reduction, &window_size_increment);
+      &stream->local_window_size, &stream->recv_window_size,
+      &stream->recv_reduction, &window_size_increment);
 
     if (rv != 0) {
       return rv;
@@ -579,7 +487,7 @@ int nghttp2_submit_altsvc(nghttp2_session *session, uint8_t flags,
   return 0;
 
 fail_item_malloc:
-  free(buf);
+  nghttp2_mem_free(mem, buf);
 
   return rv;
 }
@@ -614,7 +522,7 @@ int nghttp2_submit_origin(nghttp2_session *session, uint8_t flags,
 
     /* The last nov is added for terminal NULL character. */
     ov_copy =
-        nghttp2_mem_malloc(mem, nov * sizeof(nghttp2_origin_entry) + len + nov);
+      nghttp2_mem_malloc(mem, nov * sizeof(nghttp2_origin_entry) + len + nov);
     if (ov_copy == NULL) {
       return NGHTTP2_ERR_NOMEM;
     }
@@ -662,7 +570,7 @@ int nghttp2_submit_origin(nghttp2_session *session, uint8_t flags,
   return 0;
 
 fail_item_malloc:
-  free(ov_copy);
+  nghttp2_mem_free(mem, ov_copy);
 
   return rv;
 }
@@ -734,64 +642,73 @@ int nghttp2_submit_priority_update(nghttp2_session *session, uint8_t flags,
   return 0;
 
 fail_item_malloc:
-  free(buf);
+  nghttp2_mem_free(mem, buf);
 
   return rv;
 }
 
-static uint8_t set_request_flags(const nghttp2_priority_spec *pri_spec,
-                                 const nghttp2_data_provider *data_prd) {
+static uint8_t set_request_flags(const nghttp2_data_provider_wrap *dpw) {
   uint8_t flags = NGHTTP2_FLAG_NONE;
-  if (data_prd == NULL || data_prd->read_callback == NULL) {
+  if (dpw == NULL || dpw->data_prd.read_callback == NULL) {
     flags |= NGHTTP2_FLAG_END_STREAM;
   }
 
-  if (pri_spec) {
-    flags |= NGHTTP2_FLAG_PRIORITY;
-  }
-
   return flags;
 }
 
-int32_t nghttp2_submit_request(nghttp2_session *session,
-                               const nghttp2_priority_spec *pri_spec,
-                               const nghttp2_nv *nva, size_t nvlen,
-                               const nghttp2_data_provider *data_prd,
-                               void *stream_user_data) {
+static int32_t submit_request_shared(nghttp2_session *session,
+                                     const nghttp2_nv *nva, size_t nvlen,
+                                     const nghttp2_data_provider_wrap *dpw,
+                                     void *stream_user_data) {
   uint8_t flags;
-  int rv;
 
   if (session->server) {
     return NGHTTP2_ERR_PROTO;
   }
 
-  if (pri_spec && !nghttp2_priority_spec_check_default(pri_spec) &&
-      session->remote_settings.no_rfc7540_priorities != 1) {
-    rv = detect_self_dependency(session, -1, pri_spec);
-    if (rv != 0) {
-      return rv;
-    }
-  } else {
-    pri_spec = NULL;
-  }
+  flags = set_request_flags(dpw);
+
+  return submit_headers_shared_nva(session, flags, -1, nva, nvlen, dpw,
+                                   stream_user_data);
+}
+
+int32_t nghttp2_submit_request(nghttp2_session *session,
+                               const nghttp2_priority_spec *pri_spec,
+                               const nghttp2_nv *nva, size_t nvlen,
+                               const nghttp2_data_provider *data_prd,
+                               void *stream_user_data) {
+  nghttp2_data_provider_wrap dpw;
+  (void)pri_spec;
 
-  flags = set_request_flags(pri_spec, data_prd);
+  return submit_request_shared(session, nva, nvlen,
+                               nghttp2_data_provider_wrap_v1(&dpw, data_prd),
+                               stream_user_data);
+}
 
-  return submit_headers_shared_nva(session, flags, -1, pri_spec, nva, nvlen,
-                                   data_prd, stream_user_data);
+int32_t nghttp2_submit_request2(nghttp2_session *session,
+                                const nghttp2_priority_spec *pri_spec,
+                                const nghttp2_nv *nva, size_t nvlen,
+                                const nghttp2_data_provider2 *data_prd,
+                                void *stream_user_data) {
+  nghttp2_data_provider_wrap dpw;
+  (void)pri_spec;
+
+  return submit_request_shared(session, nva, nvlen,
+                               nghttp2_data_provider_wrap_v2(&dpw, data_prd),
+                               stream_user_data);
 }
 
-static uint8_t set_response_flags(const nghttp2_data_provider *data_prd) {
+static uint8_t set_response_flags(const nghttp2_data_provider_wrap *dpw) {
   uint8_t flags = NGHTTP2_FLAG_NONE;
-  if (data_prd == NULL || data_prd->read_callback == NULL) {
+  if (dpw == NULL || dpw->data_prd.read_callback == NULL) {
     flags |= NGHTTP2_FLAG_END_STREAM;
   }
   return flags;
 }
 
-int nghttp2_submit_response(nghttp2_session *session, int32_t stream_id,
-                            const nghttp2_nv *nva, size_t nvlen,
-                            const nghttp2_data_provider *data_prd) {
+static int submit_response_shared(nghttp2_session *session, int32_t stream_id,
+                                  const nghttp2_nv *nva, size_t nvlen,
+                                  const nghttp2_data_provider_wrap *dpw) {
   uint8_t flags;
 
   if (stream_id <= 0) {
@@ -802,14 +719,32 @@ int nghttp2_submit_response(nghttp2_session *session, int32_t stream_id,
     return NGHTTP2_ERR_PROTO;
   }
 
-  flags = set_response_flags(data_prd);
-  return submit_headers_shared_nva(session, flags, stream_id, NULL, nva, nvlen,
-                                   data_prd, NULL);
+  flags = set_response_flags(dpw);
+  return submit_headers_shared_nva(session, flags, stream_id, nva, nvlen, dpw,
+                                   NULL);
 }
 
-int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
-                        int32_t stream_id,
-                        const nghttp2_data_provider *data_prd) {
+int nghttp2_submit_response(nghttp2_session *session, int32_t stream_id,
+                            const nghttp2_nv *nva, size_t nvlen,
+                            const nghttp2_data_provider *data_prd) {
+  nghttp2_data_provider_wrap dpw;
+
+  return submit_response_shared(session, stream_id, nva, nvlen,
+                                nghttp2_data_provider_wrap_v1(&dpw, data_prd));
+}
+
+int nghttp2_submit_response2(nghttp2_session *session, int32_t stream_id,
+                             const nghttp2_nv *nva, size_t nvlen,
+                             const nghttp2_data_provider2 *data_prd) {
+  nghttp2_data_provider_wrap dpw;
+
+  return submit_response_shared(session, stream_id, nva, nvlen,
+                                nghttp2_data_provider_wrap_v2(&dpw, data_prd));
+}
+
+int nghttp2_submit_data_shared(nghttp2_session *session, uint8_t flags,
+                               int32_t stream_id,
+                               const nghttp2_data_provider_wrap *dpw) {
   int rv;
   nghttp2_outbound_item *item;
   nghttp2_frame *frame;
@@ -832,7 +767,7 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
 
   frame = &item->frame;
   aux_data = &item->aux_data.data;
-  aux_data->data_prd = *data_prd;
+  aux_data->dpw = *dpw;
   aux_data->eof = 0;
   aux_data->flags = nflags;
 
@@ -848,9 +783,37 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
   return 0;
 }
 
+int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
+                        int32_t stream_id,
+                        const nghttp2_data_provider *data_prd) {
+  nghttp2_data_provider_wrap dpw;
+
+  assert(data_prd);
+
+  return nghttp2_submit_data_shared(
+    session, flags, stream_id, nghttp2_data_provider_wrap_v1(&dpw, data_prd));
+}
+
+int nghttp2_submit_data2(nghttp2_session *session, uint8_t flags,
+                         int32_t stream_id,
+                         const nghttp2_data_provider2 *data_prd) {
+  nghttp2_data_provider_wrap dpw;
+
+  assert(data_prd);
+
+  return nghttp2_submit_data_shared(
+    session, flags, stream_id, nghttp2_data_provider_wrap_v2(&dpw, data_prd));
+}
+
 ssize_t nghttp2_pack_settings_payload(uint8_t *buf, size_t buflen,
                                       const nghttp2_settings_entry *iv,
                                       size_t niv) {
+  return (ssize_t)nghttp2_pack_settings_payload2(buf, buflen, iv, niv);
+}
+
+nghttp2_ssize nghttp2_pack_settings_payload2(uint8_t *buf, size_t buflen,
+                                             const nghttp2_settings_entry *iv,
+                                             size_t niv) {
   if (!nghttp2_iv_check(iv, niv)) {
     return NGHTTP2_ERR_INVALID_ARGUMENT;
   }
@@ -859,7 +822,7 @@ ssize_t nghttp2_pack_settings_payload(uint8_t *buf, size_t buflen,
     return NGHTTP2_ERR_INSUFF_BUFSIZE;
   }
 
-  return (ssize_t)nghttp2_frame_pack_settings_payload(buf, iv, niv);
+  return (nghttp2_ssize)nghttp2_frame_pack_settings_payload(buf, iv, niv);
 }
 
 int nghttp2_submit_extension(nghttp2_session *session, uint8_t type,
@@ -875,7 +838,8 @@ int nghttp2_submit_extension(nghttp2_session *session, uint8_t type,
     return NGHTTP2_ERR_INVALID_ARGUMENT;
   }
 
-  if (!session->callbacks.pack_extension_callback) {
+  if (!session->callbacks.pack_extension_callback2 &&
+      !session->callbacks.pack_extension_callback) {
     return NGHTTP2_ERR_INVALID_STATE;
   }
 

+ 8 - 2
Utilities/cmnghttp2/lib/nghttp2_submit.h

@@ -27,8 +27,14 @@
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 
-#endif /* NGHTTP2_SUBMIT_H */
+#include "nghttp2_outbound_item.h"
+
+int nghttp2_submit_data_shared(nghttp2_session *session, uint8_t flags,
+                               int32_t stream_id,
+                               const nghttp2_data_provider_wrap *dpw);
+
+#endif /* !defined(NGHTTP2_SUBMIT_H) */

+ 62 - 0
Utilities/cmnghttp2/lib/nghttp2_time.c

@@ -0,0 +1,62 @@
+/*
+ * nghttp2 - HTTP/2 C Library
+ *
+ * Copyright (c) 2023 nghttp2 contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "nghttp2_time.h"
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif /* defined(HAVE_WINDOWS_H) */
+
+#include <time.h>
+
+#if !defined(HAVE_GETTICKCOUNT64) || defined(__CYGWIN__)
+static uint64_t time_now_sec(void) {
+  time_t t = time(NULL);
+
+  if (t == -1) {
+    return 0;
+  }
+
+  return (uint64_t)t;
+}
+#endif /* !defined(HAVE_GETTICKCOUNT64) || defined(__CYGWIN__) */
+
+#if defined(HAVE_GETTICKCOUNT64) && !defined(__CYGWIN__)
+uint64_t nghttp2_time_now_sec(void) { return GetTickCount64() / 1000; }
+#elif defined(HAVE_CLOCK_GETTIME) && HAVE_DECL_CLOCK_MONOTONIC
+uint64_t nghttp2_time_now_sec(void) {
+  struct timespec tp;
+  int rv = clock_gettime(CLOCK_MONOTONIC, &tp);
+
+  if (rv == -1) {
+    return time_now_sec();
+  }
+
+  return (uint64_t)tp.tv_sec;
+}
+#else  /* (!defined(HAVE_GETTICKCOUNT64) || !defined(__CYGWIN__)) &&           \
+          (!defined(HAVE_CLOCK_GETTIME) || !HAVE_DECL_CLOCK_MONOTONIC) */
+uint64_t nghttp2_time_now_sec(void) { return time_now_sec(); }
+#endif /* (!defined(HAVE_GETTICKCOUNT64) || !defined(__CYGWIN__)) &&           \
+          (!defined(HAVE_CLOCK_GETTIME) || !HAVE_DECL_CLOCK_MONOTONIC) */

+ 38 - 0
Utilities/cmnghttp2/lib/nghttp2_time.h

@@ -0,0 +1,38 @@
+/*
+ * nghttp2 - HTTP/2 C Library
+ *
+ * Copyright (c) 2023 nghttp2 contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef NGHTTP2_TIME_H
+#define NGHTTP2_TIME_H
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif /* defined(HAVE_CONFIG_H) */
+
+#include <nghttp2/nghttp2.h>
+
+/* nghttp2_time_now_sec returns seconds from implementation-specific
+   timepoint.  If it is unable to get seconds, it returns 0. */
+uint64_t nghttp2_time_now_sec(void);
+
+#endif /* !defined(NGHTTP2_TIME_H) */

+ 1 - 1
Utilities/cmnghttp2/lib/nghttp2_version.c

@@ -24,7 +24,7 @@
  */
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif /* defined(HAVE_CONFIG_H) */
 
 #include <nghttp2/nghttp2.h>
 

+ 1787 - 0
Utilities/cmnghttp2/lib/sfparse.c

@@ -0,0 +1,1787 @@
+/*
+ * sfparse
+ *
+ * Copyright (c) 2023 sfparse contributors
+ * Copyright (c) 2019 nghttp3 contributors
+ * Copyright (c) 2015 nghttp2 contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "sfparse.h"
+
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+
+#ifdef __AVX2__
+#  include <immintrin.h>
+#endif /* __AVX2__ */
+
+#define SFPARSE_STATE_DICT 0x08u
+#define SFPARSE_STATE_LIST 0x10u
+#define SFPARSE_STATE_ITEM 0x18u
+
+#define SFPARSE_STATE_INNER_LIST 0x04u
+
+#define SFPARSE_STATE_BEFORE 0x00u
+#define SFPARSE_STATE_BEFORE_PARAMS 0x01u
+#define SFPARSE_STATE_PARAMS 0x02u
+#define SFPARSE_STATE_AFTER 0x03u
+
+#define SFPARSE_STATE_OP_MASK 0x03u
+
+#define SFPARSE_SET_STATE_AFTER(NAME)                                          \
+  (SFPARSE_STATE_##NAME | SFPARSE_STATE_AFTER)
+#define SFPARSE_SET_STATE_BEFORE_PARAMS(NAME)                                  \
+  (SFPARSE_STATE_##NAME | SFPARSE_STATE_BEFORE_PARAMS)
+#define SFPARSE_SET_STATE_INNER_LIST_BEFORE(NAME)                              \
+  (SFPARSE_STATE_##NAME | SFPARSE_STATE_INNER_LIST | SFPARSE_STATE_BEFORE)
+
+#define SFPARSE_STATE_DICT_AFTER SFPARSE_SET_STATE_AFTER(DICT)
+#define SFPARSE_STATE_DICT_BEFORE_PARAMS SFPARSE_SET_STATE_BEFORE_PARAMS(DICT)
+#define SFPARSE_STATE_DICT_INNER_LIST_BEFORE                                   \
+  SFPARSE_SET_STATE_INNER_LIST_BEFORE(DICT)
+
+#define SFPARSE_STATE_LIST_AFTER SFPARSE_SET_STATE_AFTER(LIST)
+#define SFPARSE_STATE_LIST_BEFORE_PARAMS SFPARSE_SET_STATE_BEFORE_PARAMS(LIST)
+#define SFPARSE_STATE_LIST_INNER_LIST_BEFORE                                   \
+  SFPARSE_SET_STATE_INNER_LIST_BEFORE(LIST)
+
+#define SFPARSE_STATE_ITEM_AFTER SFPARSE_SET_STATE_AFTER(ITEM)
+#define SFPARSE_STATE_ITEM_BEFORE_PARAMS SFPARSE_SET_STATE_BEFORE_PARAMS(ITEM)
+#define SFPARSE_STATE_ITEM_INNER_LIST_BEFORE                                   \
+  SFPARSE_SET_STATE_INNER_LIST_BEFORE(ITEM)
+
+#define SFPARSE_STATE_INITIAL 0x00u
+
+#define DIGIT_CASES                                                            \
+  case '0':                                                                    \
+  case '1':                                                                    \
+  case '2':                                                                    \
+  case '3':                                                                    \
+  case '4':                                                                    \
+  case '5':                                                                    \
+  case '6':                                                                    \
+  case '7':                                                                    \
+  case '8':                                                                    \
+  case '9'
+
+#define LCALPHA_CASES                                                          \
+  case 'a':                                                                    \
+  case 'b':                                                                    \
+  case 'c':                                                                    \
+  case 'd':                                                                    \
+  case 'e':                                                                    \
+  case 'f':                                                                    \
+  case 'g':                                                                    \
+  case 'h':                                                                    \
+  case 'i':                                                                    \
+  case 'j':                                                                    \
+  case 'k':                                                                    \
+  case 'l':                                                                    \
+  case 'm':                                                                    \
+  case 'n':                                                                    \
+  case 'o':                                                                    \
+  case 'p':                                                                    \
+  case 'q':                                                                    \
+  case 'r':                                                                    \
+  case 's':                                                                    \
+  case 't':                                                                    \
+  case 'u':                                                                    \
+  case 'v':                                                                    \
+  case 'w':                                                                    \
+  case 'x':                                                                    \
+  case 'y':                                                                    \
+  case 'z'
+
+#define UCALPHA_CASES                                                          \
+  case 'A':                                                                    \
+  case 'B':                                                                    \
+  case 'C':                                                                    \
+  case 'D':                                                                    \
+  case 'E':                                                                    \
+  case 'F':                                                                    \
+  case 'G':                                                                    \
+  case 'H':                                                                    \
+  case 'I':                                                                    \
+  case 'J':                                                                    \
+  case 'K':                                                                    \
+  case 'L':                                                                    \
+  case 'M':                                                                    \
+  case 'N':                                                                    \
+  case 'O':                                                                    \
+  case 'P':                                                                    \
+  case 'Q':                                                                    \
+  case 'R':                                                                    \
+  case 'S':                                                                    \
+  case 'T':                                                                    \
+  case 'U':                                                                    \
+  case 'V':                                                                    \
+  case 'W':                                                                    \
+  case 'X':                                                                    \
+  case 'Y':                                                                    \
+  case 'Z'
+
+#define ALPHA_CASES                                                            \
+  UCALPHA_CASES:                                                               \
+  LCALPHA_CASES
+
+#define TOKEN_CASES                                                            \
+  case '!':                                                                    \
+  case '#':                                                                    \
+  case '$':                                                                    \
+  case '%':                                                                    \
+  case '&':                                                                    \
+  case '\'':                                                                   \
+  case '*':                                                                    \
+  case '+':                                                                    \
+  case '-':                                                                    \
+  case '.':                                                                    \
+  case '/':                                                                    \
+  DIGIT_CASES:                                                                 \
+  case ':':                                                                    \
+  UCALPHA_CASES:                                                               \
+  case '^':                                                                    \
+  case '_':                                                                    \
+  case '`':                                                                    \
+  LCALPHA_CASES:                                                               \
+  case '|':                                                                    \
+  case '~'
+
+#define LCHEXALPHA_CASES                                                       \
+  case 'a':                                                                    \
+  case 'b':                                                                    \
+  case 'c':                                                                    \
+  case 'd':                                                                    \
+  case 'e':                                                                    \
+  case 'f'
+
+#define X00_1F_CASES                                                           \
+  case 0x00:                                                                   \
+  case 0x01:                                                                   \
+  case 0x02:                                                                   \
+  case 0x03:                                                                   \
+  case 0x04:                                                                   \
+  case 0x05:                                                                   \
+  case 0x06:                                                                   \
+  case 0x07:                                                                   \
+  case 0x08:                                                                   \
+  case 0x09:                                                                   \
+  case 0x0a:                                                                   \
+  case 0x0b:                                                                   \
+  case 0x0c:                                                                   \
+  case 0x0d:                                                                   \
+  case 0x0e:                                                                   \
+  case 0x0f:                                                                   \
+  case 0x10:                                                                   \
+  case 0x11:                                                                   \
+  case 0x12:                                                                   \
+  case 0x13:                                                                   \
+  case 0x14:                                                                   \
+  case 0x15:                                                                   \
+  case 0x16:                                                                   \
+  case 0x17:                                                                   \
+  case 0x18:                                                                   \
+  case 0x19:                                                                   \
+  case 0x1a:                                                                   \
+  case 0x1b:                                                                   \
+  case 0x1c:                                                                   \
+  case 0x1d:                                                                   \
+  case 0x1e:                                                                   \
+  case 0x1f
+
+#define X20_21_CASES                                                           \
+  case ' ':                                                                    \
+  case '!'
+
+#define X23_5B_CASES                                                           \
+  case '#':                                                                    \
+  case '$':                                                                    \
+  case '%':                                                                    \
+  case '&':                                                                    \
+  case '\'':                                                                   \
+  case '(':                                                                    \
+  case ')':                                                                    \
+  case '*':                                                                    \
+  case '+':                                                                    \
+  case ',':                                                                    \
+  case '-':                                                                    \
+  case '.':                                                                    \
+  case '/':                                                                    \
+  DIGIT_CASES:                                                                 \
+  case ':':                                                                    \
+  case ';':                                                                    \
+  case '<':                                                                    \
+  case '=':                                                                    \
+  case '>':                                                                    \
+  case '?':                                                                    \
+  case '@':                                                                    \
+  UCALPHA_CASES:                                                               \
+  case '['
+
+#define X5D_7E_CASES                                                           \
+  case ']':                                                                    \
+  case '^':                                                                    \
+  case '_':                                                                    \
+  case '`':                                                                    \
+  LCALPHA_CASES:                                                               \
+  case '{':                                                                    \
+  case '|':                                                                    \
+  case '}':                                                                    \
+  case '~'
+
+#define X7F_FF_CASES                                                           \
+  case 0x7f:                                                                   \
+  case 0x80:                                                                   \
+  case 0x81:                                                                   \
+  case 0x82:                                                                   \
+  case 0x83:                                                                   \
+  case 0x84:                                                                   \
+  case 0x85:                                                                   \
+  case 0x86:                                                                   \
+  case 0x87:                                                                   \
+  case 0x88:                                                                   \
+  case 0x89:                                                                   \
+  case 0x8a:                                                                   \
+  case 0x8b:                                                                   \
+  case 0x8c:                                                                   \
+  case 0x8d:                                                                   \
+  case 0x8e:                                                                   \
+  case 0x8f:                                                                   \
+  case 0x90:                                                                   \
+  case 0x91:                                                                   \
+  case 0x92:                                                                   \
+  case 0x93:                                                                   \
+  case 0x94:                                                                   \
+  case 0x95:                                                                   \
+  case 0x96:                                                                   \
+  case 0x97:                                                                   \
+  case 0x98:                                                                   \
+  case 0x99:                                                                   \
+  case 0x9a:                                                                   \
+  case 0x9b:                                                                   \
+  case 0x9c:                                                                   \
+  case 0x9d:                                                                   \
+  case 0x9e:                                                                   \
+  case 0x9f:                                                                   \
+  case 0xa0:                                                                   \
+  case 0xa1:                                                                   \
+  case 0xa2:                                                                   \
+  case 0xa3:                                                                   \
+  case 0xa4:                                                                   \
+  case 0xa5:                                                                   \
+  case 0xa6:                                                                   \
+  case 0xa7:                                                                   \
+  case 0xa8:                                                                   \
+  case 0xa9:                                                                   \
+  case 0xaa:                                                                   \
+  case 0xab:                                                                   \
+  case 0xac:                                                                   \
+  case 0xad:                                                                   \
+  case 0xae:                                                                   \
+  case 0xaf:                                                                   \
+  case 0xb0:                                                                   \
+  case 0xb1:                                                                   \
+  case 0xb2:                                                                   \
+  case 0xb3:                                                                   \
+  case 0xb4:                                                                   \
+  case 0xb5:                                                                   \
+  case 0xb6:                                                                   \
+  case 0xb7:                                                                   \
+  case 0xb8:                                                                   \
+  case 0xb9:                                                                   \
+  case 0xba:                                                                   \
+  case 0xbb:                                                                   \
+  case 0xbc:                                                                   \
+  case 0xbd:                                                                   \
+  case 0xbe:                                                                   \
+  case 0xbf:                                                                   \
+  case 0xc0:                                                                   \
+  case 0xc1:                                                                   \
+  case 0xc2:                                                                   \
+  case 0xc3:                                                                   \
+  case 0xc4:                                                                   \
+  case 0xc5:                                                                   \
+  case 0xc6:                                                                   \
+  case 0xc7:                                                                   \
+  case 0xc8:                                                                   \
+  case 0xc9:                                                                   \
+  case 0xca:                                                                   \
+  case 0xcb:                                                                   \
+  case 0xcc:                                                                   \
+  case 0xcd:                                                                   \
+  case 0xce:                                                                   \
+  case 0xcf:                                                                   \
+  case 0xd0:                                                                   \
+  case 0xd1:                                                                   \
+  case 0xd2:                                                                   \
+  case 0xd3:                                                                   \
+  case 0xd4:                                                                   \
+  case 0xd5:                                                                   \
+  case 0xd6:                                                                   \
+  case 0xd7:                                                                   \
+  case 0xd8:                                                                   \
+  case 0xd9:                                                                   \
+  case 0xda:                                                                   \
+  case 0xdb:                                                                   \
+  case 0xdc:                                                                   \
+  case 0xdd:                                                                   \
+  case 0xde:                                                                   \
+  case 0xdf:                                                                   \
+  case 0xe0:                                                                   \
+  case 0xe1:                                                                   \
+  case 0xe2:                                                                   \
+  case 0xe3:                                                                   \
+  case 0xe4:                                                                   \
+  case 0xe5:                                                                   \
+  case 0xe6:                                                                   \
+  case 0xe7:                                                                   \
+  case 0xe8:                                                                   \
+  case 0xe9:                                                                   \
+  case 0xea:                                                                   \
+  case 0xeb:                                                                   \
+  case 0xec:                                                                   \
+  case 0xed:                                                                   \
+  case 0xee:                                                                   \
+  case 0xef:                                                                   \
+  case 0xf0:                                                                   \
+  case 0xf1:                                                                   \
+  case 0xf2:                                                                   \
+  case 0xf3:                                                                   \
+  case 0xf4:                                                                   \
+  case 0xf5:                                                                   \
+  case 0xf6:                                                                   \
+  case 0xf7:                                                                   \
+  case 0xf8:                                                                   \
+  case 0xf9:                                                                   \
+  case 0xfa:                                                                   \
+  case 0xfb:                                                                   \
+  case 0xfc:                                                                   \
+  case 0xfd:                                                                   \
+  case 0xfe:                                                                   \
+  case 0xff
+
+static int is_ws(uint8_t c) {
+  switch (c) {
+  case ' ':
+  case '\t':
+    return 1;
+  default:
+    return 0;
+  }
+}
+
+#ifdef __AVX2__
+#  ifdef _MSC_VER
+#    include <intrin.h>
+
+static int ctz(unsigned int v) {
+  unsigned long n;
+
+  /* Assume that v is not 0. */
+  _BitScanForward(&n, v);
+
+  return (int)n;
+}
+#  else /* !_MSC_VER */
+#    define ctz __builtin_ctz
+#  endif /* !_MSC_VER */
+#endif   /* __AVX2__ */
+
+static int parser_eof(sfparse_parser *sfp) { return sfp->pos == sfp->end; }
+
+static void parser_discard_ows(sfparse_parser *sfp) {
+  for (; !parser_eof(sfp) && is_ws(*sfp->pos); ++sfp->pos)
+    ;
+}
+
+static void parser_discard_sp(sfparse_parser *sfp) {
+  for (; !parser_eof(sfp) && *sfp->pos == ' '; ++sfp->pos)
+    ;
+}
+
+static void parser_set_op_state(sfparse_parser *sfp, uint32_t op) {
+  sfp->state &= ~SFPARSE_STATE_OP_MASK;
+  sfp->state |= op;
+}
+
+static void parser_unset_inner_list_state(sfparse_parser *sfp) {
+  sfp->state &= ~SFPARSE_STATE_INNER_LIST;
+}
+
+#ifdef __AVX2__
+static const uint8_t *find_char_key(const uint8_t *first, const uint8_t *last) {
+  const __m256i us = _mm256_set1_epi8('_');
+  const __m256i ds = _mm256_set1_epi8('-');
+  const __m256i dot = _mm256_set1_epi8('.');
+  const __m256i ast = _mm256_set1_epi8('*');
+  const __m256i r0l = _mm256_set1_epi8('0' - 1);
+  const __m256i r0r = _mm256_set1_epi8('9' + 1);
+  const __m256i r1l = _mm256_set1_epi8('a' - 1);
+  const __m256i r1r = _mm256_set1_epi8('z' + 1);
+  __m256i s, x;
+  uint32_t m;
+
+  for (; first != last; first += 32) {
+    s = _mm256_loadu_si256((void *)first);
+
+    x = _mm256_cmpeq_epi8(s, us);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, ds), x);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, dot), x);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, ast), x);
+    x = _mm256_or_si256(
+      _mm256_and_si256(_mm256_cmpgt_epi8(s, r0l), _mm256_cmpgt_epi8(r0r, s)),
+      x);
+    x = _mm256_or_si256(
+      _mm256_and_si256(_mm256_cmpgt_epi8(s, r1l), _mm256_cmpgt_epi8(r1r, s)),
+      x);
+
+    m = ~(uint32_t)_mm256_movemask_epi8(x);
+    if (m) {
+      return first + ctz(m);
+    }
+  }
+
+  return last;
+}
+#endif /* __AVX2__ */
+
+static int parser_key(sfparse_parser *sfp, sfparse_vec *dest) {
+  const uint8_t *base;
+#ifdef __AVX2__
+  const uint8_t *last;
+#endif /* __AVX2__ */
+
+  switch (*sfp->pos) {
+  case '*':
+  LCALPHA_CASES:
+    break;
+  default:
+    return SFPARSE_ERR_PARSE;
+  }
+
+  base = sfp->pos++;
+
+#ifdef __AVX2__
+  if (sfp->end - sfp->pos >= 32) {
+    last = sfp->pos + ((sfp->end - sfp->pos) & ~0x1fu);
+
+    sfp->pos = find_char_key(sfp->pos, last);
+    if (sfp->pos != last) {
+      goto fin;
+    }
+  }
+#endif /* __AVX2__ */
+
+  for (; !parser_eof(sfp); ++sfp->pos) {
+    switch (*sfp->pos) {
+    case '_':
+    case '-':
+    case '.':
+    case '*':
+    DIGIT_CASES:
+    LCALPHA_CASES:
+      continue;
+    }
+
+    break;
+  }
+
+#ifdef __AVX2__
+fin:
+#endif /* __AVX2__ */
+  if (dest) {
+    dest->base = (uint8_t *)base;
+    dest->len = (size_t)(sfp->pos - dest->base);
+  }
+
+  return 0;
+}
+
+static int parser_number(sfparse_parser *sfp, sfparse_value *dest) {
+  int sign = 1;
+  int64_t value = 0;
+  size_t len = 0;
+  size_t fpos = 0;
+
+  if (*sfp->pos == '-') {
+    ++sfp->pos;
+    if (parser_eof(sfp)) {
+      return SFPARSE_ERR_PARSE;
+    }
+
+    sign = -1;
+  }
+
+  assert(!parser_eof(sfp));
+
+  for (; !parser_eof(sfp); ++sfp->pos) {
+    switch (*sfp->pos) {
+    DIGIT_CASES:
+      if (++len > 15) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      value *= 10;
+      value += *sfp->pos - '0';
+
+      continue;
+    }
+
+    break;
+  }
+
+  if (len == 0) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  if (parser_eof(sfp) || *sfp->pos != '.') {
+    if (dest) {
+      dest->type = SFPARSE_TYPE_INTEGER;
+      dest->flags = SFPARSE_VALUE_FLAG_NONE;
+      dest->integer = value * sign;
+    }
+
+    return 0;
+  }
+
+  /* decimal */
+
+  if (len > 12) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  fpos = len;
+
+  ++sfp->pos;
+
+  for (; !parser_eof(sfp); ++sfp->pos) {
+    switch (*sfp->pos) {
+    DIGIT_CASES:
+      if (++len > 15) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      value *= 10;
+      value += *sfp->pos - '0';
+
+      continue;
+    }
+
+    break;
+  }
+
+  if (fpos == len || len - fpos > 3) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  if (dest) {
+    dest->type = SFPARSE_TYPE_DECIMAL;
+    dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    dest->decimal.numer = value * sign;
+
+    switch (len - fpos) {
+    case 1:
+      dest->decimal.denom = 10;
+
+      break;
+    case 2:
+      dest->decimal.denom = 100;
+
+      break;
+    case 3:
+      dest->decimal.denom = 1000;
+
+      break;
+    }
+  }
+
+  return 0;
+}
+
+static int parser_date(sfparse_parser *sfp, sfparse_value *dest) {
+  int rv;
+  sfparse_value val;
+
+  /* The first byte has already been validated by the caller. */
+  assert('@' == *sfp->pos);
+
+  ++sfp->pos;
+
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  rv = parser_number(sfp, &val);
+  if (rv != 0) {
+    return rv;
+  }
+
+  if (val.type != SFPARSE_TYPE_INTEGER) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  if (dest) {
+    *dest = val;
+    dest->type = SFPARSE_TYPE_DATE;
+  }
+
+  return 0;
+}
+
+#ifdef __AVX2__
+static const uint8_t *find_char_string(const uint8_t *first,
+                                       const uint8_t *last) {
+  const __m256i bs = _mm256_set1_epi8('\\');
+  const __m256i dq = _mm256_set1_epi8('"');
+  const __m256i del = _mm256_set1_epi8(0x7f);
+  const __m256i sp = _mm256_set1_epi8(' ');
+  __m256i s, x;
+  uint32_t m;
+
+  for (; first != last; first += 32) {
+    s = _mm256_loadu_si256((void *)first);
+
+    x = _mm256_cmpgt_epi8(sp, s);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, bs), x);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, dq), x);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, del), x);
+
+    m = (uint32_t)_mm256_movemask_epi8(x);
+    if (m) {
+      return first + ctz(m);
+    }
+  }
+
+  return last;
+}
+#endif /* __AVX2__ */
+
+static int parser_string(sfparse_parser *sfp, sfparse_value *dest) {
+  const uint8_t *base;
+#ifdef __AVX2__
+  const uint8_t *last;
+#endif /* __AVX2__ */
+  uint32_t flags = SFPARSE_VALUE_FLAG_NONE;
+
+  /* The first byte has already been validated by the caller. */
+  assert('"' == *sfp->pos);
+
+  base = ++sfp->pos;
+
+#ifdef __AVX2__
+  for (; sfp->end - sfp->pos >= 32; ++sfp->pos) {
+    last = sfp->pos + ((sfp->end - sfp->pos) & ~0x1fu);
+
+    sfp->pos = find_char_string(sfp->pos, last);
+    if (sfp->pos == last) {
+      break;
+    }
+
+    switch (*sfp->pos) {
+    case '\\':
+      ++sfp->pos;
+      if (parser_eof(sfp)) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      switch (*sfp->pos) {
+      case '"':
+      case '\\':
+        flags = SFPARSE_VALUE_FLAG_ESCAPED_STRING;
+
+        break;
+      default:
+        return SFPARSE_ERR_PARSE;
+      }
+
+      break;
+    case '"':
+      goto fin;
+    default:
+      return SFPARSE_ERR_PARSE;
+    }
+  }
+#endif /* __AVX2__ */
+
+  for (; !parser_eof(sfp); ++sfp->pos) {
+    switch (*sfp->pos) {
+    X20_21_CASES:
+    X23_5B_CASES:
+    X5D_7E_CASES:
+      break;
+    case '\\':
+      ++sfp->pos;
+      if (parser_eof(sfp)) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      switch (*sfp->pos) {
+      case '"':
+      case '\\':
+        flags = SFPARSE_VALUE_FLAG_ESCAPED_STRING;
+
+        break;
+      default:
+        return SFPARSE_ERR_PARSE;
+      }
+
+      break;
+    case '"':
+      goto fin;
+    default:
+      return SFPARSE_ERR_PARSE;
+    }
+  }
+
+  return SFPARSE_ERR_PARSE;
+
+fin:
+  if (dest) {
+    dest->type = SFPARSE_TYPE_STRING;
+    dest->flags = flags;
+    dest->vec.len = (size_t)(sfp->pos - base);
+    dest->vec.base = dest->vec.len == 0 ? NULL : (uint8_t *)base;
+  }
+
+  ++sfp->pos;
+
+  return 0;
+}
+
+#ifdef __AVX2__
+static const uint8_t *find_char_token(const uint8_t *first,
+                                      const uint8_t *last) {
+  /* r0: !..:, excluding "(),
+     r1: A..Z
+     r2: ^..~, excluding {} */
+  const __m256i r0l = _mm256_set1_epi8('!' - 1);
+  const __m256i r0r = _mm256_set1_epi8(':' + 1);
+  const __m256i dq = _mm256_set1_epi8('"');
+  const __m256i prl = _mm256_set1_epi8('(');
+  const __m256i prr = _mm256_set1_epi8(')');
+  const __m256i comma = _mm256_set1_epi8(',');
+  const __m256i r1l = _mm256_set1_epi8('A' - 1);
+  const __m256i r1r = _mm256_set1_epi8('Z' + 1);
+  const __m256i r2l = _mm256_set1_epi8('^' - 1);
+  const __m256i r2r = _mm256_set1_epi8('~' + 1);
+  const __m256i cbl = _mm256_set1_epi8('{');
+  const __m256i cbr = _mm256_set1_epi8('}');
+  __m256i s, x;
+  uint32_t m;
+
+  for (; first != last; first += 32) {
+    s = _mm256_loadu_si256((void *)first);
+
+    x = _mm256_andnot_si256(
+      _mm256_cmpeq_epi8(s, comma),
+      _mm256_andnot_si256(
+        _mm256_cmpeq_epi8(s, prr),
+        _mm256_andnot_si256(
+          _mm256_cmpeq_epi8(s, prl),
+          _mm256_andnot_si256(_mm256_cmpeq_epi8(s, dq),
+                              _mm256_and_si256(_mm256_cmpgt_epi8(s, r0l),
+                                               _mm256_cmpgt_epi8(r0r, s))))));
+    x = _mm256_or_si256(
+      _mm256_and_si256(_mm256_cmpgt_epi8(s, r1l), _mm256_cmpgt_epi8(r1r, s)),
+      x);
+    x = _mm256_or_si256(
+      _mm256_andnot_si256(
+        _mm256_cmpeq_epi8(s, cbr),
+        _mm256_andnot_si256(_mm256_cmpeq_epi8(s, cbl),
+                            _mm256_and_si256(_mm256_cmpgt_epi8(s, r2l),
+                                             _mm256_cmpgt_epi8(r2r, s)))),
+      x);
+
+    m = ~(uint32_t)_mm256_movemask_epi8(x);
+    if (m) {
+      return first + ctz(m);
+    }
+  }
+
+  return last;
+}
+#endif /* __AVX2__ */
+
+static int parser_token(sfparse_parser *sfp, sfparse_value *dest) {
+  const uint8_t *base;
+#ifdef __AVX2__
+  const uint8_t *last;
+#endif /* __AVX2__ */
+
+  /* The first byte has already been validated by the caller. */
+  base = sfp->pos++;
+
+#ifdef __AVX2__
+  if (sfp->end - sfp->pos >= 32) {
+    last = sfp->pos + ((sfp->end - sfp->pos) & ~0x1fu);
+
+    sfp->pos = find_char_token(sfp->pos, last);
+    if (sfp->pos != last) {
+      goto fin;
+    }
+  }
+#endif /* __AVX2__ */
+
+  for (; !parser_eof(sfp); ++sfp->pos) {
+    switch (*sfp->pos) {
+    TOKEN_CASES:
+      continue;
+    }
+
+    break;
+  }
+
+#ifdef __AVX2__
+fin:
+#endif /* __AVX2__ */
+  if (dest) {
+    dest->type = SFPARSE_TYPE_TOKEN;
+    dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    dest->vec.base = (uint8_t *)base;
+    dest->vec.len = (size_t)(sfp->pos - base);
+  }
+
+  return 0;
+}
+
+#ifdef __AVX2__
+static const uint8_t *find_char_byteseq(const uint8_t *first,
+                                        const uint8_t *last) {
+  const __m256i pls = _mm256_set1_epi8('+');
+  const __m256i fs = _mm256_set1_epi8('/');
+  const __m256i r0l = _mm256_set1_epi8('0' - 1);
+  const __m256i r0r = _mm256_set1_epi8('9' + 1);
+  const __m256i r1l = _mm256_set1_epi8('A' - 1);
+  const __m256i r1r = _mm256_set1_epi8('Z' + 1);
+  const __m256i r2l = _mm256_set1_epi8('a' - 1);
+  const __m256i r2r = _mm256_set1_epi8('z' + 1);
+  __m256i s, x;
+  uint32_t m;
+
+  for (; first != last; first += 32) {
+    s = _mm256_loadu_si256((void *)first);
+
+    x = _mm256_cmpeq_epi8(s, pls);
+    x = _mm256_or_si256(_mm256_cmpeq_epi8(s, fs), x);
+    x = _mm256_or_si256(
+      _mm256_and_si256(_mm256_cmpgt_epi8(s, r0l), _mm256_cmpgt_epi8(r0r, s)),
+      x);
+    x = _mm256_or_si256(
+      _mm256_and_si256(_mm256_cmpgt_epi8(s, r1l), _mm256_cmpgt_epi8(r1r, s)),
+      x);
+    x = _mm256_or_si256(
+      _mm256_and_si256(_mm256_cmpgt_epi8(s, r2l), _mm256_cmpgt_epi8(r2r, s)),
+      x);
+
+    m = ~(uint32_t)_mm256_movemask_epi8(x);
+    if (m) {
+      return first + ctz(m);
+    }
+  }
+
+  return last;
+}
+#endif /* __AVX2__ */
+
+static int parser_byteseq(sfparse_parser *sfp, sfparse_value *dest) {
+  const uint8_t *base;
+#ifdef __AVX2__
+  const uint8_t *last;
+#endif /* __AVX2__ */
+
+  /* The first byte has already been validated by the caller. */
+  assert(':' == *sfp->pos);
+
+  base = ++sfp->pos;
+
+#ifdef __AVX2__
+  if (sfp->end - sfp->pos >= 32) {
+    last = sfp->pos + ((sfp->end - sfp->pos) & ~0x1fu);
+    sfp->pos = find_char_byteseq(sfp->pos, last);
+  }
+#endif /* __AVX2__ */
+
+  for (; !parser_eof(sfp); ++sfp->pos) {
+    switch (*sfp->pos) {
+    case '+':
+    case '/':
+    DIGIT_CASES:
+    ALPHA_CASES:
+      continue;
+    case '=':
+      switch ((sfp->pos - base) & 0x3) {
+      case 0:
+      case 1:
+        return SFPARSE_ERR_PARSE;
+      case 2:
+        ++sfp->pos;
+
+        if (parser_eof(sfp)) {
+          return SFPARSE_ERR_PARSE;
+        }
+
+        if (*sfp->pos == '=') {
+          ++sfp->pos;
+        }
+
+        break;
+      case 3:
+        ++sfp->pos;
+
+        break;
+      }
+
+      if (parser_eof(sfp) || *sfp->pos != ':') {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      goto fin;
+    case ':':
+      if (((sfp->pos - base) & 0x3) == 1) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      goto fin;
+    default:
+      return SFPARSE_ERR_PARSE;
+    }
+  }
+
+  return SFPARSE_ERR_PARSE;
+
+fin:
+  if (dest) {
+    dest->type = SFPARSE_TYPE_BYTESEQ;
+    dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    dest->vec.len = (size_t)(sfp->pos - base);
+    dest->vec.base = dest->vec.len == 0 ? NULL : (uint8_t *)base;
+  }
+
+  ++sfp->pos;
+
+  return 0;
+}
+
+static int parser_boolean(sfparse_parser *sfp, sfparse_value *dest) {
+  int b;
+
+  /* The first byte has already been validated by the caller. */
+  assert('?' == *sfp->pos);
+
+  ++sfp->pos;
+
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  switch (*sfp->pos) {
+  case '0':
+    b = 0;
+
+    break;
+  case '1':
+    b = 1;
+
+    break;
+  default:
+    return SFPARSE_ERR_PARSE;
+  }
+
+  ++sfp->pos;
+
+  if (dest) {
+    dest->type = SFPARSE_TYPE_BOOLEAN;
+    dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    dest->boolean = b;
+  }
+
+  return 0;
+}
+
+static int pctdecode(uint8_t *pc, const uint8_t **ppos) {
+  uint8_t c, b = **ppos;
+
+  switch (b) {
+  DIGIT_CASES:
+    c = (uint8_t)((b - '0') << 4);
+
+    break;
+  LCHEXALPHA_CASES:
+    c = (uint8_t)((b - 'a' + 10) << 4);
+
+    break;
+  default:
+    return -1;
+  }
+
+  b = *++*ppos;
+
+  switch (b) {
+  DIGIT_CASES:
+    c |= (uint8_t)(b - '0');
+
+    break;
+  LCHEXALPHA_CASES:
+    c |= (uint8_t)(b - 'a' + 10);
+
+    break;
+  default:
+    return -1;
+  }
+
+  *pc = c;
+  ++*ppos;
+
+  return 0;
+}
+
+/* Start of utf8 dfa */
+/* Copyright (c) 2008-2010 Bjoern Hoehrmann <[email protected]>
+ * See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
+ *
+ * Copyright (c) 2008-2009 Bjoern Hoehrmann <[email protected]>
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#define UTF8_ACCEPT 0
+#define UTF8_REJECT 12
+
+/* clang-format off */
+static const uint8_t utf8d[] = {
+  /*
+   * The first part of the table maps bytes to character classes that
+   * to reduce the size of the transition table and create bitmasks.
+   */
+   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+   8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+  10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
+
+   /*
+    * The second part is a transition table that maps a combination
+    * of a state of the automaton and a character class to a state.
+    */
+   0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
+  12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
+  12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
+  12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
+  12,36,12,12,12,12,12,12,12,12,12,12,
+};
+/* clang-format on */
+
+static void utf8_decode(uint32_t *state, uint8_t byte) {
+  *state = utf8d[256 + *state + utf8d[byte]];
+}
+
+/* End of utf8 dfa */
+
+static int parser_dispstring(sfparse_parser *sfp, sfparse_value *dest) {
+  const uint8_t *base;
+  uint8_t c;
+  uint32_t utf8state = UTF8_ACCEPT;
+
+  assert('%' == *sfp->pos);
+
+  ++sfp->pos;
+
+  if (parser_eof(sfp) || *sfp->pos != '"') {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  base = ++sfp->pos;
+
+  for (; !parser_eof(sfp);) {
+    switch (*sfp->pos) {
+    X00_1F_CASES:
+    X7F_FF_CASES:
+      return SFPARSE_ERR_PARSE;
+    case '%':
+      ++sfp->pos;
+
+      if (sfp->pos + 2 > sfp->end) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      if (pctdecode(&c, &sfp->pos) != 0) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      utf8_decode(&utf8state, c);
+      if (utf8state == UTF8_REJECT) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      break;
+    case '"':
+      if (utf8state != UTF8_ACCEPT) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      if (dest) {
+        dest->type = SFPARSE_TYPE_DISPSTRING;
+        dest->flags = SFPARSE_VALUE_FLAG_NONE;
+        dest->vec.len = (size_t)(sfp->pos - base);
+        dest->vec.base = dest->vec.len == 0 ? NULL : (uint8_t *)base;
+      }
+
+      ++sfp->pos;
+
+      return 0;
+    default:
+      if (utf8state != UTF8_ACCEPT) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      ++sfp->pos;
+    }
+  }
+
+  return SFPARSE_ERR_PARSE;
+}
+
+static int parser_bare_item(sfparse_parser *sfp, sfparse_value *dest) {
+  switch (*sfp->pos) {
+  case '"':
+    return parser_string(sfp, dest);
+  case '-':
+  DIGIT_CASES:
+    return parser_number(sfp, dest);
+  case '@':
+    return parser_date(sfp, dest);
+  case ':':
+    return parser_byteseq(sfp, dest);
+  case '?':
+    return parser_boolean(sfp, dest);
+  case '*':
+  ALPHA_CASES:
+    return parser_token(sfp, dest);
+  case '%':
+    return parser_dispstring(sfp, dest);
+  default:
+    return SFPARSE_ERR_PARSE;
+  }
+}
+
+static int parser_skip_inner_list(sfparse_parser *sfp);
+
+int sfparse_parser_param(sfparse_parser *sfp, sfparse_vec *dest_key,
+                         sfparse_value *dest_value) {
+  int rv;
+
+  switch (sfp->state & SFPARSE_STATE_OP_MASK) {
+  case SFPARSE_STATE_BEFORE:
+    rv = parser_skip_inner_list(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_BEFORE_PARAMS:
+    parser_set_op_state(sfp, SFPARSE_STATE_PARAMS);
+
+    break;
+  case SFPARSE_STATE_PARAMS:
+    break;
+  default:
+    assert(0);
+    abort();
+  }
+
+  if (parser_eof(sfp) || *sfp->pos != ';') {
+    parser_set_op_state(sfp, SFPARSE_STATE_AFTER);
+
+    return SFPARSE_ERR_EOF;
+  }
+
+  ++sfp->pos;
+
+  parser_discard_sp(sfp);
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  rv = parser_key(sfp, dest_key);
+  if (rv != 0) {
+    return rv;
+  }
+
+  if (parser_eof(sfp) || *sfp->pos != '=') {
+    if (dest_value) {
+      dest_value->type = SFPARSE_TYPE_BOOLEAN;
+      dest_value->flags = SFPARSE_VALUE_FLAG_NONE;
+      dest_value->boolean = 1;
+    }
+
+    return 0;
+  }
+
+  ++sfp->pos;
+
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  return parser_bare_item(sfp, dest_value);
+}
+
+static int parser_skip_params(sfparse_parser *sfp) {
+  int rv;
+
+  for (;;) {
+    rv = sfparse_parser_param(sfp, NULL, NULL);
+    switch (rv) {
+    case 0:
+      break;
+    case SFPARSE_ERR_EOF:
+      return 0;
+    case SFPARSE_ERR_PARSE:
+      return rv;
+    default:
+      assert(0);
+      abort();
+    }
+  }
+}
+
+int sfparse_parser_inner_list(sfparse_parser *sfp, sfparse_value *dest) {
+  int rv;
+
+  switch (sfp->state & SFPARSE_STATE_OP_MASK) {
+  case SFPARSE_STATE_BEFORE:
+    parser_discard_sp(sfp);
+    if (parser_eof(sfp)) {
+      return SFPARSE_ERR_PARSE;
+    }
+
+    break;
+  case SFPARSE_STATE_BEFORE_PARAMS:
+    rv = parser_skip_params(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* Technically, we are entering SFPARSE_STATE_AFTER, but we will set
+       another state without reading the state. */
+    /* parser_set_op_state(sfp, SFPARSE_STATE_AFTER); */
+
+    /* fall through */
+  case SFPARSE_STATE_AFTER:
+    if (parser_eof(sfp)) {
+      return SFPARSE_ERR_PARSE;
+    }
+
+    switch (*sfp->pos) {
+    case ' ':
+      parser_discard_sp(sfp);
+      if (parser_eof(sfp)) {
+        return SFPARSE_ERR_PARSE;
+      }
+
+      break;
+    case ')':
+      break;
+    default:
+      return SFPARSE_ERR_PARSE;
+    }
+
+    break;
+  default:
+    assert(0);
+    abort();
+  }
+
+  if (*sfp->pos == ')') {
+    ++sfp->pos;
+
+    parser_unset_inner_list_state(sfp);
+    parser_set_op_state(sfp, SFPARSE_STATE_BEFORE_PARAMS);
+
+    return SFPARSE_ERR_EOF;
+  }
+
+  rv = parser_bare_item(sfp, dest);
+  if (rv != 0) {
+    return rv;
+  }
+
+  parser_set_op_state(sfp, SFPARSE_STATE_BEFORE_PARAMS);
+
+  return 0;
+}
+
+static int parser_skip_inner_list(sfparse_parser *sfp) {
+  int rv;
+
+  for (;;) {
+    rv = sfparse_parser_inner_list(sfp, NULL);
+    switch (rv) {
+    case 0:
+      break;
+    case SFPARSE_ERR_EOF:
+      return 0;
+    case SFPARSE_ERR_PARSE:
+      return rv;
+    default:
+      assert(0);
+      abort();
+    }
+  }
+}
+
+static int parser_next_key_or_item(sfparse_parser *sfp) {
+  parser_discard_ows(sfp);
+
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_EOF;
+  }
+
+  if (*sfp->pos != ',') {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  ++sfp->pos;
+
+  parser_discard_ows(sfp);
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  return 0;
+}
+
+static int parser_dict_value(sfparse_parser *sfp, sfparse_value *dest) {
+  int rv;
+
+  if (parser_eof(sfp) || *(sfp->pos) != '=') {
+    /* Boolean true */
+    if (dest) {
+      dest->type = SFPARSE_TYPE_BOOLEAN;
+      dest->flags = SFPARSE_VALUE_FLAG_NONE;
+      dest->boolean = 1;
+    }
+
+    sfp->state = SFPARSE_STATE_DICT_BEFORE_PARAMS;
+
+    return 0;
+  }
+
+  ++sfp->pos;
+
+  if (parser_eof(sfp)) {
+    return SFPARSE_ERR_PARSE;
+  }
+
+  if (*sfp->pos == '(') {
+    if (dest) {
+      dest->type = SFPARSE_TYPE_INNER_LIST;
+      dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    }
+
+    ++sfp->pos;
+
+    sfp->state = SFPARSE_STATE_DICT_INNER_LIST_BEFORE;
+
+    return 0;
+  }
+
+  rv = parser_bare_item(sfp, dest);
+  if (rv != 0) {
+    return rv;
+  }
+
+  sfp->state = SFPARSE_STATE_DICT_BEFORE_PARAMS;
+
+  return 0;
+}
+
+int sfparse_parser_dict(sfparse_parser *sfp, sfparse_vec *dest_key,
+                        sfparse_value *dest_value) {
+  int rv;
+
+  switch (sfp->state) {
+  case SFPARSE_STATE_DICT_INNER_LIST_BEFORE:
+    rv = parser_skip_inner_list(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_DICT_BEFORE_PARAMS:
+    rv = parser_skip_params(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_DICT_AFTER:
+    rv = parser_next_key_or_item(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    break;
+  case SFPARSE_STATE_INITIAL:
+    parser_discard_sp(sfp);
+
+    if (parser_eof(sfp)) {
+      return SFPARSE_ERR_EOF;
+    }
+
+    break;
+  default:
+    assert(0);
+    abort();
+  }
+
+  rv = parser_key(sfp, dest_key);
+  if (rv != 0) {
+    return rv;
+  }
+
+  return parser_dict_value(sfp, dest_value);
+}
+
+int sfparse_parser_list(sfparse_parser *sfp, sfparse_value *dest) {
+  int rv;
+
+  switch (sfp->state) {
+  case SFPARSE_STATE_LIST_INNER_LIST_BEFORE:
+    rv = parser_skip_inner_list(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_LIST_BEFORE_PARAMS:
+    rv = parser_skip_params(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_LIST_AFTER:
+    rv = parser_next_key_or_item(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    break;
+  case SFPARSE_STATE_INITIAL:
+    parser_discard_sp(sfp);
+
+    if (parser_eof(sfp)) {
+      return SFPARSE_ERR_EOF;
+    }
+
+    break;
+  default:
+    assert(0);
+    abort();
+  }
+
+  if (*sfp->pos == '(') {
+    if (dest) {
+      dest->type = SFPARSE_TYPE_INNER_LIST;
+      dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    }
+
+    ++sfp->pos;
+
+    sfp->state = SFPARSE_STATE_LIST_INNER_LIST_BEFORE;
+
+    return 0;
+  }
+
+  rv = parser_bare_item(sfp, dest);
+  if (rv != 0) {
+    return rv;
+  }
+
+  sfp->state = SFPARSE_STATE_LIST_BEFORE_PARAMS;
+
+  return 0;
+}
+
+int sfparse_parser_item(sfparse_parser *sfp, sfparse_value *dest) {
+  int rv;
+
+  switch (sfp->state) {
+  case SFPARSE_STATE_INITIAL:
+    parser_discard_sp(sfp);
+
+    if (parser_eof(sfp)) {
+      return SFPARSE_ERR_PARSE;
+    }
+
+    break;
+  case SFPARSE_STATE_ITEM_INNER_LIST_BEFORE:
+    rv = parser_skip_inner_list(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_ITEM_BEFORE_PARAMS:
+    rv = parser_skip_params(sfp);
+    if (rv != 0) {
+      return rv;
+    }
+
+    /* fall through */
+  case SFPARSE_STATE_ITEM_AFTER:
+    parser_discard_sp(sfp);
+
+    if (!parser_eof(sfp)) {
+      return SFPARSE_ERR_PARSE;
+    }
+
+    return SFPARSE_ERR_EOF;
+  default:
+    assert(0);
+    abort();
+  }
+
+  if (*sfp->pos == '(') {
+    if (dest) {
+      dest->type = SFPARSE_TYPE_INNER_LIST;
+      dest->flags = SFPARSE_VALUE_FLAG_NONE;
+    }
+
+    ++sfp->pos;
+
+    sfp->state = SFPARSE_STATE_ITEM_INNER_LIST_BEFORE;
+
+    return 0;
+  }
+
+  rv = parser_bare_item(sfp, dest);
+  if (rv != 0) {
+    return rv;
+  }
+
+  sfp->state = SFPARSE_STATE_ITEM_BEFORE_PARAMS;
+
+  return 0;
+}
+
+void sfparse_parser_init(sfparse_parser *sfp, const uint8_t *data,
+                         size_t datalen) {
+  if (datalen == 0) {
+    sfp->pos = sfp->end = NULL;
+  } else {
+    sfp->pos = data;
+    sfp->end = data + datalen;
+  }
+
+  sfp->state = SFPARSE_STATE_INITIAL;
+}
+
+void sfparse_unescape(sfparse_vec *dest, const sfparse_vec *src) {
+  const uint8_t *p, *q;
+  uint8_t *o;
+  size_t len, slen;
+
+  if (src->len == 0) {
+    dest->len = 0;
+
+    return;
+  }
+
+  o = dest->base;
+  p = src->base;
+  len = src->len;
+
+  for (;;) {
+    q = memchr(p, '\\', len);
+    if (q == NULL) {
+      memcpy(o, p, len);
+      o += len;
+
+      dest->len = (size_t)(o - dest->base);
+
+      return;
+    }
+
+    slen = (size_t)(q - p);
+    memcpy(o, p, slen);
+    o += slen;
+
+    p = q + 1;
+    *o++ = *p++;
+    len -= slen + 2;
+  }
+}
+
+void sfparse_base64decode(sfparse_vec *dest, const sfparse_vec *src) {
+  static const int index_tbl[] = {
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+    61, -1, -1, -1, -1, -1, -1, -1, 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10,
+    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1,
+    -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
+    43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1};
+  uint8_t *o;
+  const uint8_t *p, *end;
+  uint32_t n;
+  size_t i, left;
+  int idx;
+
+  if (src->len == 0) {
+    dest->len = 0;
+
+    return;
+  }
+
+  o = dest->base;
+  p = src->base;
+  left = src->len & 0x3;
+  if (left == 0 && src->base[src->len - 1] == '=') {
+    left = 4;
+  }
+  end = src->base + src->len - left;
+
+  for (; p != end;) {
+    n = 0;
+
+    for (i = 1; i <= 4; ++i, ++p) {
+      idx = index_tbl[*p];
+
+      assert(idx != -1);
+
+      n += (uint32_t)(idx << (24 - i * 6));
+    }
+
+    *o++ = (uint8_t)(n >> 16);
+    *o++ = (n >> 8) & 0xffu;
+    *o++ = n & 0xffu;
+  }
+
+  switch (left) {
+  case 0:
+    goto fin;
+  case 1:
+    assert(0);
+    abort();
+  case 3:
+    if (src->base[src->len - 1] == '=') {
+      left = 2;
+    }
+
+    break;
+  case 4:
+    assert('=' == src->base[src->len - 1]);
+
+    if (src->base[src->len - 2] == '=') {
+      left = 2;
+    } else {
+      left = 3;
+    }
+
+    break;
+  }
+
+  switch (left) {
+  case 2:
+    *o = (uint8_t)(index_tbl[*p++] << 2);
+    *o++ |= (uint8_t)(index_tbl[*p++] >> 4);
+
+    break;
+  case 3:
+    n = (uint32_t)(index_tbl[*p++] << 10);
+    n += (uint32_t)(index_tbl[*p++] << 4);
+    n += (uint32_t)(index_tbl[*p++] >> 2);
+    *o++ = (n >> 8) & 0xffu;
+    *o++ = n & 0xffu;
+
+    break;
+  }
+
+fin:
+  dest->len = (size_t)(o - dest->base);
+}
+
+void sfparse_pctdecode(sfparse_vec *dest, const sfparse_vec *src) {
+  const uint8_t *p, *q;
+  uint8_t *o;
+  size_t len, slen;
+
+  if (src->len == 0) {
+    dest->len = 0;
+
+    return;
+  }
+
+  o = dest->base;
+  p = src->base;
+  len = src->len;
+
+  for (;;) {
+    q = memchr(p, '%', len);
+    if (q == NULL) {
+      memcpy(o, p, len);
+      o += len;
+
+      dest->len = (size_t)(o - dest->base);
+
+      return;
+    }
+
+    slen = (size_t)(q - p);
+    memcpy(o, p, slen);
+    o += slen;
+
+    p = q + 1;
+
+    pctdecode(o++, &p);
+
+    len -= slen + 3;
+  }
+}

+ 442 - 0
Utilities/cmnghttp2/lib/sfparse.h

@@ -0,0 +1,442 @@
+/*
+ * sfparse
+ *
+ * Copyright (c) 2023 sfparse contributors
+ * Copyright (c) 2019 nghttp3 contributors
+ * Copyright (c) 2015 nghttp2 contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef SFPARSE_H
+#define SFPARSE_H
+
+/* Define WIN32 when build target is Win32 API (borrowed from
+   libcurl) */
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+#  define WIN32
+#endif /* (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
+/* MSVC < 2013 does not have inttypes.h because it is not C99
+   compliant.  See compiler macros and version number in
+   https://sourceforge.net/p/predef/wiki/Compilers/ */
+#  include <stdint.h>
+#else /* !(defined(_MSC_VER) && (_MSC_VER < 1800)) */
+#  include <inttypes.h>
+#endif /* !(defined(_MSC_VER) && (_MSC_VER < 1800)) */
+#include <sys/types.h>
+#include <stddef.h>
+
+/**
+ * @enum
+ *
+ * :type:`sfparse_type` defines value type.
+ */
+typedef enum sfparse_type {
+  /**
+   * :enum:`SFPARSE_TYPE_BOOLEAN` indicates boolean type.
+   */
+  SFPARSE_TYPE_BOOLEAN,
+  /**
+   * :enum:`SFPARSE_TYPE_INTEGER` indicates integer type.
+   */
+  SFPARSE_TYPE_INTEGER,
+  /**
+   * :enum:`SFPARSE_TYPE_DECIMAL` indicates decimal type.
+   */
+  SFPARSE_TYPE_DECIMAL,
+  /**
+   * :enum:`SFPARSE_TYPE_STRING` indicates string type.
+   */
+  SFPARSE_TYPE_STRING,
+  /**
+   * :enum:`SFPARSE_TYPE_TOKEN` indicates token type.
+   */
+  SFPARSE_TYPE_TOKEN,
+  /**
+   * :enum:`SFPARSE_TYPE_BYTESEQ` indicates byte sequence type.
+   */
+  SFPARSE_TYPE_BYTESEQ,
+  /**
+   * :enum:`SFPARSE_TYPE_INNER_LIST` indicates inner list type.
+   */
+  SFPARSE_TYPE_INNER_LIST,
+  /**
+   * :enum:`SFPARSE_TYPE_DATE` indicates date type.
+   */
+  SFPARSE_TYPE_DATE,
+  /**
+   * :enum:`SFPARSE_TYPE_DISPSTRING` indicates display string type.
+   */
+  SFPARSE_TYPE_DISPSTRING
+} sfparse_type;
+
+/**
+ * @macro
+ *
+ * :macro:`SFPARSE_ERR_PARSE` indicates fatal parse error has
+ * occurred, and it is not possible to continue the processing.
+ */
+#define SFPARSE_ERR_PARSE -1
+
+/**
+ * @macro
+ *
+ * :macro:`SFPARSE_ERR_EOF` indicates that there is nothing left to
+ * read.  The context of this error varies depending on the function
+ * that returns this error code.
+ */
+#define SFPARSE_ERR_EOF -2
+
+/**
+ * @struct
+ *
+ * :type:`sfparse_vec` stores sequence of bytes.
+ */
+typedef struct sfparse_vec {
+  /**
+   * :member:`base` points to the beginning of the sequence of bytes.
+   */
+  uint8_t *base;
+  /**
+   * :member:`len` is the number of bytes contained in this sequence.
+   */
+  size_t len;
+} sfparse_vec;
+
+/**
+ * @macro
+ *
+ * :macro:`SFPARSE_VALUE_FLAG_NONE` indicates no flag set.
+ */
+#define SFPARSE_VALUE_FLAG_NONE 0x0u
+
+/**
+ * @macro
+ *
+ * :macro:`SFPARSE_VALUE_FLAG_ESCAPED_STRING` indicates that a string
+ * contains escaped character(s).
+ */
+#define SFPARSE_VALUE_FLAG_ESCAPED_STRING 0x1u
+
+/**
+ * @struct
+ *
+ * :type:`sfparse_decimal` contains decimal value.
+ */
+typedef struct sfparse_decimal {
+  /**
+   * :member:`numer` contains numerator of the decimal value.
+   */
+  int64_t numer;
+  /**
+   * :member:`denom` contains denominator of the decimal value.
+   */
+  int64_t denom;
+} sfparse_decimal;
+
+/**
+ * @struct
+ *
+ * :type:`sfparse_value` stores a Structured Field item.  For Inner
+ * List, only type is set to
+ * :enum:`sfparse_type.SFPARSE_TYPE_INNER_LIST`.  In order to read the
+ * items contained in an inner list, call `sfparse_parser_inner_list`.
+ */
+typedef struct sfparse_value {
+  /**
+   * :member:`type` is the type of the value contained in this
+   * particular object.
+   */
+  sfparse_type type;
+  /**
+   * :member:`flags` is bitwise OR of one or more of
+   * :macro:`SFPARSE_VALUE_FLAG_* <SFPARSE_VALUE_FLAG_NONE>`.
+   */
+  uint32_t flags;
+  /**
+   * @anonunion_start
+   *
+   * @sfparse_value_value
+   */
+  union {
+    /**
+     * :member:`boolean` contains boolean value if :member:`type` ==
+     * :enum:`sfparse_type.SFPARSE_TYPE_BOOLEAN`.  1 indicates true,
+     * and 0 indicates false.
+     */
+    int boolean;
+    /**
+     * :member:`integer` contains integer value if :member:`type` is
+     * either :enum:`sfparse_type.SFPARSE_TYPE_INTEGER` or
+     * :enum:`sfparse_type.SFPARSE_TYPE_DATE`.
+     */
+    int64_t integer;
+    /**
+     * :member:`decimal` contains decimal value if :member:`type` ==
+     * :enum:`sfparse_type.SFPARSE_TYPE_DECIMAL`.
+     */
+    sfparse_decimal decimal;
+    /**
+     * :member:`vec` contains sequence of bytes if :member:`type` is
+     * either :enum:`sfparse_type.SFPARSE_TYPE_STRING`,
+     * :enum:`sfparse_type.SFPARSE_TYPE_TOKEN`,
+     * :enum:`sfparse_type.SFPARSE_TYPE_BYTESEQ`, or
+     * :enum:`sfparse_type.SFPARSE_TYPE_DISPSTRING`.
+     *
+     * For :enum:`sfparse_type.SFPARSE_TYPE_STRING`, this field
+     * contains one or more escaped characters if :member:`flags` has
+     * :macro:`SFPARSE_VALUE_FLAG_ESCAPED_STRING` set.  To unescape
+     * the string, use `sfparse_unescape`.
+     *
+     * For :enum:`sfparse_type.SFPARSE_TYPE_BYTESEQ`, this field
+     * contains base64 encoded string.  To decode this byte string,
+     * use `sfparse_base64decode`.
+     *
+     * For :enum:`sfparse_type.SFPARSE_TYPE_DISPSTRING`, this field
+     * may contain percent-encoded UTF-8 byte sequences.  To decode
+     * it, use `sfparse_pctdecode`.
+     *
+     * If :member:`vec.len <sfparse_vec.len>` == 0, :member:`vec.base
+     * <sfparse_vec.base>` is guaranteed to be NULL.
+     */
+    sfparse_vec vec;
+    /**
+     * @anonunion_end
+     */
+  };
+} sfparse_value;
+
+/**
+ * @struct
+ *
+ * :type:`sfparse_parser` is the Structured Field Values parser.  Use
+ * `sfparse_parser_init` to initialize it.
+ */
+typedef struct sfparse_parser {
+  /* all fields are private */
+  const uint8_t *pos;
+  const uint8_t *end;
+  uint32_t state;
+} sfparse_parser;
+
+/**
+ * @function
+ *
+ * `sfparse_parser_init` initializes |sfp| with the given data encoded
+ * in Structured Field Values pointed by |data| of length |datalen|.
+ */
+void sfparse_parser_init(sfparse_parser *sfp, const uint8_t *data,
+                         size_t datalen);
+
+/**
+ * @function
+ *
+ * `sfparse_parser_param` reads a parameter.  If this function returns
+ * 0, it stores parameter key and value in |dest_key| and |dest_value|
+ * respectively, if they are not NULL.
+ *
+ * This function does no effort to find duplicated keys.  Same key may
+ * be reported more than once.
+ *
+ * Caller should keep calling this function until it returns negative
+ * error code.  If it returns :macro:`SFPARSE_ERR_EOF`, all parameters
+ * have read, and caller can continue to read rest of the values.  If
+ * it returns :macro:`SFPARSE_ERR_PARSE`, it encountered fatal error
+ * while parsing field value.
+ */
+int sfparse_parser_param(sfparse_parser *sfp, sfparse_vec *dest_key,
+                         sfparse_value *dest_value);
+
+/**
+ * @function
+ *
+ * `sfparse_parser_dict` reads the next dictionary key and value pair.
+ * If this function returns 0, it stores the key and value in
+ * |dest_key| and |dest_value| respectively, if they are not NULL.
+ *
+ * Caller can optionally read parameters attached to the pair by
+ * calling `sfparse_parser_param`.
+ *
+ * This function does no effort to find duplicated keys.  Same key may
+ * be reported more than once.
+ *
+ * Caller should keep calling this function until it returns negative
+ * error code.  If it returns :macro:`SFPARSE_ERR_EOF`, all key and
+ * value pairs have been read, and there is nothing left to read.
+ *
+ * This function returns 0 if it succeeds, or one of the following
+ * negative error codes:
+ *
+ * :macro:`SFPARSE_ERR_EOF`
+ *     All values in the dictionary have read.
+ * :macro:`SFPARSE_ERR_PARSE`
+ *     It encountered fatal error while parsing field value.
+ */
+int sfparse_parser_dict(sfparse_parser *sfp, sfparse_vec *dest_key,
+                        sfparse_value *dest_value);
+
+/**
+ * @function
+ *
+ * `sfparse_parser_list` reads the next list item.  If this function
+ * returns 0, it stores the item in |dest| if it is not NULL.
+ *
+ * Caller can optionally read parameters attached to the item by
+ * calling `sfparse_parser_param`.
+ *
+ * Caller should keep calling this function until it returns negative
+ * error code.  If it returns :macro:`SFPARSE_ERR_EOF`, all values in
+ * the list have been read, and there is nothing left to read.
+ *
+ * This function returns 0 if it succeeds, or one of the following
+ * negative error codes:
+ *
+ * :macro:`SFPARSE_ERR_EOF`
+ *     All values in the list have read.
+ * :macro:`SFPARSE_ERR_PARSE`
+ *     It encountered fatal error while parsing field value.
+ */
+int sfparse_parser_list(sfparse_parser *sfp, sfparse_value *dest);
+
+/**
+ * @function
+ *
+ * `sfparse_parser_item` reads a single item.  If this function
+ * returns 0, it stores the item in |dest| if it is not NULL.
+ *
+ * This function is only used for the field value that consists of a
+ * single item.
+ *
+ * Caller can optionally read parameters attached to the item by
+ * calling `sfparse_parser_param`.
+ *
+ * Caller should call this function again to make sure that there is
+ * nothing left to read.  If this 2nd function call returns
+ * :macro:`SFPARSE_ERR_EOF`, all data have been processed
+ * successfully.
+ *
+ * This function returns 0 if it succeeds, or one of the following
+ * negative error codes:
+ *
+ * :macro:`SFPARSE_ERR_EOF`
+ *     There is nothing left to read.
+ * :macro:`SFPARSE_ERR_PARSE`
+ *     It encountered fatal error while parsing field value.
+ */
+int sfparse_parser_item(sfparse_parser *sfp, sfparse_value *dest);
+
+/**
+ * @function
+ *
+ * `sfparse_parser_inner_list` reads the next inner list item.  If
+ * this function returns 0, it stores the item in |dest| if it is not
+ * NULL.
+ *
+ * Caller can optionally read parameters attached to the item by
+ * calling `sfparse_parser_param`.
+ *
+ * Caller should keep calling this function until it returns negative
+ * error code.  If it returns :macro:`SFPARSE_ERR_EOF`, all values in
+ * this inner list have been read, and caller can optionally read
+ * parameters attached to this inner list by calling
+ * `sfparse_parser_param`.  Then caller can continue to read rest of
+ * the values.
+ *
+ * This function returns 0 if it succeeds, or one of the following
+ * negative error codes:
+ *
+ * :macro:`SFPARSE_ERR_EOF`
+ *     All values in the inner list have read.
+ * :macro:`SFPARSE_ERR_PARSE`
+ *     It encountered fatal error while parsing field value.
+ */
+int sfparse_parser_inner_list(sfparse_parser *sfp, sfparse_value *dest);
+
+/**
+ * @function
+ *
+ * `sfparse_unescape` copies |src| to |dest| by removing escapes
+ * (``\``).  |src| should be the pointer to
+ * :member:`sfparse_value.vec` of type
+ * :enum:`sfparse_type.SFPARSE_TYPE_STRING` produced by either
+ * `sfparse_parser_dict`, `sfparse_parser_list`,
+ * `sfparse_parser_inner_list`, `sfparse_parser_item`, or
+ * `sfparse_parser_param`, otherwise the behavior is undefined.
+ *
+ * :member:`dest->base <sfparse_vec.base>` must point to the buffer
+ * that has sufficient space to store the unescaped string.  The
+ * memory areas pointed by :member:`dest->base <sfparse_vec.base>` and
+ * :member:`src->base <sfparse_vec.base>` must not overlap.
+ *
+ * This function sets the length of unescaped string to
+ * :member:`dest->len <sfparse_vec.len>`.
+ */
+void sfparse_unescape(sfparse_vec *dest, const sfparse_vec *src);
+
+/**
+ * @function
+ *
+ * `sfparse_base64decode` decodes Base64 encoded string |src| and
+ * writes the result into |dest|.  |src| should be the pointer to
+ * :member:`sfparse_value.vec` of type
+ * :enum:`sfparse_type.SFPARSE_TYPE_BYTESEQ` produced by either
+ * `sfparse_parser_dict`, `sfparse_parser_list`,
+ * `sfparse_parser_inner_list`, `sfparse_parser_item`, or
+ * `sfparse_parser_param`, otherwise the behavior is undefined.
+ *
+ * :member:`dest->base <sfparse_vec.base>` must point to the buffer
+ * that has sufficient space to store the decoded byte string.
+ *
+ * This function sets the length of decoded byte string to
+ * :member:`dest->len <sfparse_vec.len>`.
+ */
+void sfparse_base64decode(sfparse_vec *dest, const sfparse_vec *src);
+
+/**
+ * @function
+ *
+ * `sfparse_pctdecode` decodes percent-encoded string |src| and writes
+ * the result into |dest|.  |src| should be the pointer to
+ * :member:`sfparse_value.vec` of type
+ * :enum:`sfparse_type.SFPARSE_TYPE_DISPSTRING` produced by either
+ * `sfparse_parser_dict`, `sfparse_parser_list`,
+ * `sfparse_parser_inner_list`, `sfparse_parser_item`, or
+ * `sfparse_parser_param`, otherwise the behavior is undefined.
+ *
+ * :member:`dest->base <sfparse_vec.base>` must point to the buffer
+ * that has sufficient space to store the decoded byte string.  The
+ * memory areas pointed by :member:`dest->base <sfparse_vec.base>` and
+ * :member:`src->base <sfparse_vec.base>` must not overlap.
+ *
+ * This function sets the length of decoded byte string to
+ * :member:`dest->len <sfparse_vec.len>`.
+ */
+void sfparse_pctdecode(sfparse_vec *dest, const sfparse_vec *src);
+
+#ifdef __cplusplus
+}
+#endif /* defined(__cplusplus) */
+
+#endif /* !defined(SFPARSE_H) */

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است