Fix missing pointer dereference and missing assignment.
[gwm.git] / utf8.h
blob3bc778571980feb13c604b6da83fe400e7fdd3af
1 #ifndef UTF8_H
2 #define UTF8_H
4 enum gwm_encoding {
5 ENCODING_COMPOUND, /* X Consortium Compound Text (ISO 2022-like) */
6 ENCODING_LATIN_1 /* ISO 8859-1 */
7 };
9 extern char *to_utf8( enum gwm_encoding encoding, const char *in, size_t len );
11 /* Return a pointer to the first illegal byte in STR, or NULL if the
12 entire string is legal. */
13 extern PURE unsigned char *utf8_illegal( const unsigned char *str );
15 /* Return the number of characters in STR. */
16 extern PURE int utf8_length( const unsigned char *str );
18 /* Duplicate a UTF-8 string. The output is allocated with malloc() and
19 is guaranteed to be a legal UTF-8 sequence, even if the input was not. */
20 extern MALLOC unsigned char *utf8_dup_valid_len( const unsigned char *str,
21 int num_bytes );
22 extern MALLOC unsigned char *utf8_dup_valid( const unsigned char *str );
24 /* Return the character pointed to by P (which is advanced). */
25 extern uint32_t utf8_next( const unsigned char **p );
27 #if DEBUG
28 extern void cleanup_utf8( void );
29 #endif
31 #endif