/*
    This file was generated by the command

       cfunctions unicode.c unicode-character-class.c

    at 23:12:27 on Saturday 24 October 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
#define UNICODE_OK 0

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

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

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

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

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

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

#line 190 "unicode.c"

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

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

#endif /* def TEST */

#endif /* CFH_UNICODE_H */
