/* $Id: streq.c,v 1.2 2009/01/04 15:42:16 kiesling Exp $ -*-c-*-*/

/*
  This file is part of Ctalk.
  Copyright © 2005-2009  Robert Kiesling, ctalk@ctalklang.org.
  Permission is granted to copy this software provided that this copyright
  notice is included in all source code modules.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301 USA.
*/

/*
 *  This is a modified version of str_eq (), from The C Book.
 */

#ifdef __GNUC__
inline int __str_eq (register char *s1, register char *s2) {
#else
int __str_eq (const char *s1, const char *s2) {
#endif

  while (*s1 == *s2) {

    if (!*s1) {
      if (!*s2) {
	return 0;
      } else {
	return 1;
      }
    }

    s1++; s2++;
  }
  return 1;
}
