Sync usage with man page.
[netbsd-mini2440.git] / distrib / utils / libhack / setlocale.c
blob1d2fea2a513483894ad563ea9b593babca1144d6
1 /* $NetBSD: setlocale.c,v 1.3 2000/08/11 19:58:34 tshiozak Exp $ */
3 /*
4 * Written by Gordon W. Ross <gwr@NetBSD.org>
5 * Public domain.
6 */
8 #include <sys/localedef.h>
9 #include <stdlib.h>
10 #define __SETLOCALE_SOURCE__
11 #include <locale.h>
14 * Cheap and dirty setlocale() that is just good enough to
15 * satisfy references in programs like cat that do:
16 * setlocale(LC_ALL, "");
17 * Offered with apologies to all non-english speakers...
20 static char current_locale[32] = { "C" };
22 size_t __mb_cur_max = 1;
24 char *
25 __setlocale_mb_len_max_32(category, locale)
26 int category;
27 const char *locale;
29 if (category < 0 || category >= _LC_LAST)
30 return (NULL);
32 /* No change of locale is allowed. */
33 if (locale && locale[0])
34 return(NULL);
36 return (current_locale);