From eb87367179effbe5f430236db8259006d71438b7 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Tue, 9 Nov 2004 21:37:25 +0000 Subject: Imported from ../bash-3.0.16.tar.gz. --- include/shmbutil.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/shmbutil.h') diff --git a/include/shmbutil.h b/include/shmbutil.h index a737780..1139d50 100644 --- a/include/shmbutil.h +++ b/include/shmbutil.h @@ -31,6 +31,8 @@ extern size_t xmbsrtowcs __P((wchar_t *, const char **, size_t, mbstate_t *)); extern size_t xdupmbstowcs __P((wchar_t **, char ***, const char *)); +extern size_t mbstrlen __P((const char *)); + extern char *xstrchr __P((const char *, int)); #ifndef MB_INVALIDCH @@ -38,6 +40,9 @@ extern char *xstrchr __P((const char *, int)); #define MB_NULLWCH(x) ((x) == 0) #endif +#define MBSLEN(s) (((s) && (s)[0]) ? ((s)[1] ? mbstrlen (s) : 1) : 0) +#define MB_STRLEN(s) ((MB_CUR_MAX > 1) ? MBSLEN (s) : STRLEN (s)) + #else /* !HANDLE_MULTIBYTE */ #undef MB_LEN_MAX @@ -54,6 +59,8 @@ extern char *xstrchr __P((const char *, int)); #define MB_NULLWCH(x) (0) #endif +#define MB_STRLEN(s) (STRLEN(s)) + #endif /* !HANDLE_MULTIBYTE */ /* Declare and initialize a multibyte state. Call must be terminated -- cgit v1.2.3