Reuben Thomas wrote: > As far as I can see, there is an implementation of isblank in gnulib > for systems that lack it, but I can't see how I'm supposed to use it: > I can see the module c-ctypes which seems to be specifically for the C > locale, and unictype/ctype-blank module, which mentions > "generalisation", though it's not clear to me of what. What do I use > if I just want to get the C99 "isblank" macro/function from ctype.h? > > Sorry if I'm being dense, but perhaps there's an opportunity for > clarification here?
The relevant documentation in gnulib for this function is in the file doc/posix-functions/isblank.texi: "Gnulib module: --- Portability problems fixed by Gnulib: @itemize @end itemize Portability problems not fixed by Gnulib: @itemize @item This function is missing on some platforms: AIX 4.3.2, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw. @end itemize " This means that gnulib does not provide you a module that guarantees an 'isblank' function. The reasons include: 1) No one asked for it so far. 2) On all known platforms, in all predefined locales, isblank(c) is likely equivalent with (c == ' ' || c == '\t'). Look at the glibc definition (in glibc/localedata/locales/i18n): The "blank" characters are '\t', ' ', U+1680, U+180E, U+2000..U+2006, U+2008..U+200A, U+205F, U+3000, and none except the two is present in a common 8-bit encoding. So instead of using this function, with platform dependent semantics, most programs will either want the pure ASCII version (c_isblank) or the Unicode aware version (uc_is_blank). Bruno