1998-03-15 08:39:04 +01:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1990, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Chris Torek.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
1998-09-01 06:40:42 +02:00
|
|
|
* notice, this list of conditions and the following disclaimer.
|
1998-03-15 08:39:04 +01:00
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
1998-09-01 06:40:42 +02:00
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2007-03-26 23:44:11 +02:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1998-09-01 06:40:42 +02:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
1998-03-15 08:39:04 +01:00
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
1998-09-01 06:40:42 +02:00
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
1998-03-15 08:39:04 +01:00
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
2001-02-10 03:31:31 +01:00
|
|
|
/* can be used in either frontend or backend */
|
|
|
|
#include "postgres_fe.h"
|
1998-03-15 08:39:04 +01:00
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "mb/pg_wchar.h"
|
1998-03-15 08:39:04 +01:00
|
|
|
|
|
|
|
int
|
2004-10-13 03:25:13 +02:00
|
|
|
pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2001-10-25 07:50:21 +02:00
|
|
|
while ((pg_wchar) *s1 == *s2++)
|
1998-03-15 08:39:04 +01:00
|
|
|
if (*s1++ == 0)
|
1998-09-01 05:29:17 +02:00
|
|
|
return 0;
|
1998-09-01 06:40:42 +02:00
|
|
|
return *(const unsigned char *) s1 - *(const pg_wchar *) (s2 - 1);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|