diff options
author | Jim Meyering <jim@meyering.net> | 2002-11-23 14:59:39 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-11-23 14:59:39 +0000 |
commit | ba986c2928e90b6e30d90a69066e6ae077222fba (patch) | |
tree | 8532ee64a1486c823c2e3de259dbe951013d9353 /lib/mbswidth.c | |
parent | 34c25ed945b375317ee4fbfb6cb5dfbea4d6fb9a (diff) | |
download | coreutils-ba986c2928e90b6e30d90a69066e6ae077222fba.tar.xz |
Update from gnulib.
Diffstat (limited to 'lib/mbswidth.c')
-rw-r--r-- | lib/mbswidth.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/mbswidth.c b/lib/mbswidth.c index 69a801cea..a2ef5b3fd 100644 --- a/lib/mbswidth.c +++ b/lib/mbswidth.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a string. - Copyright (C) 2000-2001 Free Software Foundation, Inc. + Copyright (C) 2000-2002 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 @@ -21,6 +21,9 @@ # include <config.h> #endif +/* Specification. */ +#include "mbswidth.h" + /* Get MB_CUR_MAX. */ #include <stdlib.h> @@ -78,17 +81,13 @@ int wcwidth (); #undef ISCNTRL #define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c)) -#include "mbswidth.h" - /* Returns the number of columns needed to represent the multibyte character string pointed to by STRING. If a non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. With flags = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE, this is the multibyte analogon of the wcswidth function. */ int -mbswidth (string, flags) - const char *string; - int flags; +mbswidth (const char *string, int flags) { return mbsnwidth (string, strlen (string), flags); } @@ -98,10 +97,7 @@ mbswidth (string, flags) non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. */ int -mbsnwidth (string, nbytes, flags) - const char *string; - size_t nbytes; - int flags; +mbsnwidth (const char *string, size_t nbytes, int flags) { const char *p = string; const char *plimit = p + nbytes; |