1 #ifndef UTF8_H 2 #define UTF8_H 3 4 #ifdef HAVE_NCURSESW_H 5 # include <ncursesw/curses.h> 6 #elif HAVE_NCURSES_H 7 # include <ncurses.h> 8 #else 9 # include <curses.h> 10 #endif 11 12 #include <stdarg.h> 13 #ifdef HAVE_ICONV 14 # include <iconv.h> 15 #endif 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 /* parameter passed to wcswidth() as a maximum width */ 22 #define WIDTH_MAX 2048 23 24 void utf8_init (); 25 void utf8_cleanup (); 26 int xwaddstr (WINDOW *win, const char *str); 27 int xwaddnstr (WINDOW *win, const char *str, const int n); 28 int xmvwaddstr (WINDOW *win, const int y, const int x, const char *str); 29 int xmvwaddnstr (WINDOW *win, const int y, const int x, const char *str, 30 const int n); 31 #ifdef HAVE__ATTRIBUTE__ 32 int xwprintw (WINDOW *win, const char *fmt, ...) 33 __attribute__ ((format (printf, 2, 3))); 34 #else 35 int xwprintw (WINDOW *win, const char *fmt, ...); 36 #endif 37 38 size_t strwidth (const char *s); 39 char *xstrtail (const char *str, const int len); 40 41 char *iconv_str (const iconv_t desc, const char *str); 42 char *files_iconv_str (const char *str); 43 char *xterm_iconv_str (const char *str); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif 50