Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update.
1999-06-16  Ulrich Drepper  <drepper@cygnus.com>

	* manual/errno.texi: Fix typos.
	* manual/memory.texi: Likewise.
	* manual/ctype.texi: Likewise.
	Patches by Brian Youmans <3diff@gnu.org>.
  • Loading branch information
Ulrich Drepper committed Jun 16, 1999
1 parent 2972264 commit bc938d3
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 80 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
1999-06-16 Ulrich Drepper <drepper@cygnus.com>

* manual/errno.texi: Fix typos.
* manual/memory.texi: Likewise.
* manual/ctype.texi: Likewise.
Patches by Brian Youmans <3diff@gnu.org>.

1999-06-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>

* sysdeps/unix/sysv/linux/netax25/ax25.h (AX25_PIDINCL): Added.
Expand Down
50 changes: 25 additions & 25 deletions manual/ctype.texi
Expand Up @@ -17,7 +17,7 @@ by the locale currently selected for character classification---the

The @w{ISO C} standard specifies two different sets of functions. The
one set works on @code{char} type characters, the other one on
@code{wchar_t} wide character (@pxref{Extended Char Intro}).
@code{wchar_t} wide characters (@pxref{Extended Char Intro}).

@menu
* Classification of Characters:: Testing whether characters are
Expand Down Expand Up @@ -266,20 +266,21 @@ with the SVID.
@section Character class determination for wide characters

The second amendment to @w{ISO C89} defines functions to classify wide
character. Although the original @w{ISO C89} standard already defined
the type @code{wchar_t} but no functions operating on them were defined.
characters. The original @w{ISO C89} standard defined the type
@code{wchar_t} but failed to define any functions to operate on wide
characters.

The general design of the classification functions for wide characters
is more general. It allows to extend the set of available
classification beyond the set which is always available. The POSIX
standard specifies a way how the extension can be done and this is
already implemented in the GNU C library implementation of the
@code{localedef} program.
is more general. It allows extending the set of available
classifications beyond the set which is always available. The POSIX
standard specifies how the extension can be done and this is already
implemented in the GNU C library implementation of the @code{localedef}
program.

The character class functions are normally implemented using bitsets.
I.e., for the character in question the appropriate bitset is read from
a table and a test is performed whether a certain bit is set in this
bitset. Which bit is tested for is determined by the class.
a table and a test is performed to determine whether a certain bit is
set in this bitset. Which bit is tested for is determined by the class.

For the wide character classification functions this is made visible.
There is a type representing the classification, a function to retrieve
Expand Down Expand Up @@ -338,11 +339,11 @@ by a successful call to @code{wctype}.
This function is declared in @file{wctype.h}.
@end deftypefun

The make it easier to use the commonly used classification functions
they are defined in the C library. There is no need to use
@code{wctype} is the property string is one of the known character
This makes it easier to use the commonly-used classification functions
that are defined in the C library. There is no need to use
@code{wctype} if the property string is one of the known character
classes. In some situations it is desirable to construct the property
string and then it gets important that @code{wctype} can also handle the
string and then it becomes important that @code{wctype} can also handle the
standard classes.

@cindex alphanumeric character
Expand Down Expand Up @@ -588,7 +589,7 @@ iswctype (wc, wctype ("xdigit"))
It is declared in @file{wctype.h}.
@end deftypefun

The GNu C library provides also a function which is not defined in the
The GNU C library also provides a function which is not defined in the
@w{ISO C} standard but which is available as a version for single byte
characters as well.

Expand All @@ -610,10 +611,9 @@ available as real functions but when the @file{wctype.h} header is
included the macros will be used. This is nothing new compared to the
@code{char} type versions of these functions.

The second notes covers something which is new. It can be best
illustrated by a (real-world) example. The first piece of code is an
excerpt from the original code. It is truncated a bit but the intention
should be clear.
The second note covers something new. It can be best illustrated by a
(real-world) example. The first piece of code is an excerpt from the
original code. It is truncated a bit but the intention should be clear.

@smallexample
int
Expand Down Expand Up @@ -642,7 +642,7 @@ is_in_class (int c, const char *class)
@}
@end smallexample

The problem is that it is not guarateed that the wide character
The problem is that it is not guaranteed that the wide character
representation of a single-byte character can be found using casting.
In fact, usually this fails miserably. The correct solution for this
problem is to write the code as follows:
Expand All @@ -669,9 +669,9 @@ function is probably not the final one.
@node Wide Character Case Conversion, , Using Wide Char Classes, Character Handling
@section Mapping of wide characters.

As for the classification functions the @w{ISO C} standard also
As for the classification functions, the @w{ISO C} standard also
generalizes the mapping functions. Instead of only allowing the two
standard mappings the locale can contain others. Again, the
standard mappings, the locale can contain others. Again, the
@code{localedef} program already supports generating such locale data
files.

Expand All @@ -680,7 +680,7 @@ files.
@deftp {Data Type} wctrans_t
This data type is defined as a scalar type which can hold a value
representing the locale-dependent character mapping. There is no way to
construct such a value beside using the return value of the
construct such a value except using the return value of the
@code{wctrans} function.

@pindex wctype.h
Expand Down Expand Up @@ -715,7 +715,7 @@ This function is declared in @file{wctype.h}.
@deftypefun wint_t towctrans (wint_t @var{wc}, wctrans_t @var{desc})
The @code{towctrans} function maps the input character @var{wc}
according to the rules of the mapping for which @var{desc} is an
descriptor and returns the so found value. The @var{desc} value must be
descriptor and returns the value so found. The @var{desc} value must be
obtained by a successful call to @code{wctrans}.

@pindex wctype.h
Expand Down Expand Up @@ -765,6 +765,6 @@ This function is declared in @file{wctype.h}.
@end deftypefun

The same warnings given in the last section for the use of the wide
character classiffication function applies here. It is not possible to
character classification function applies here. It is not possible to
simply cast a @code{char} type value to a @code{wint_t} and use it as an
argument for @code{towctrans} calls.
4 changes: 2 additions & 2 deletions manual/errno.texi
Expand Up @@ -55,7 +55,7 @@ listed for each function. These functions do not change @code{errno}
when they succeed; thus, the value of @code{errno} after a successful
call is not necessarily zero, and you should not use @code{errno} to
determine @emph{whether} a call failed. The proper way to do that is
documented for each function. @emph{If} the call the failed, you can
documented for each function. @emph{If} the call failed, you can
examine @code{errno}.

Many library functions can set @code{errno} to a nonzero value as a
Expand Down Expand Up @@ -1303,7 +1303,7 @@ exit if any system call fails. By convention, the error message from
such a program should start with the program's name, sans directories.
You can find that name in the variable
@code{program_invocation_short_name}; the full file name is stored the
variable @code{program_invocation_name}:
variable @code{program_invocation_name}.

@comment errno.h
@comment GNU
Expand Down

0 comments on commit bc938d3

Please sign in to comment.