Browse Source

Make json_get_utf8_char_len public

rexim 5 years ago
parent
commit
b8433ec889
2 changed files with 3 additions and 1 deletions
  1. 1 1
      frozen.c
  2. 2 0
      frozen.h

+ 1 - 1
frozen.c

@@ -224,7 +224,7 @@ static int json_parse_identifier(struct frozen *f) {
   return 0;
   return 0;
 }
 }
 
 
-static int json_get_utf8_char_len(unsigned char ch) {
+int json_get_utf8_char_len(unsigned char ch) {
   if ((ch & 0x80) == 0) return 1;
   if ((ch & 0x80) == 0) return 1;
   switch (ch & 0xf0) {
   switch (ch & 0xf0) {
     case 0xf0:
     case 0xf0:

+ 2 - 0
frozen.h

@@ -253,6 +253,8 @@ int json_unescape(const char *src, int slen, char *dst, int dlen);
  */
  */
 int json_escape(struct json_out *out, const char *str, size_t str_len);
 int json_escape(struct json_out *out, const char *str, size_t str_len);
 
 
+int json_get_utf8_char_len(unsigned char ch);
+
 /*
 /*
  * Read the whole file in memory.
  * Read the whole file in memory.
  * Return malloc-ed file content, or NULL on error. The caller must free().
  * Return malloc-ed file content, or NULL on error. The caller must free().