xref: /illumos-gate/usr/src/lib/libc/port/locale/tolower.c (revision 6b5e5868)
14297a3b0SGarrett D'Amore /*
2*6b5e5868SGarrett D'Amore  * This file and its contents are supplied under the terms of the
3*6b5e5868SGarrett D'Amore  * Common Development and Distribution License ("CDDL"), version 1.0.
4*6b5e5868SGarrett D'Amore  * You may only use this file in accordance with the terms version
5*6b5e5868SGarrett D'Amore  * 1.0 of the CDDL.
64297a3b0SGarrett D'Amore  *
7*6b5e5868SGarrett D'Amore  * A full copy of the text of the CDDL should have accompanied this
8*6b5e5868SGarrett D'Amore  * source.  A copy is of the CDDL is also available via the Internet
9*6b5e5868SGarrett D'Amore  * at http://www.illumos.org/license/CDDL.
104297a3b0SGarrett D'Amore  */
114297a3b0SGarrett D'Amore 
124297a3b0SGarrett D'Amore /*
134297a3b0SGarrett D'Amore  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
144297a3b0SGarrett D'Amore  */
154297a3b0SGarrett D'Amore #include "lint.h"
164297a3b0SGarrett D'Amore #include <ctype.h>
174297a3b0SGarrett D'Amore 
184297a3b0SGarrett D'Amore #pragma weak _tolower = tolower
194297a3b0SGarrett D'Amore #pragma weak _toupper = toupper
204297a3b0SGarrett D'Amore 
214297a3b0SGarrett D'Amore int
224297a3b0SGarrett D'Amore tolower(int c)
234297a3b0SGarrett D'Amore {
244297a3b0SGarrett D'Amore 	return (((unsigned)c > 255) ? c : __trans_lower[c]);
254297a3b0SGarrett D'Amore }
264297a3b0SGarrett D'Amore 
274297a3b0SGarrett D'Amore int
284297a3b0SGarrett D'Amore toupper(int c)
294297a3b0SGarrett D'Amore {
304297a3b0SGarrett D'Amore 	return (((unsigned)c > 255) ? c : __trans_upper[c]);
314297a3b0SGarrett D'Amore }
32