| 1 | /****************************************************************************** |
| 2 | * * |
| 3 | * Copyright (C) 2006-2009 by Tor Andersson. * |
| 4 | * * |
| 5 | * This file is part of Gargoyle. * |
| 6 | * * |
| 7 | * Gargoyle is free software; you can redistribute it and/or modify * |
| 8 | * it under the terms of the GNU General Public License as published by * |
| 9 | * the Free Software Foundation; either version 2 of the License, or * |
| 10 | * (at your option) any later version. * |
| 11 | * * |
| 12 | * Gargoyle is distributed in the hope that it will be useful, * |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 15 | * GNU General Public License for more details. * |
| 16 | * * |
| 17 | * You should have received a copy of the GNU General Public License * |
| 18 | * along with Gargoyle; if not, write to the Free Software * |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * |
| 20 | * * |
| 21 | *****************************************************************************/ |
| 22 | |
| 23 | #include <ctype.h> |
| 24 | |
| 25 | /* |
| 26 | * Provide memicmp, since it's not a standard libc routine. |
| 27 | */ |
| 28 | int os_memicmp(const char *s1, const char *s2, int len) |
| 29 | { |
| 30 | int i; |
| 31 | |
| 32 | for (i = 0; i < len; i++) |
| 33 | { |
| 34 | if (tolower(s1[i]) != tolower(s2[i])) |
| 35 | return (int)tolower(s1[i]) - (int)tolower(s2[i]); |
| 36 | } |
| 37 | return 0; |
| 38 | } |
| 39 |