1/* $NetBSD: setlocale.c,v 1.4 2003/07/26 17:07:36 salo Exp $ */ 2 3/* 4 * Written by Gordon W. Ross <gwr@NetBSD.org> 5 * Public domain. 6 */ 7 8#include <stdlib.h> 9#include <locale.h> 10 11/* 12 * Cheap and dirty setlocale() that is just good enough to 13 * satisfy references in programs like cat that do: 14 * setlocale(LC_ALL, ""); 15 * Offered with apologies to all non-english speakers... 16 */ 17 18static char current_locale[32] = { "C" }; 19 20char * 21setlocale(category, locale) 22 int category; 23 const char *locale; 24{ 25 if (category < 0 || category >= _LC_LAST) 26 return (NULL); 27 28 /* No change of locale is allowed. */ 29 if (locale && locale[0]) 30 return(NULL); 31 32 return (current_locale); 33} 34