Support mcel API for apps that prefer it.
The following changes are in effect only if GNULIB_MCEL_PREFER.
* lib/exclude.c: Include mcel.h instead of mbuiter.h.
(string_hasher_ci): Use mcel_scanz instead of mbui_init,
mbui_avail, mbui_cur, and mbui_advance.
* modules/exclude: Do not depend on mbuiter.
2023-09-07 Paul Eggert <eggert@cs.ucla.edu>
+ exclude: support GNULIB_MCEL_PREFER
+ Support mcel API for apps that prefer it.
+ The following changes are in effect only if GNULIB_MCEL_PREFER.
+ * lib/exclude.c: Include mcel.h instead of mbuiter.h.
+ (string_hasher_ci): Use mcel_scanz instead of mbui_init,
+ mbui_avail, mbui_cur, and mbui_advance.
+ * modules/exclude: Do not depend on mbuiter.
+
mcel-prefer: new module
* modules/mcel-prefer: New file.
#include "filename.h"
#include "fnmatch.h"
#include "hash.h"
-#include "mbuiter.h"
+#if GNULIB_MCEL_PREFER
+# include "mcel.h"
+#else
+# include "mbuiter.h"
+#endif
#include "xalloc.h"
#if GNULIB_EXCLUDE_SINGLE_THREAD
char const *p = data;
size_t value = 0;
+#if GNULIB_MCEL_PREFER
+ while (*p)
+ {
+ mcel_t g = mcel_scanz (p);
+ value = value * 31 + (c32tolower (g.ch) - g.err);
+ p += g.len;
+ }
+#else
mbui_iterator_t iter;
+
for (mbui_init (iter, p); mbui_avail (iter); mbui_advance (iter))
{
mbchar_t m = mbui_cur (iter);
value = value * 31 + wc;
}
+#endif
return value % n_buckets;
}
fopen-gnu
hash
mbscasecmp
-mbuiter
+mbuiter [test "$GNULIB_MCEL_PREFER" != yes]
nullptr
regex
stdbool