Mercurial > ~mikael > mcabber > hg
view mcabber/src/utf8.h @ 1417:783b47c9d963
Allow more than the 16 default colors (patch from mjs)
If the terminal supports more than 16 colors (e.g. xterm-256color),
the color numbers can be set in place of the color names.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 20 Jan 2008 22:46:16 +0100 |
parents | 0f7e0346d9cb |
children | 481b60da99c9 |
line wrap: on
line source
#ifndef __UTF8_H__ #define __UTF8_H__ 1 #include <config.h> #if defined HAVE_UNICODE && defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H # define UNICODE #endif #ifdef HAVE_WCHAR_H # include <wchar.h> # define get_char_width(c) (utf8_mode ? wcwidth(get_char(c)) : 1) #else # define wcwidth(c) 1 # define get_char_width(c) 1 #endif #ifdef HAVE_WCTYPE_H # include <wctype.h> #else # define iswblank(c) (c == ' ') # define iswalnum(c) isalnum(c) # define iswprint(c) isprint(c) # define towupper(c) toupper(c) # define towlower(c) tolower(c) # define iswalpha(c) isalpha(c) #endif extern int utf8_mode; char *prev_char(char *str, const char *limit); char *next_char(char *str); unsigned get_char(const char *str); char *put_char(char *str, unsigned c); #endif /* __UTF8_H__ */ /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */