mercurial/cext/charencode.c
changeset 36096 81199632fa42
parent 34860 d0912876d7a7
child 36263 6c87d4113a90
equal deleted inserted replaced
36095:7f8338b87c88 36096:81199632fa42
    63 	'\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', /* h-o */
    63 	'\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', /* h-o */
    64 	'\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', /* p-w */
    64 	'\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', /* p-w */
    65 	'\x58', '\x59', '\x5a', 					/* x-z */
    65 	'\x58', '\x59', '\x5a', 					/* x-z */
    66 				'\x7b', '\x7c', '\x7d', '\x7e', '\x7f'
    66 				'\x7b', '\x7c', '\x7d', '\x7e', '\x7f'
    67 };
    67 };
    68 /* clang-format on */
       
    69 
    68 
    70 /* 1: no escape, 2: \<c>, 6: \u<x> */
    69 /* 1: no escape, 2: \<c>, 6: \u<x> */
    71 static const uint8_t jsonlentable[256] = {
    70 static const uint8_t jsonlentable[256] = {
    72 	6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 6, 2, 2, 6, 6, /* b, t, n, f, r */
    71 	6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 6, 2, 2, 6, 6, /* b, t, n, f, r */
    73 	6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
    72 	6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
   100 
    99 
   101 static const char hexchartable[16] = {
   100 static const char hexchartable[16] = {
   102 	'0', '1', '2', '3', '4', '5', '6', '7',
   101 	'0', '1', '2', '3', '4', '5', '6', '7',
   103 	'8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
   102 	'8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
   104 };
   103 };
       
   104 /* clang-format on */
   105 
   105 
   106 /*
   106 /*
   107  * Turn a hex-encoded string into binary.
   107  * Turn a hex-encoded string into binary.
   108  */
   108  */
   109 PyObject *unhexlify(const char *str, Py_ssize_t len)
   109 PyObject *unhexlify(const char *str, Py_ssize_t len)