rlmbutil.h (136644) | rlmbutil.h (157184) |
---|---|
1/* rlmbutil.h -- utility functions for multibyte characters. */ 2 3/* Copyright (C) 2001 Free Software Foundation, Inc. 4 5 This file is part of the GNU Readline Library, a library for 6 reading lines of text with interactive input and history editing. 7 8 The GNU Readline Library is free software; you can redistribute it --- 83 unchanged lines hidden (view full) --- 92extern int _rl_get_char_len PARAMS((char *, mbstate_t *)); 93extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *)); 94 95extern int _rl_read_mbchar PARAMS((char *, int)); 96extern int _rl_read_mbstring PARAMS((int, char *, int)); 97 98extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); 99 | 1/* rlmbutil.h -- utility functions for multibyte characters. */ 2 3/* Copyright (C) 2001 Free Software Foundation, Inc. 4 5 This file is part of the GNU Readline Library, a library for 6 reading lines of text with interactive input and history editing. 7 8 The GNU Readline Library is free software; you can redistribute it --- 83 unchanged lines hidden (view full) --- 92extern int _rl_get_char_len PARAMS((char *, mbstate_t *)); 93extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *)); 94 95extern int _rl_read_mbchar PARAMS((char *, int)); 96extern int _rl_read_mbstring PARAMS((int, char *, int)); 97 98extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); 99 |
100extern wchar_t _rl_char_value PARAMS((char *, int)); 101extern int _rl_walphabetic PARAMS((wchar_t)); 102 103#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) 104#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) 105 106#define MB_NEXTCHAR(b,s,c,f) \ 107 ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ 108 ? _rl_find_next_mbchar ((b), (s), (c), (f)) \ 109 : ((s) + (c))) 110#define MB_PREVCHAR(b,s,f) \ 111 ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ 112 ? _rl_find_prev_mbchar ((b), (s), (f)) \ 113 : ((s) - 1)) 114 |
|
100#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) 101#define MB_NULLWCH(x) ((x) == 0) 102 103#else /* !HANDLE_MULTIBYTE */ 104 105#undef MB_LEN_MAX 106#undef MB_CUR_MAX 107 108#define MB_LEN_MAX 1 109#define MB_CUR_MAX 1 110 111#define _rl_find_prev_mbchar(b, i, f) (((i) == 0) ? (i) : ((i) - 1)) 112#define _rl_find_next_mbchar(b, i1, i2, f) ((i1) + (i2)) 113 | 115#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) 116#define MB_NULLWCH(x) ((x) == 0) 117 118#else /* !HANDLE_MULTIBYTE */ 119 120#undef MB_LEN_MAX 121#undef MB_CUR_MAX 122 123#define MB_LEN_MAX 1 124#define MB_CUR_MAX 1 125 126#define _rl_find_prev_mbchar(b, i, f) (((i) == 0) ? (i) : ((i) - 1)) 127#define _rl_find_next_mbchar(b, i1, i2, f) ((i1) + (i2)) 128 |
129#define _rl_char_value(buf,ind) ((buf)[(ind)]) 130 131#define _rl_walphabetic(c) (rl_alphabetic (c)) 132 133#define _rl_to_wupper(c) (_rl_to_upper (c)) 134#define _rl_to_wlower(c) (_rl_to_lower (c)) 135 136#define MB_NEXTCHAR(b,s,c,f) ((s) + (c)) 137#define MB_PREVCHAR(b,s,f) ((s) - 1) 138 |
|
114#define MB_INVALIDCH(x) (0) 115#define MB_NULLWCH(x) (0) 116 117#endif /* !HANDLE_MULTIBYTE */ 118 119extern int rl_byte_oriented; 120 121#endif /* _RL_MBUTIL_H_ */ | 139#define MB_INVALIDCH(x) (0) 140#define MB_NULLWCH(x) (0) 141 142#endif /* !HANDLE_MULTIBYTE */ 143 144extern int rl_byte_oriented; 145 146#endif /* _RL_MBUTIL_H_ */ |