/*
    This file was generated by the command

       cfunctions unicode.c unicode-character-class.c

    at 08:34:47 on Thursday 24 September 2015, local time.
*/
#ifndef CFH_UNICODE_H
#define CFH_UNICODE_H

/* From 'unicode.c': */

#line 6 "unicode.c"
#define UTF8_MAX_LENGTH 4
#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

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

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

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

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

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

#line 170 "unicode.c"

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

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

#endif /* def TEST */

#endif /* CFH_UNICODE_H */
