1*ace5b9b5Schristos /* $NetBSD: compat_setlocale1.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */
29efec5bcStnozaki
39efec5bcStnozaki /*-
49efec5bcStnozaki * Copyright (c)1999 Citrus Project,
59efec5bcStnozaki * All rights reserved.
69efec5bcStnozaki *
79efec5bcStnozaki * Redistribution and use in source and binary forms, with or without
89efec5bcStnozaki * modification, are permitted provided that the following conditions
99efec5bcStnozaki * are met:
109efec5bcStnozaki * 1. Redistributions of source code must retain the above copyright
119efec5bcStnozaki * notice, this list of conditions and the following disclaimer.
129efec5bcStnozaki * 2. Redistributions in binary form must reproduce the above copyright
139efec5bcStnozaki * notice, this list of conditions and the following disclaimer in the
149efec5bcStnozaki * documentation and/or other materials provided with the distribution.
159efec5bcStnozaki *
169efec5bcStnozaki * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
179efec5bcStnozaki * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
189efec5bcStnozaki * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199efec5bcStnozaki * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
209efec5bcStnozaki * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
219efec5bcStnozaki * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
229efec5bcStnozaki * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
239efec5bcStnozaki * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
249efec5bcStnozaki * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
259efec5bcStnozaki * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
269efec5bcStnozaki * SUCH DAMAGE.
279efec5bcStnozaki *
289efec5bcStnozaki * NetBSD: setlocale1.c,v 1.4 2010/05/22 13:50:02 tnozaki Exp
299efec5bcStnozaki */
309efec5bcStnozaki
319efec5bcStnozaki #include <sys/cdefs.h>
329efec5bcStnozaki #if defined(LIBC_SCCS) && !defined(lint)
33*ace5b9b5Schristos __RCSID("$NetBSD: compat_setlocale1.c,v 1.3 2024/01/20 14:52:46 christos Exp $");
349efec5bcStnozaki #endif /* LIBC_SCCS and not lint */
359efec5bcStnozaki
369efec5bcStnozaki #include <sys/types.h>
379efec5bcStnozaki #include <compat/include/locale.h>
389efec5bcStnozaki
399efec5bcStnozaki #include "setlocale_local.h"
409efec5bcStnozaki
41bdfde3daSjoerg #undef setlocale
42bdfde3daSjoerg
439efec5bcStnozaki __warn_references(setlocale,
449efec5bcStnozaki "warning: reference to compatibility setlocale();"
459efec5bcStnozaki "include <locale.h> for correct reference")
469efec5bcStnozaki
47bdfde3daSjoerg char *
compat_setlocale(int category,const char * locale)48bdfde3daSjoerg compat_setlocale(int category, const char *locale)
499efec5bcStnozaki {
509efec5bcStnozaki
519efec5bcStnozaki /* locale may be NULL */
529efec5bcStnozaki
539efec5bcStnozaki __mb_len_max_runtime = 1;
549efec5bcStnozaki return __setlocale(category, locale);
559efec5bcStnozaki }
56