| 1 | /* |
|---|
| 2 | * Copyright (C) 2001 Thomas Roessler <roessler@does-not-exist.org> |
|---|
| 3 | * |
|---|
| 4 | * This program is free software; you can redistribute it |
|---|
| 5 | * and/or modify it under the terms of the GNU General Public |
|---|
| 6 | * License as published by the Free Software Foundation; either |
|---|
| 7 | * version 2 of the License, or (at your option) any later |
|---|
| 8 | * version. |
|---|
| 9 | * |
|---|
| 10 | * This program is distributed in the hope that it will be |
|---|
| 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied |
|---|
| 12 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|---|
| 13 | * PURPOSE. See the GNU General Public License for more |
|---|
| 14 | * details. |
|---|
| 15 | * |
|---|
| 16 | * You should have received a copy of the GNU General Public |
|---|
| 17 | * License along with this program; if not, write to the Free |
|---|
| 18 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|---|
| 19 | * Boston, MA 02110-1301, USA. |
|---|
| 20 | * |
|---|
| 21 | */ |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | /* |
|---|
| 25 | * Versions of the string comparison functions which are |
|---|
| 26 | * locale-insensitive. |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| 29 | #ifndef _ASCII_H |
|---|
| 30 | # define _ASCII_H |
|---|
| 31 | |
|---|
| 32 | int ascii_isupper (int c); |
|---|
| 33 | int ascii_islower (int c); |
|---|
| 34 | int ascii_toupper (int c); |
|---|
| 35 | int ascii_tolower (int c); |
|---|
| 36 | int ascii_strcasecmp (const char *a, const char *b); |
|---|
| 37 | int ascii_strncasecmp (const char *a, const char *b, int n); |
|---|
| 38 | |
|---|
| 39 | #define ascii_strcmp(a,b) mutt_strcmp(a,b) |
|---|
| 40 | #define ascii_strncmp(a,b,c) mutt_strncmp(a,b,c) |
|---|
| 41 | |
|---|
| 42 | static inline char* ascii_strlower (char *s) |
|---|
| 43 | { |
|---|
| 44 | char *p = s; |
|---|
| 45 | |
|---|
| 46 | while (*p) |
|---|
| 47 | { |
|---|
| 48 | *p = ascii_tolower ((unsigned int) *p); |
|---|
| 49 | p++; |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | return s; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | #endif |
|---|