xref: /netbsd-src/lib/libc/locale/freelocale.c (revision e0ac190e1e4142d8158f3a99bc575fef0a0a0a5c)
1*e0ac190eSjoerg /* $NetBSD: freelocale.c,v 1.2 2013/05/17 12:55:57 joerg Exp $ */
281d0329eSjoerg 
381d0329eSjoerg /*-
481d0329eSjoerg  * Copyright (c)2008, 2011 Citrus Project,
581d0329eSjoerg  * All rights reserved.
681d0329eSjoerg  *
781d0329eSjoerg  * Redistribution and use in source and binary forms, with or without
881d0329eSjoerg  * modification, are permitted provided that the following conditions
981d0329eSjoerg  * are met:
1081d0329eSjoerg  * 1. Redistributions of source code must retain the above copyright
1181d0329eSjoerg  *    notice, this list of conditions and the following disclaimer.
1281d0329eSjoerg  * 2. Redistributions in binary form must reproduce the above copyright
1381d0329eSjoerg  *    notice, this list of conditions and the following disclaimer in the
1481d0329eSjoerg  *    documentation and/or other materials provided with the distribution.
1581d0329eSjoerg  *
1681d0329eSjoerg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1781d0329eSjoerg  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1881d0329eSjoerg  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1981d0329eSjoerg  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2081d0329eSjoerg  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2181d0329eSjoerg  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2281d0329eSjoerg  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2381d0329eSjoerg  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2481d0329eSjoerg  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2581d0329eSjoerg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2681d0329eSjoerg  * SUCH DAMAGE.
2781d0329eSjoerg  */
2881d0329eSjoerg 
2981d0329eSjoerg #include <sys/cdefs.h>
30*e0ac190eSjoerg __RCSID("$NetBSD: freelocale.c,v 1.2 2013/05/17 12:55:57 joerg Exp $");
3181d0329eSjoerg 
3281d0329eSjoerg #include "namespace.h"
3381d0329eSjoerg 
3481d0329eSjoerg #define __SETLOCALE_SOURCE__
3581d0329eSjoerg #include <assert.h>
3681d0329eSjoerg #include <locale.h>
3781d0329eSjoerg #include <stdlib.h>
3881d0329eSjoerg 
3981d0329eSjoerg #include "setlocale_local.h"
4081d0329eSjoerg 
__weak_alias(freelocale,_freelocale)4181d0329eSjoerg __weak_alias(freelocale, _freelocale)
4281d0329eSjoerg 
4381d0329eSjoerg void
4481d0329eSjoerg freelocale(locale_t locale)
4581d0329eSjoerg {
4681d0329eSjoerg 
47*e0ac190eSjoerg 	_DIAGASSERT(locale != LC_GLOBAL_LOCALE);
48*e0ac190eSjoerg 	_DIAGASSERT(locale != LC_C_LOCALE);
4981d0329eSjoerg 	_DIAGASSERT(locale != NULL);
5081d0329eSjoerg 	free(locale);
5181d0329eSjoerg }
52