diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-04-21 11:38:46 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-04-21 11:38:46 +0000 |
commit | b4012b7542183a57cd92514e2359b8110609e52a (patch) | |
tree | 4fa35d6484e1f919c3649922545d740b9da14c08 /manual/string.texi | |
parent | 406f977a5a0e61732fd13cdeec62c3f14bacc317 (diff) | |
download | glibc-b4012b7542183a57cd92514e2359b8110609e52a.tar.gz glibc-b4012b7542183a57cd92514e2359b8110609e52a.tar.xz glibc-b4012b7542183a57cd92514e2359b8110609e52a.zip |
Update.
1997-04-21 13:25 Ulrich Drepper <drepper@cygnus.com> * manual/arith.texi: Add description for INFINITY, _Imaginary_I, fpclassify & friends, and complex number operations. Update various other math functions for ISO C 9X. * manual/math.texi: Update various entries for ISO C 9X. Add description for complex number functions. Add description of rand48 function family. * manual/string.h: Add description of a64l and l64a. * math/cmathcalls.h: Fix typo. * stdlib/a64l.c: Pretty printing. * stdlib/seed48_r.c: Also reset `a' and `c' to default values. * stdlib/srand48_r.c: Likewise. * stdlib/stdlib.h: Pretty printing. * sysdeps/i386/fpu/__math.h: Fix typo. * sysdeps/libm-ieee754/s_nearbyintf.c: Correctly name function. * sysdeps/libm-ieee754/s_nearbyintl.c: Likewise. 1997-04-19 22:16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/fpu/e_pow.c: Rewrite handling of integral exponent. 1997-04-18 19:34 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/fpu/__math.h: Define optimized versions of isgreater, isgreaterequal, isless, islessequal, islessgreater, and isunordered. 1997-04-20 01:28 Richard Henderson <rth@tamu.edu> * rellns-sh: Handle files in the same directory correctly. 1997-04-20 11:22 Ulrich Drepper <drepper@cygnus.com> * csu/initfini.c: Place ALIGN instruction at correct positions. Patch by Richard Henderson <richard@twiddle.rth.home>. 1997-04-19 17:12 Ulrich Drepper <drepper@cygnus.com> * Make-dist: Don't automatically ignore .c files if the .S or .s file is ignored. * csu/Makefile (distribute): Add defs.awk. 1997-04-19 15:39 Ulrich Drepper <drepper@cygnus.com> * sysdeps/stub/shmat.c: Update to XPG4.2 interface. * sysdeps/stub/shmdt.c: Likewise. Reported by Thomas Bushnell, n/BSG. 1997-04-19 13:22 Ulrich Drepper <drepper@cygnus.com> * manual/stdio.texi: Add description of printf_size and printf_size_info. Partly based on the documentation by Larry McVoy. 1997-04-19 02:21 Ulrich Drepper <drepper@cygnus.com> * stdio-common/printf_size.c (printf_size): Correct values for `units'. Report by Larry McVoy <lm@neteng.engr.sgi.com>. * stdio-common/tst-printfsz.c: New file. * stdio-common/Makefile (tests): Add tst-printfsz.c. (CFLAGS-tst-printfsz.c): Define to prevent warnings about format strings. 1997-04-18 15:48 Ulrich Drepper <drepper@cygnus.com> * login/utmp.h: Add prototype for updwtmp. * login/logwtmp.c: Add new function updwtmp which allows to write a complete record to the wtmp file. Patch by Miquel van Smoorenburg <miquels@cistron.nl>. 1997-04-17 17:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * math/Makefile (headers): Add mathbits.h. 1997-04-16 21:20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/fpu/__math.h: Add inlined sincos{,l,f}. * sysdeps/m68k/fpu/s_sincos.c: New file. * sysdeps/m68k/fpu/s_sincosf.c: New file. * sysdeps/m68k/fpu/s_sincosl.c: New file. * sysdeps/libm-ieee754/e_scalb.c: Use internal names of the functions. * sysdeps/libm-ieee754/e_scalbl.c: Likewise. * sysdeps/libm-ieee754/s_ctanh.c: Use isfinite instead of finite. * sysdeps/libm-ieee754/s_ctanhf.c: Likewise. * sysdeps/libm-ieee754/s_ctanhl.c: Likewise. * sysdeps/libm-ieee754/s_ctan.c: Likewise. * sysdeps/libm-ieee754/s_ctanf.c: Likewise. * sysdeps/libm-ieee754/s_ctanl.c: Likewise. Fix type of `res'. 1997-04-18 11:21 Ulrich Drepper <drepper@cygnus.com> * shadow/fgetspent_r.c: Set *RESULT to NULL before returning error. Patch by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>.
Diffstat (limited to 'manual/string.texi')
-rw-r--r-- | manual/string.texi | 81 |
1 files changed, 72 insertions, 9 deletions
diff --git a/manual/string.texi b/manual/string.texi index 9d242b7c19..8f09ac9728 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -32,9 +32,10 @@ too. * Search Functions:: Searching for a specific element or substring. * Finding Tokens in a String:: Splitting a string into tokens by looking for delimiters. +* Encode Binary Data:: Encoding and Decoding of Binary Data. @end menu -@node Representation of Strings, String/Array Conventions, , String and Array Utilities +@node Representation of Strings @section Representation of Strings @cindex string, representation of @@ -99,7 +100,7 @@ checks for overflowing the array. Many of the library functions an extra byte to hold the null character that marks the end of the string. -@node String/Array Conventions, String Length, Representation of Strings, String and Array Utilities +@node String/Array Conventions @section String and Array Conventions This chapter describes both functions that work on arbitrary arrays or @@ -132,7 +133,7 @@ other hand, when you are manipulating null-terminated strings it is usually more convenient to use the @samp{str} functions, unless you already know the length of the string in advance. -@node String Length, Copying and Concatenation, String/Array Conventions, String and Array Utilities +@node String Length @section String Length You can get the length of a string using the @code{strlen} function. @@ -166,7 +167,7 @@ strlen (string) @end smallexample @end deftypefun -@node Copying and Concatenation, String/Array Comparison, String Length, String and Array Utilities +@node Copying and Concatenation @section Copying and Concatenation You can use the functions described in this section to copy the contents @@ -470,7 +471,7 @@ BSD. Note that it is not as general as @code{memset}, because the only value it can store is zero. @end deftypefun -@node String/Array Comparison, Collation Functions, Copying and Concatenation, String and Array Utilities +@node String/Array Comparison @section String/Array Comparison @cindex comparing strings and arrays @cindex string comparison functions @@ -613,7 +614,7 @@ strncmp ("hello, world", "hello, stupid world!!!", 5) This is an obsolete alias for @code{memcmp}, derived from BSD. @end deftypefun -@node Collation Functions, Search Functions, String/Array Comparison, String and Array Utilities +@node Collation Functions @section Collation Functions @cindex collating strings @@ -792,9 +793,9 @@ sort_strings_fast (char **array, int nstrings) @end smallexample @strong{Compatibility Note:} The string collation functions are a new -feature of @w{ISO C}. Older C dialects have no equivalent feature. +feature of @w{ISO C 89}. Older C dialects have no equivalent feature. -@node Search Functions, Finding Tokens in a String, Collation Functions, String and Array Utilities +@node Search Functions @section Search Functions This section describes library functions which perform various kinds @@ -940,7 +941,7 @@ strpbrk ("hello, world", " \t\n,.;!?") @c @end group @end deftypefun -@node Finding Tokens in a String, , Search Functions, String and Array Utilities +@node Finding Tokens in a String @section Finding Tokens in a String @cindex tokenizing strings @@ -1087,3 +1088,65 @@ token = strsep (&running, delimiters); /* token => "and" */ token = strsep (&running, delimiters); /* token => "punctuation" */ token = strsep (&running, delimiters); /* token => NULL */ @end smallexample + +@node Encode Binary Data +@section Encode Binary Data + +To store or transfer binary data in environments which only support text +one has to encode the binary data by mapping the input bytes to +characters in the range allowed for storing or transfering. SVID +systems (and nowadays XPG compliant systems) have such a function in the +C library. + +@comment stdlib.h +@comment XPG +@deftypefun {char *} l64a (long int @var{n}) +This function encodes an input value with 32 bits using characters from +the basic character set. Groups of 6 bits are encoded using the +following table: + +@multitable {xxxxx} {xxx} {xxx} {xxx} {xxx} {xxx} {xxx} {xxx} {xxx} +@item @tab 0 @tab 1 @tab 2 @tab 3 @tab 4 @tab 5 @tab 6 @tab 7 +@item 0 @tab @code{.} @tab @code{/} @tab @code{0} @tab @code{1} + @tab @code{2} @tab @code{3} @tab @code{4} @tab @code{5} +@item 8 @tab @code{6} @tab @code{7} @tab @code{8} @tab @code{9} + @tab @code{A} @tab @code{B} @tab @code{C} @tab @code{D} +@item 16 @tab @code{E} @tab @code{F} @tab @code{G} @tab @code{H} + @tab @code{I} @tab @code{J} @tab @code{K} @tab @code{L} +@item 24 @tab @code{M} @tab @code{N} @tab @code{O} @tab @code{P} + @tab @code{Q} @tab @code{R} @tab @code{S} @tab @code{T} +@item 32 @tab @code{U} @tab @code{V} @tab @code{W} @tab @code{X} + @tab @code{Y} @tab @code{Z} @tab @code{a} @tab @code{b} +@item 40 @tab @code{c} @tab @code{d} @tab @code{e} @tab @code{f} + @tab @code{g} @tab @code{h} @tab @code{i} @tab @code{j} +@item 48 @tab @code{k} @tab @code{l} @tab @code{m} @tab @code{n} + @tab @code{o} @tab @code{p} @tab @code{q} @tab @code{r} +@item 56 @tab @code{s} @tab @code{t} @tab @code{u} @tab @code{v} + @tab @code{w} @tab @code{x} @tab @code{y} @tab @code{z} +@end multitable + +The function returns a pointer to a static buffer which contains the +string representing of the encoding of @var{n}. To encoded a series of +bytes the use should append the new string to the destination buffer. +@emph{Warning:} Since a static buffer is used this function should not +be used in multi-threaded programs. There is no thread-safe alternatice +to this function in the C library. +@end deftypefun + +To decode data produced with @code{l64a} the following function should be +used. + +@deftypefun {long int} a64l (const char *@var{string}) +The parameter @var{string} should contain a string which was produced by +a call to @code{l64a}. The function processes the next 6 characters and +decodes the characters it finds according to the table above. +Characters not in the conversion table are simply ignored. This is +useful for breaking the information in lines in which case the end of +line characters are simply ignored. + +The decoded number is returned at the end as a @code{long int} value. +Consecutive calls to this function are possible but the caller must make +sure the buffer pointer is update after each call to @code{a64l} since +this function does not modify the buffer pointer. Every call consumes 6 +characters. +@end deftypefun |