From: Jim Meyering Date: Sat, 29 Jul 2000 06:02:28 +0000 (+0000) Subject: (mbswidth): Add a flags argument. X-Git-Tag: cvs-readonly~6395 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=91f65b21df1dc4efd7e28b849c00fe44cd9463e2;hp=15d593c5e659f28d29ff75df0763f59dad1c4c46;p=gnulib.git (mbswidth): Add a flags argument. (mbswidth): New declaration. (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros. --- diff --git a/lib/mbswidth.h b/lib/mbswidth.h index 1ef47d622..f76021b93 100644 --- a/lib/mbswidth.h +++ b/lib/mbswidth.h @@ -23,4 +23,19 @@ # endif #endif -extern int mbswidth PARAMS ((const char *string)); +/* Optional flags to influence mbswidth/mbsnwidth behavior. */ + +/* Assume invalid characters have width 0. If this is not set, the + functions return -1 if an invalid or incomplete character occurs. */ +#define MBSW_ACCEPT_INVALID 1 + +/* Assume unprintable characters have width 1. If this is not set, the + functions return -1 if a non-printable character occurs. */ +#define MBSW_ACCEPT_UNPRINTABLE 2 + +/* Returns the number of screen columns needed for STRING. */ +extern int mbswidth PARAMS ((const char *string, int flags)); + +/* Returns the number of screen columns needed for the NBYTES bytes + starting at BUF. */ +extern int mbsnwidth PARAMS ((const char *buf, size_t nbytes, int flags));