00001 /* Copyright (C) 2000 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 /* File : strcmp.c 00018 Author : Richard A. O'Keefe. 00019 Updated: 10 April 1984 00020 Defines: strcmp() 00021 00022 strcmp(s, t) returns > 0, = 0, or < 0 when s > t, s = t, or s < t 00023 according to the ordinary lexicographical order. To test for 00024 equality, the macro streql(s,t) is clearer than !strcmp(s,t). Note 00025 that if the string contains characters outside the range 0..127 the 00026 result is machine-dependent; PDP-11s and VAXen use signed bytes, 00027 some other machines use unsigned bytes. 00028 */ 00029 00030 #include "strings.h" 00031 00032 int strcmp(register const char *s, register const char *t) 00033 { 00034 while (*s == *t++) if (!*s++) return 0; 00035 return s[0]-t[-1]; 00036 }
1.4.7

