/*
* Copyright (c) 2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
SM_RCSID("@(#)$Id: strrevcmp.c,v 1.2 2001/08/27 22:21:51 gshapiro Exp $")
#include <string.h>
/* strcasecmp.c */
extern const unsigned char charmap[];
/*
** SM_STRREVCASECMP -- compare two strings starting at the end (ignore case)
**
** Parameters:
** s1 -- first string.
** s2 -- second string.
**
** Returns:
** strcasecmp(reverse(s1), reverse(s2))
*/
int
{
{
--i1;
--i2;
}
if (i1 < 0)
{
if (i2 < 0)
return 0;
else
return -1;
}
else
{
if (i2 < 0)
return 1;
else
}
}
/*
** SM_STRREVCMP -- compare two strings starting at the end
**
** Parameters:
** s1 -- first string.
** s2 -- second string.
**
** Returns:
** strcmp(reverse(s1), reverse(s2))
*/
int
{
{
--i1;
--i2;
}
if (i1 < 0)
{
if (i2 < 0)
return 0;
else
return -1;
}
else
{
if (i2 < 0)
return 1;
else
}
}