176612Stshiozak/*- 276612Stshiozak * Copyright (c) 1990, 1993 376612Stshiozak * The Regents of the University of California. All rights reserved. 476612Stshiozak * 576612Stshiozak * This code is derived from software contributed to Berkeley by 676612Stshiozak * Chris Torek. 776612Stshiozak * 876612Stshiozak * Redistribution and use in source and binary forms, with or without 976612Stshiozak * modification, are permitted provided that the following conditions 1076612Stshiozak * are met: 1176612Stshiozak * 1. Redistributions of source code must retain the above copyright 1276612Stshiozak * notice, this list of conditions and the following disclaimer. 1376612Stshiozak * 2. Redistributions in binary form must reproduce the above copyright 1476612Stshiozak * notice, this list of conditions and the following disclaimer in the 1576612Stshiozak * documentation and/or other materials provided with the distribution. 16251069Semaste * 3. Neither the name of the University nor the names of its contributors 1776612Stshiozak * may be used to endorse or promote products derived from this software 1876612Stshiozak * without specific prior written permission. 1976612Stshiozak * 2076612Stshiozak * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2176612Stshiozak * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2276612Stshiozak * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2376612Stshiozak * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2476612Stshiozak * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2576612Stshiozak * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2676612Stshiozak * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2776612Stshiozak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2876612Stshiozak * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2976612Stshiozak * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3076612Stshiozak * SUCH DAMAGE. 3176612Stshiozak */ 3276612Stshiozak 3376612Stshiozak#include <sys/cdefs.h> 3476612Stshiozak#if defined(LIBC_SCCS) && !defined(lint) 3576612Stshiozakstatic char sccsid[] = "@(#)strcmp.c 8.1 (Berkeley) 6/4/93"; 3692986Sobrien#if 0 37105787Stjr__RCSID("$NetBSD: wcscmp.c,v 1.3 2001/01/05 12:13:12 itojun Exp $"); 3892986Sobrien#endif 3976612Stshiozak#endif /* LIBC_SCCS and not lint */ 4086170Sobrien__FBSDID("$FreeBSD$"); 4176612Stshiozak 4276612Stshiozak#include <wchar.h> 4376612Stshiozak 4476612Stshiozak/* 4576612Stshiozak * Compare strings. 4676612Stshiozak */ 4776612Stshiozakint 48188080Sdangerwcscmp(const wchar_t *s1, const wchar_t *s2) 4976612Stshiozak{ 5076612Stshiozak 5176612Stshiozak while (*s1 == *s2++) 52188080Sdanger if (*s1++ == '\0') 5376612Stshiozak return (0); 5476612Stshiozak /* XXX assumes wchar_t = int */ 5576612Stshiozak return (*(const unsigned int *)s1 - *(const unsigned int *)--s2); 5676612Stshiozak} 57