date and time created 91/03/06 18:09:53 by bostic
[unix-history] / usr / src / lib / libc / locale / setlocale.c
CommitLineData
efb19685
CT
1/*
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 */
7
8#if defined(LIBC_SCCS) && !defined(lint)
af482fc3 9static char sccsid[] = "@(#)setlocale.c 5.2 (Berkeley) %G%";
efb19685
CT
10#endif /* LIBC_SCCS and not lint */
11
12#include <locale.h>
af482fc3 13#include <string.h>
efb19685
CT
14
15static char C[] = "C";
16
17/*
18 * The setlocale function.
19 *
20 * Sorry, for now we only accept the C locale.
21 */
22char *
23setlocale(category, locale)
24 int category;
af482fc3 25 const char *locale;
efb19685 26{
af482fc3 27 if ((unsigned int)category >= _LC_LAST)
efb19685
CT
28 return (NULL);
29 if (locale == NULL)
30 return (C);
af482fc3 31 return(strcmp(locale, C) ? NULL : C);
efb19685 32}