2 * String utility definitions
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef __STR_UTIL_H__
26 #define __STR_UTIL_H__
28 /** Convert all upper-case ASCII letters to their ASCII lower-case
29 * equivalents, in place, with a simple non-locale-dependent
30 * ASCII mapping (A-Z -> a-z).
31 * All other characters are left unchanged, as the mapping to
32 * lower case may be locale-dependent.
34 * The string is assumed to be in a character encoding, such as
35 * an ISO 8859 or other EUC encoding, or UTF-8, in which all
36 * bytes in the range 0x00 through 0x7F are ASCII characters and
37 * non-ASCII characters are constructed from one or more bytes in
38 * the range 0x80 through 0xFF.
40 * @param str The string to be lower-cased.
41 * @return ptr to the string
43 gchar *ascii_strdown_inplace(gchar *str);
45 /** Convert all lower-case ASCII letters to their ASCII upper-case
46 * equivalents, in place, with a simple non-locale-dependent
47 * ASCII mapping (a-z -> A-Z).
48 * All other characters are left unchanged, as the mapping to
49 * lower case may be locale-dependent.
51 * The string is assumed to be in a character encoding, such as
52 * an ISO 8859 or other EUC encoding, or UTF-8, in which all
53 * bytes in the range 0x00 through 0x7F are ASCII characters and
54 * non-ASCII characters are constructed from one or more bytes in
55 * the range 0x80 through 0xFF.
57 * @param str The string to be upper-cased.
58 * @return ptr to the string
60 gchar *ascii_strup_inplace(gchar *str);
62 /** Check if an entire string consists of printable characters
64 * @param str The string to be checked
65 * @return TRUE if the entire string is printable, otherwise FALSE
67 gboolean isprint_string(guchar *string);
69 /** Check if an entire string consists of digits
71 * @param str The string to be checked
72 * @return TRUE if the entire string is digits, otherwise FALSE
74 gboolean isdigit_string(guchar *string);
76 #endif /* __STR_UTIL_H__ */