comparison mcabber/mcabber/utf8.h @ 1668:41c26b7d2890

Install mcabber headers * Change mcabber headers naming scheme * Move 'src/' -> 'mcabber/' * Add missing include <mcabber/config.h>'s * Create and install clean config.h version in 'include/' * Move "dirty" config.h version to 'mcabber/' * Add $(top_srcdir) to compiler include path * Update modules HOWTO
author Myhailo Danylenko <isbear@ukrpost.net>
date Mon, 18 Jan 2010 15:36:19 +0200
parents mcabber/src/utf8.h@481b60da99c9
children e6d355e50d7a
comparison
equal deleted inserted replaced
1667:8af0e0ad20ad 1668:41c26b7d2890
1 #ifndef __MCABBER_UTF8_H__
2 #define __MCABBER_UTF8_H__ 1
3
4 #include <mcabber/config.h>
5
6 #if defined HAVE_UNICODE && defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H
7 # define UNICODE
8 #endif
9
10 #ifdef HAVE_WCHAR_H
11 # include <wchar.h>
12 # define get_char_width(c) (utf8_mode ? wcwidth(get_char(c)) : 1)
13 #else
14 # define wcwidth(c) 1
15 # define get_char_width(c) 1
16 #endif
17
18 #ifdef HAVE_WCTYPE_H
19 # include <wctype.h>
20
21 /* The following bit is a hack for Solaris 8&9 systems that don't have
22 * iswblank().
23 * For now i made sure it comes after wctype.h so it doesn't create
24 * problems (wctype.h has calls to iswblank() before wctype() is declared).
25 * (Sebastian Kayser)
26 */
27 # ifndef HAVE_ISWBLANK
28 # define iswblank(wc) iswctype(wc, wctype("blank"))
29 # endif
30
31 #else
32 # define iswblank(c) (c == ' ')
33 # define iswalnum(c) isalnum(c)
34 # define iswprint(c) isprint(c)
35 # define towupper(c) toupper(c)
36 # define towlower(c) tolower(c)
37 # define iswalpha(c) isalpha(c)
38 #endif
39
40 extern int utf8_mode;
41
42 char *prev_char(char *str, const char *limit);
43 char *next_char(char *str);
44 unsigned get_char(const char *str);
45 char *put_char(char *str, unsigned c);
46
47 #endif /* __MCABBER_UTF8_H__ */
48
49 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */