1 /* @(#)streql.c 1.10 09/06/07 Copyright 1985, 1995-2009 J. Schilling */ 2 /* 3 * Check if two strings are equal 4 * 5 * Copyright (c) 1985, 1995-2009 J. Schilling 6 */ 7 /* 8 * The contents of this file are subject to the terms of the 9 * Common Development and Distribution License, Version 1.0 only 10 * (the "License"). You may not use this file except in compliance 11 * with the License. 12 * 13 * See the file CDDL.Schily.txt in this distribution for details. 14 * 15 * When distributing Covered Code, include this CDDL HEADER in each 16 * file and include the License file CDDL.Schily.txt from this distribution. 17 */ 18 19 #include <schily/standard.h> 20 #include <schily/schily.h> 21 22 EXPORT int 23 streql(a, b) 24 const char *a; 25 const char *b; 26 { 27 register const char *s1 = a; 28 register const char *s2 = b; 29 30 if (s1 == NULL || s2 == NULL) 31 return (FALSE); 32 33 if (s1 == s2) 34 return (TRUE); 35 36 while (*s1 == *s2++) 37 if (*s1++ == '\0') 38 return (TRUE); 39 40 return (FALSE); 41 } 42