setlocale.c (73341) | setlocale.c (89739) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1996 - 2001 FreeBSD Project | 2 * Copyright (c) 1996 - 2002 FreeBSD Project |
3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Paul Borman at Krystal Technologies. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 21 unchanged lines hidden (view full) --- 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37 38#ifdef LIBC_RCS 39static const char rcsid[] = | 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Paul Borman at Krystal Technologies. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 21 unchanged lines hidden (view full) --- 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37 38#ifdef LIBC_RCS 39static const char rcsid[] = |
40 "$FreeBSD: head/lib/libc/locale/setlocale.c 73341 2001-03-02 13:00:26Z ru $"; | 40 "$FreeBSD: head/lib/libc/locale/setlocale.c 89739 2002-01-24 15:38:59Z phantom $"; |
41#endif 42 43#if defined(LIBC_SCCS) && !defined(lint) 44static char sccsid[] = "@(#)setlocale.c 8.1 (Berkeley) 7/4/93"; 45#endif /* LIBC_SCCS and not lint */ 46 47#include <sys/types.h> 48#include <sys/stat.h> 49#include <limits.h> 50#include <locale.h> 51#include <rune.h> 52#include <stdlib.h> 53#include <string.h> 54#include <unistd.h> 55#include "collate.h" 56#include "lmonetary.h" /* for __monetary_load_locale() */ 57#include "lnumeric.h" /* for __numeric_load_locale() */ 58#include "lmessages.h" /* for __messages_load_locale() */ 59#include "setlocale.h" | 41#endif 42 43#if defined(LIBC_SCCS) && !defined(lint) 44static char sccsid[] = "@(#)setlocale.c 8.1 (Berkeley) 7/4/93"; 45#endif /* LIBC_SCCS and not lint */ 46 47#include <sys/types.h> 48#include <sys/stat.h> 49#include <limits.h> 50#include <locale.h> 51#include <rune.h> 52#include <stdlib.h> 53#include <string.h> 54#include <unistd.h> 55#include "collate.h" 56#include "lmonetary.h" /* for __monetary_load_locale() */ 57#include "lnumeric.h" /* for __numeric_load_locale() */ 58#include "lmessages.h" /* for __messages_load_locale() */ 59#include "setlocale.h" |
60#include "../stdtime/timelocal.h" /* for __time_load_locale() */ |
|
60 61/* 62 * Category names for getenv() 63 */ 64static char *categories[_LC_LAST] = { 65 "LC_ALL", 66 "LC_COLLATE", 67 "LC_CTYPE", --- 22 unchanged lines hidden (view full) --- 90static char new_categories[_LC_LAST][ENCODING_LEN + 1]; 91static char saved_categories[_LC_LAST][ENCODING_LEN + 1]; 92 93static char current_locale_string[_LC_LAST * (ENCODING_LEN + 1/*"/"*/ + 1)]; 94 95static char *currentlocale __P((void)); 96static char *loadlocale __P((int)); 97 | 61 62/* 63 * Category names for getenv() 64 */ 65static char *categories[_LC_LAST] = { 66 "LC_ALL", 67 "LC_COLLATE", 68 "LC_CTYPE", --- 22 unchanged lines hidden (view full) --- 91static char new_categories[_LC_LAST][ENCODING_LEN + 1]; 92static char saved_categories[_LC_LAST][ENCODING_LEN + 1]; 93 94static char current_locale_string[_LC_LAST * (ENCODING_LEN + 1/*"/"*/ + 1)]; 95 96static char *currentlocale __P((void)); 97static char *loadlocale __P((int)); 98 |
98extern int __time_load_locale __P((const char *)); /* strftime.c */ 99 | |
100char * 101setlocale(category, locale) 102 int category; 103 const char *locale; 104{ 105 int i, j, len; 106 char *env, *r; 107 --- 163 unchanged lines hidden --- | 99char * 100setlocale(category, locale) 101 int category; 102 const char *locale; 103{ 104 int i, j, len; 105 char *env, *r; 106 --- 163 unchanged lines hidden --- |