/*
    This file was generated by the command

       cfunctions unicode.c unicode-character-class.c

    at 07:48:57 on Sunday 13 November 2016, local time.
*/
#ifndef CFH_UNICODE_H
#define CFH_UNICODE_H

/* From 'unicode.c': */

#line 15 "unicode.c"
#define UTF8_MAX_LENGTH 5
#define UNICODE_BAD_INPUT -1
#define UNICODE_SURROGATE_PAIR -2
#define UNICODE_NOT_SURROGATE_PAIR -3
#define UNICODE_BAD_UTF8 -4
#define UNICODE_EMPTY_INPUT -5
#define UNICODE_NON_SHORTEST -6
#define UNICODE_TOO_BIG -7
#define UNICODE_NOT_CHARACTER -8
#define UNICODE_MAXIMUM 0x10ffff
#define UNICODE_UTF8_4 0x1fffff
#define UNICODE_OK 0

#line 73 "unicode.c"
int utf8_bytes (unsigned char c );

#line 94 "unicode.c"
int utf8_no_checks (const unsigned char * input , const unsigned char ** end_ptr );

#line 139 "unicode.c"
int utf8_to_ucs2 (const unsigned char * input , const unsigned char ** end_ptr );

#line 235 "unicode.c"
int ucs2_to_utf8 (int ucs2 , unsigned char * utf8 );

#line 273 "unicode.c"
int surrogate_to_utf8 (int hi , int lo , unsigned char * utf8 );

#line 309 "unicode.c"
int unicode_to_surrogates (unsigned unicode , unsigned * hi_ptr , unsigned * lo_ptr );

#line 338 "unicode.c"
int surrogates_to_unicode (unsigned hi , unsigned lo );

#line 360 "unicode.c"
int unicode_chars_to_bytes (const unsigned char * utf8 , int n_chars );

#line 385 "unicode.c"
int unicode_count_chars (const unsigned char * utf8 );

#line 410 "unicode.c"
#define VALID_UTF8 1
#define INVALID_UTF8 0

#line 476 "unicode.c"
int valid_utf8 (const unsigned char * input , int input_length );

#line 616 "unicode.c"

#ifdef TEST
void print_bytes (const unsigned char * bytes );

#line 638 "unicode.c"
void test_ucs2_to_utf8 (const unsigned char * input , int * count );

#endif /* def TEST */

#endif /* CFH_UNICODE_H */
