X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=utf8%2Futf8tools.h;h=d2e4e981126d8e50577cf95f98ce2457e2f000dc;hb=96dfbdbed170533839ea6848d6c03d36bf3f1947;hp=f7e25ae77ad15619997001ab1da3452f60fa730e;hpb=18ff02c2f0dff12904dbd2dc4d6c40ef3ad4a6d2;p=gedcom-parse.git diff --git a/utf8/utf8tools.h b/utf8/utf8tools.h index f7e25ae..d2e4e98 100644 --- a/utf8/utf8tools.h +++ b/utf8/utf8tools.h @@ -20,8 +20,8 @@ /* $Id$ */ /* $Name$ */ -#ifndef __UTF8_H -#define __UTF8_H +#ifndef __UTF8TOOLS_H +#define __UTF8TOOLS_H #ifdef __cplusplus extern "C" { @@ -41,6 +41,12 @@ int utf8_strlen(const char* input); /* Returns 1 if string is valid UTF-8 string, 0 otherwise */ int is_utf8_string(const char* input); + /* Returns respectively a pointer to the next or the nth UTF-8 character. + The value n = 0 is the first character of the input, i.e. + next_utf8_char(input) is the same as nth_utf8_char(input, 1) */ +char* next_utf8_char(char* input); +char* nth_utf8_char(char* input, int n); + /* Functions for creating and freeing conversion buffers yourself */ conv_buffer_t create_conv_buffer(int size); void free_conv_buffer(conv_buffer_t buf); @@ -68,4 +74,4 @@ char* convert_locale_to_utf8(const char* input); } #endif -#endif /* __UTF8_H */ +#endif /* __UTF8TOOLS_H */