Implement and document g_ascii_isxxx.

2001-08-25  Alexander Larsson  <alla@lysator.liu.se>

	* glib/gstrfuncs.[ch]:
	* docs/reference/glib/glib-overrides.txt:
	* docs/reference/glib/glib-sections.txt:
	* docs/reference/glib/tmpl/string_utils.sgml:
	Implement and document g_ascii_isxxx.

	* tests/strfunc-test.c:
	Add tests for g_ascii_isxxx

	* glib/guniprop.c (g_unichar_ispunct):
	include symbols, not just punctuation.
	(g_unichar_isspace): Vertical tab is not
	considered whitespace.

	* tests/shell-test.c:
	Output errors on stderr
This commit is contained in:
Alexander Larsson
2001-08-25 22:29:40 +00:00
committed by Alexander Larsson
parent 3ff815fd7c
commit a7a76cfac7
8 changed files with 694 additions and 111 deletions

View File

@@ -219,3 +219,71 @@ GPrivate *private_key, gpointer data
<NAME>G_OS_BEOS</NAME>
#define G_OS_BEOS
</MACRO>
# g_ascii_isxxx
<FUNCTION>
<NAME>g_ascii_isalnum</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isalpha</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_iscntrl</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isdigit</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isgraph</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_islower</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isprint</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_ispunct</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isspace</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isupper</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>
<FUNCTION>
<NAME>g_ascii_isxdigit</NAME>
<RETURNS>gboolean</RETURNS>
gchar c
</FUNCTION>

View File

@@ -851,6 +851,39 @@ g_snprintf
g_vsnprintf
g_printf_string_upper_bound
<SUBSECTION>
g_ascii_isalnum
g_ascii_isalpha
g_ascii_iscntrl
g_ascii_isdigit
g_ascii_isgraph
g_ascii_islower
g_ascii_isprint
g_ascii_ispunct
g_ascii_isspace
g_ascii_isupper
g_ascii_isxdigit
<SUBSECTION>
g_ascii_digit_value
g_ascii_xdigit_value
<SUBSECTION>
g_ascii_strcasecmp
g_ascii_strncasecmp
<SUBSECTION>
g_ascii_strup
g_ascii_strdown
<SUBSECTION>
g_ascii_tolower
g_ascii_toupper
<SUBSECTION>
g_string_ascii_up
g_string_ascii_down
<SUBSECTION>
g_strup
g_strdown

View File

@@ -193,6 +193,286 @@ documentation.
@Returns: the maximum space needed to store the formatted string.
<!-- ##### FUNCTION g_ascii_isalnum ##### -->
<para>
Determines whether a character is alphanumeric.
</para>
<para>
Unlike the standard C library isalnum function, this only
recognizes standard ASCII letters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII alphanumeric character
<!-- ##### FUNCTION g_ascii_isalpha ##### -->
<para>
Determines whether a character is alphabetic (i.e. a letter).
</para>
<para>
Unlike the standard C library isalpha function, this only
recognizes standard ASCII letters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII alphabetic character
<!-- ##### FUNCTION g_ascii_iscntrl ##### -->
<para>
Determines whether a character is a control character.
</para>
<para>
Unlike the standard C library iscntrl function, this only
recognizes standard ASCII control characters and ignores the locale,
returning%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII control character.
<!-- ##### FUNCTION g_ascii_isdigit ##### -->
<para>
Determines whether a character is digit (0-9).
</para>
<para>
Unlike the standard C library isdigit function, this only
recognizes standard ASCII digits and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII digit.
<!-- ##### FUNCTION g_ascii_isgraph ##### -->
<para>
Determines whether a character is a printing character and not a space.
</para>
<para>
Unlike the standard C library isgraph function, this only
recognizes standard ASCII characters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII printing character other than space.
<!-- ##### FUNCTION g_ascii_islower ##### -->
<para>
Determines whether a character is an ASCII lower case letter.
</para>
<para>
Unlike the standard C library islower function, this only
recognizes standard ASCII letters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to worry about casting to guchar before passing
a possibly non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII lower case letter
<!-- ##### FUNCTION g_ascii_isprint ##### -->
<para>
Determines whether a character is a printing character.
</para>
<para>
Unlike the standard C library isprint function, this only
recognizes standard ASCII characters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII printing character.
<!-- ##### FUNCTION g_ascii_ispunct ##### -->
<para>
Determines whether a character is a punctuation character.
</para>
<para>
Unlike the standard C library ispunct function, this only
recognizes standard ASCII letters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII punctuation character.
<!-- ##### FUNCTION g_ascii_isspace ##### -->
<para>
Determines whether a character is a white-space character.
</para>
<para>
Unlike the standard C library isspace function, this only
recognizes standard ASCII white-space and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to cast to guchar before passing a possibly
non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII white-space character
<!-- ##### FUNCTION g_ascii_isupper ##### -->
<para>
Determines whether a character is an ASCII upper case letter.
</para>
<para>
Unlike the standard C library isupper function, this only
recognizes standard ASCII letters and ignores the locale, returning
%FALSE for all non-ASCII characters. Also unlike the standard
library function, this takes a char, not an int, so don't call it
on EOF but no need to worry about casting to guchar before passing
a possibly non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII upper case letter
<!-- ##### FUNCTION g_ascii_isxdigit ##### -->
<para>
Determines whether a character is a hexadecimal-digit character.
</para>
<para>
Unlike the standard C library isxdigit function, this only
recognizes standard ASCII hexadecimal digits and ignores the
locale, returning %FALSE for all non-ASCII characters. Also unlike
the standard library function, this takes a char, not an int, so
don't call it on EOF but no need to cast to guchar before passing a
possibly non-ASCII character in.
</para>
@c: any characted
@Returns: %TRUE if @c is an ASCII hexadecimal-digit character.
<!-- ##### FUNCTION g_ascii_digit_value ##### -->
<para>
</para>
@c:
@Returns:
<!-- ##### FUNCTION g_ascii_xdigit_value ##### -->
<para>
</para>
@c:
@Returns:
<!-- ##### FUNCTION g_ascii_strcasecmp ##### -->
<para>
</para>
@s1:
@s2:
@Returns:
<!-- ##### FUNCTION g_ascii_strncasecmp ##### -->
<para>
</para>
@s1:
@s2:
@n:
@Returns:
<!-- ##### FUNCTION g_ascii_strup ##### -->
<para>
</para>
@string:
@Returns:
<!-- ##### FUNCTION g_ascii_strdown ##### -->
<para>
</para>
@string:
@Returns:
<!-- ##### FUNCTION g_ascii_tolower ##### -->
<para>
</para>
@c:
@Returns:
<!-- ##### FUNCTION g_ascii_toupper ##### -->
<para>
</para>
@c:
@Returns:
<!-- ##### FUNCTION g_string_ascii_up ##### -->
<para>
</para>
@string:
@Returns:
<!-- ##### FUNCTION g_string_ascii_down ##### -->
<para>
</para>
@string:
@Returns:
<!-- ##### FUNCTION g_strup ##### -->
<para>
Converts a string to upper case.