X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmbchar.h;h=f3e28ef5cad45ec872e4eaa52120335cecc6e601;hb=5d0b385594bc914e6233988bfb6bc1b92a2184b5;hp=4472aa0204418623d287fb56ffeba5b6bf6a735c;hpb=ece57f1eec22076c27fcc9f524cde21a10aa2a3a;p=gnulib.git diff --git a/lib/mbchar.h b/lib/mbchar.h index 4472aa020..f3e28ef5c 100644 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -155,9 +155,10 @@ #include #include #include - #include +#include "wcwidth.h" + #define MBCHAR_BUF_SIZE 24 struct mbchar @@ -259,18 +260,18 @@ mb_width_aux (wint_t wc) /* Copying a character. */ static inline void -mb_copy (mbchar_t *new, const mbchar_t *old) +mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc) { - if (old->ptr == &old->buf[0]) + if (old_mbc->ptr == &old_mbc->buf[0]) { - memcpy (&new->buf[0], &old->buf[0], old->bytes); - new->ptr = &new->buf[0]; + memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes); + new_mbc->ptr = &new_mbc->buf[0]; } else - new->ptr = old->ptr; - new->bytes = old->bytes; - if ((new->wc_valid = old->wc_valid)) - new->wc = old->wc; + new_mbc->ptr = old_mbc->ptr; + new_mbc->bytes = old_mbc->bytes; + if ((new_mbc->wc_valid = old_mbc->wc_valid)) + new_mbc->wc = old_mbc->wc; } @@ -304,7 +305,7 @@ mb_copy (mbchar_t *new, const mbchar_t *old) /* The character set is ISO-646, not EBCDIC. */ # define IS_BASIC_ASCII 1 -extern unsigned int is_basic_table[]; +extern const unsigned int is_basic_table[]; static inline bool is_basic (char c)