diff options
| author | Ulrich Drepper <drepper@redhat.com> | 1999-11-25 07:59:22 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 1999-11-25 07:59:22 +0000 |
| commit | 76c23bacd8d180c7955668fc0d181522f7b80d37 (patch) | |
| tree | 26f35893b857c0f19f537afaa9a3369a133b8d0f | |
| parent | 8d2d51e373dd7c6c4a9b417a5bb7bdda3fe09b5f (diff) | |
| download | glibc-76c23bacd8d180c7955668fc0d181522f7b80d37.tar.xz glibc-76c23bacd8d180c7955668fc0d181522f7b80d37.zip | |
Update.
* manual/setjmp.texi: Many changes to correct bad English introduced
mainly by me.
* manual/time.texi: Likewise.
Patches by Neil Booth <neil@rosenet.ne.jp>.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | manual/setjmp.texi | 6 | ||||
| -rw-r--r-- | manual/time.texi | 431 |
3 files changed, 221 insertions, 221 deletions
@@ -1,5 +1,10 @@ 1999-11-24 Ulrich Drepper <drepper@cygnus.com> + * manual/setjmp.texi: Many changes to correct bad English introduced + mainly by me. + * manual/time.texi: Likewise. + Patches by Neil Booth <neil@rosenet.ne.jp>. + * include/string.h: Remove K&R compatibility. 1999-11-23 Ulrich Drepper <drepper@cygnus.com> diff --git a/manual/setjmp.texi b/manual/setjmp.texi index f6799912eb..6f3adeea93 100644 --- a/manual/setjmp.texi +++ b/manual/setjmp.texi @@ -12,7 +12,7 @@ functions. @menu * Intro: Non-Local Intro. When and how to use these facilities. -* Details: Non-Local Details. Functions for nonlocal exits. +* Details: Non-Local Details. Functions for non-local exits. * Non-Local Exits and Signals:: Portability issues. @end menu @@ -44,11 +44,11 @@ only a single function call, transferring control back to the point at which it was called, a non-local exit can potentially abandon many levels of nested function calls. -You identify return points for non-local exits calling the function +You identify return points for non-local exits by calling the function @code{setjmp}. This function saves information about the execution environment in which the call to @code{setjmp} appears in an object of type @code{jmp_buf}. Execution of the program continues normally after -the call to @code{setjmp}, but if a exit is later made to this return +the call to @code{setjmp}, but if an exit is later made to this return point by calling @code{longjmp} with the corresponding @w{@code{jmp_buf}} object, control is transferred back to the point where @code{setjmp} was called. The return value from @code{setjmp} is used to distinguish diff --git a/manual/time.texi b/manual/time.texi index 6298c6b2ce..1075f29b3f 100644 --- a/manual/time.texi +++ b/manual/time.texi @@ -331,7 +331,7 @@ about the local time zone. It has the following members: This is the number of minutes west of UTC. @item int tz_dsttime -If nonzero, daylight saving time applies during some part of the year. +If nonzero, Daylight Saving Time applies during some part of the year. @end table The @code{struct timezone} type is obsolete and should never be used. @@ -455,9 +455,9 @@ and @code{adjtime} functions are derived from BSD. @cindex calendar time and broken-down time Calendar time is represented as a number of seconds. This is convenient -for calculation, but has no resemblance to the way people normally +for calculation, but has no relation to the way people normally represent dates and times. By contrast, @dfn{broken-down time} is a binary -representation separated into year, month, day, and so on. Broken down +representation separated into year, month, day, and so on. Broken-down time values are not useful for calculations, but they are useful for printing human readable time. @@ -552,7 +552,7 @@ Zone Functions}. Using the @code{localtime} function is a big problem in multi-threaded programs. The result is returned in a static buffer and this is used in -all threads. POSIX.1c introduced a varient of this function. +all threads. POSIX.1c introduced a variant of this function. @comment time.h @comment POSIX.1c @@ -608,7 +608,7 @@ The @code{mktime} function ignores the specified contents of the @code{tm_wday} and @code{tm_yday} members of the broken-down time structure. It uses the values of the other components to compute the calendar time; it's permissible for these components to have -unnormalized values outside of their normal ranges. The last thing that +unnormalized values outside their normal ranges. The last thing that @code{mktime} does is adjust the components of the @var{brokentime} structure (including the @code{tm_wday} and @code{tm_yday}). @@ -655,8 +655,8 @@ string.) @deftypefun {char *} asctime_r (const struct tm *@var{brokentime}, char *@var{buffer}) This function is similar to @code{asctime} but instead of placing the result in a static buffer it writes the string in the buffer pointed to -by the parameter @var{buffer}. This buffer should have at least room -for 16 bytes. +by the parameter @var{buffer}. This buffer should have room +for at least 26 bytes, including the terminating null. If no error occurred the function returns a pointer to the string the result was written into, i.e., it returns @var{buffer}. Otherwise @@ -979,8 +979,8 @@ A literal @samp{%} character. The @var{size} parameter can be used to specify the maximum number of characters to be stored in the array @var{s}, including the terminating null character. If the formatted time requires more than @var{size} -characters, @code{strftime} returns zero and the content of the array -@var{s} is indetermined. Otherwise the return value indicates the +characters, @code{strftime} returns zero and the contents of the array +@var{s} are undefined. Otherwise the return value indicates the number of characters placed in the array @var{s}, not including the terminating null character. @@ -1018,7 +1018,7 @@ For an example of @code{strftime}, see @ref{Time Functions Example}. @comment ISO/Amend1 @deftypefun size_t wcsftime (wchar_t *@var{s}, size_t @var{size}, const wchar_t *@var{template}, const struct tm *@var{brokentime}) The @code{wcsftime} function is equivalent to the @code{strftime} -function with the difference that it operates one wide character +function with the difference that it operates on wide character strings. The buffer where the result is stored, pointed to by @var{s}, must be an array of wide characters. The parameter @var{size} which specifies the size of the output buffer gives the number of wide @@ -1026,7 +1026,7 @@ character, not the number of bytes. Also the format string @var{template} is a wide character string. Since all characters needed to specify the format string are in the basic -characater set it is portably possible to write format strings in the C +character set it is portably possible to write format strings in the C source code using the @code{L"..."} notation. The parameter @var{brokentime} has the same meaning as in the @code{strftime} call. @@ -1044,10 +1044,11 @@ same problems indicated in the @code{strftime} documentation. The @w{ISO C} standard does not specify any functions which can convert the output of the @code{strftime} function back into a binary format. -This lead to variety of more or less successful implementations with -different interfaces over the years. Then the Unix standard got -extended by two functions: @code{strptime} and @code{getdate}. Both -have kind of strange interfaces but at least they are widely available. +This led to a variety of more-or-less successful implementations with +different interfaces over the years. Then the Unix standard was +extended by the addition of two functions: @code{strptime} and +@code{getdate}. Both have strange interfaces but at least they are +widely available. @menu * Low-Level Time String Parsing:: Interpret string according to given format. @@ -1058,34 +1059,31 @@ have kind of strange interfaces but at least they are widely available. @node Low-Level Time String Parsing @subsubsection Interpret string according to given format -The first function is a rather low-level interface. It is nevertheless -frequently used in user programs since it is better known. Its -implementation and the interface though is heavily influenced by the -@code{getdate} function which is defined and implemented in terms of -calls to @code{strptime}. +he first function is rather low-level. It is nevertheless frequently +used in software since it is better known. Its interface and +implementation are heavily influenced by the @code{getdate} function, +which is defined and implemented in terms of calls to @code{strptime}. @comment time.h @comment XPG4 @deftypefun {char *} strptime (const char *@var{s}, const char *@var{fmt}, struct tm *@var{tp}) The @code{strptime} function parses the input string @var{s} according -to the format string @var{fmt} and stores the found values in the +to the format string @var{fmt} and stores its results in the structure @var{tp}. -The input string can be retrieved in any way. It does not matter -whether it was generated by a @code{strftime} call or made up directly -by a program. It is also not necessary that the content is in any -human-recognizable format. I.e., it is OK if a date is written like -@code{"02:1999:9"} which is not understandable without context. As long -the format string @var{fmt} matches the format of the input string -everything goes. +The input string could be generated by a @code{strftime} call or +obtained any other way. It does not need to be in a human-recognizable +format; e.g. a date passed as @code{"02:1999:9"} is acceptable, even +though it is ambiguous without context. As long as the format string +@var{fmt} matches the input string the function will succeed. The format string consists of the same components as the format string -for the @code{strftime} function. The only difference is that the flags +of the @code{strftime} function. The only difference is that the flags @code{_}, @code{-}, @code{0}, and @code{^} are not allowed. @comment Is this really the intention? --drepper -Several of the formats which @code{strftime} handled differently do the -same work in @code{strptime} since differences like case of the output -do not matter. For symmetry reasons all formats are supported, though. +Several of the distinct formats of @code{strftime} do the same work in +@code{strptime} since differences like case of the input do not matter. +For reasons of symmetry all formats are supported, though. The modifiers @code{E} and @code{O} are also allowed everywhere the @code{strftime} function allows them. @@ -1119,9 +1117,9 @@ contains the @code{%y} format. @item %EC The locale's representation of the period. -Unlike @code{%C} it makes sometimes sense to use this format since in -some cultures it is required to specify years relative to periods -instead of using the Gregorian years. +Unlike @code{%C} it sometimes makes sense to use this format since some +cultures represent years relative to the beginning of eras instead of +using the Gregorian years. @item %d @item %e @@ -1130,15 +1128,15 @@ Leading zeroes are permitted but not required. @item %Od @itemx %Oe -Same as @code{%d} but the locale's alternative numeric symbols are used. +Same as @code{%d} but using the locale's alternative numeric symbols. Leading zeroes are permitted but not required. @item %D -Equivalent to the use of @code{%m/%d/%y} in this place. +Equivalent to @code{%m/%d/%y}. @item %F -Equivalent to the use of @code{%Y-%m-%d} which is the @w{ISO 8601} date +Equivalent to @code{%Y-%m-%d}, which is the @w{ISO 8601} date format. This is a GNU extension following an @w{ISO C99} extension to @@ -1148,7 +1146,7 @@ This is a GNU extension following an @w{ISO C99} extension to The year corresponding to the ISO week number, but without the century (range @code{00} through @code{99}). -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. This format is a GNU extension following a GNU extension of @code{strftime}. @@ -1156,7 +1154,7 @@ This format is a GNU extension following a GNU extension of @code{strftime}. @item %G The year corresponding to the ISO week number. -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. This format is a GNU extension following a GNU extension of @code{strftime}. @@ -1169,7 +1167,7 @@ The hour as a decimal number, using a 24-hour clock (range @code{00} through @code{%k} is a GNU extension following a GNU extension of @code{strftime}. @item %OH -Same as @code{%H} but using the locale's alternative numeric symbols are used. +Same as @code{%H} but using the locale's alternative numeric symbols. @item %I @itemx %l @@ -1179,7 +1177,7 @@ The hour as a decimal number, using a 12-hour clock (range @code{01} through @code{%l} is a GNU extension following a GNU extension of @code{strftime}. @item %OI -Same as @code{%I} but using the locale's alternative numeric symbols are used. +Same as @code{%I} but using the locale's alternative numeric symbols. @item %j The day of the year as a decimal number (range @code{1} through @code{366}). @@ -1192,7 +1190,7 @@ The month as a decimal number (range @code{1} through @code{12}). Leading zeroes are permitted but not required. @item %Om -Same as @code{%m} but using the locale's alternative numeric symbols are used. +Same as @code{%m} but using the locale's alternative numeric symbols. @item %M The minute as a decimal number (range @code{0} through @code{59}). @@ -1200,7 +1198,7 @@ The minute as a decimal number (range @code{0} through @code{59}). Leading zeroes are permitted but not required. @item %OM -Same as @code{%M} but using the locale's alternative numeric symbols are used. +Same as @code{%M} but using the locale's alternative numeric symbols. @item %n @itemx %t @@ -1238,12 +1236,12 @@ The seconds as a decimal number (range @code{0} through @code{61}). Leading zeroes are permitted but not required. -Please note the nonsense with @code{61} being allowed. This is what the -Unix specification says. They followed the stupid decision once made to -allow double leap seconds. These do not exist but the myth persists. +Note the nonsense with @code{61}, as given in the Unix specification. +This is a result of a decision to allow double leap seconds. These do +not in fact exist but the myth persists. @item %OS -Same as @code{%S} but using the locale's alternative numeric symbols are used. +Same as @code{%S} but using the locale's alternative numeric symbols. @item %T Equivalent to the use of @code{%H:%M:%S} in this place. @@ -1254,7 +1252,7 @@ The day of the week as a decimal number (range @code{1} through Leading zeroes are permitted but not required. -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. @item %U @@ -1264,7 +1262,7 @@ through @code{53}). Leading zeroes are permitted but not required. @item %OU -Same as @code{%U} but using the locale's alternative numeric symbols are used. +Same as @code{%U} but using the locale's alternative numeric symbols. @item %V The @w{ISO 8601:1988} week number as a decimal number (range @code{1} @@ -1272,7 +1270,7 @@ through @code{53}). Leading zeroes are permitted but not required. -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. @item %w @@ -1281,11 +1279,11 @@ The day of the week as a decimal number (range @code{0} through Leading zeroes are permitted but not required. -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. @item %Ow -Same as @code{%w} but using the locale's alternative numeric symbols are used. +Same as @code{%w} but using the locale's alternative numeric symbols. @item %W The week number of the current year as a decimal number (range @code{0} @@ -1293,11 +1291,11 @@ through @code{53}). Leading zeroes are permitted but not required. -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. @item %OW -Same as @code{%W} but using the locale's alternative numeric symbols are used. +Same as @code{%W} but using the locale's alternative numeric symbols. @item %x The date using the locale's date format. @@ -1317,7 +1315,7 @@ The year without a century as a decimal number (range @code{0} through Leading zeroes are permitted but not required. -Please note that it is at least questionable to use this format without +Note that it is questionable to use this format without the @code{%C} format. The @code{strptime} function does regard input values in the range @math{68} to @math{99} as the years @math{1969} to @math{1999} and the values @math{0} to @math{68} as the years @@ -1347,7 +1345,7 @@ This is the full @w{ISO 8601} date and time format. @item %Z The timezone name. -@emph{Note:} This is not really implemented currently. The format is +@emph{Note:} Currently, this is not fully implemented. The format is recognized, input is consumed but no field in @var{tm} is set. @item %% @@ -1356,7 +1354,7 @@ A literal @samp{%} character. All other characters in the format string must have a matching character in the input string. Exceptions are white spaces in the input string -which can match zero or more white space characters in the input string. +which can match zero or more white space characters in the format string. The @code{strptime} function processes the input string from right to left. Each of the three possible input elements (white space, literal, @@ -1364,50 +1362,48 @@ or format) are handled one after the other. If the input cannot be matched to the format string the function stops. The remainder of the format and input strings are not processed. -The return value of the function is a pointer to the first character not -processed in this function call. In case the input string contains more -characters than required by the format string the return value points -right after the last consumed input character. In case the whole input -string is consumed the return value points to the NUL byte at the end of -the string. If @code{strptime} fails to match all of the format string -and therefore an error occurred the function returns @code{NULL}. +The function returns a pointer to the first character it was unable to +process. If the input string contains more characters than required by +the format string the return value points right after the last consumed +input character. If the whole input string is consumed the return value +points to the @code{NULL} byte at the end of the string. If an error +occurs, i.e. @code{strptime} fails to match all of the format string, +the function returns @code{NULL}. @end deftypefun -The specification of the function in the XPG standard is rather vague. -It leaves out a few important pieces of information. Most important it +The specification of the function in the XPG standard is rather vague, +leaving out a few important pieces of information. Most importantly, it does not specify what happens to those elements of @var{tm} which are -not directly initialized by the different formats. Various +not directly initialized by the different formats. The implementations on different Unix systems vary here. The GNU libc implementation does not touch those fields which are not directly initialized. Exceptions are the @code{tm_wday} and -@code{tm_yday} elements which are recomputed if any of the year, month, +@code{tm_yday} elements, which are recomputed if any of the year, month, or date elements changed. This has two implications: @itemize @bullet @item -Before calling the @code{strptime} function for a new input string one -has to prepare the structure passed in as the @var{tm}. Normally this -will mean that all values are initialized to zero. Alternatively one -can use all fields to values like @code{INT_MAX} which allows to -determine which elements were set by the function call. Zero does not -work here since it is a valid value for many of the fields. - -Careful initialization is necessary if one wants to find out whether a +Before calling the @code{strptime} function for a new input string, you +should prepare the @var{tm} structure you pass. Normally this will mean +initializing all values are to zero. Alternatively, you can set all +fields to values like @code{INT_MAX}, allowing you to determine which +elements were set by the function call. Zero does not work here since +it is a valid value for many of the fields. + +Careful initialization is necessary if you want to find out whether a certain field in @var{tm} was initialized by the function call. @item -One can construct a @code{struct tm} value in several @code{strptime} -calls in a row. A useful application of this is for example the parsing -of two separate strings, one containing the date information, the other -the time information. By parsing both one after the other without -clearing the structure in between one can construct a complete -broken-down time. +You can construct a @code{struct tm} value with several consecutive +@code{strptime} calls. A useful application of this is e.g. the parsing +of two separate strings, one containing date information and the other +time information. By parsing one after the other without clearing the +structure in-between, you can construct a complete broken-down time. @end itemize The following example shows a function which parses a string which is -supposed to contain the date information in either US style or @w{ISO -8601} form. +contains the date information in either US style or @w{ISO 8601} form: @smallexample const char * @@ -1431,20 +1427,20 @@ parse_date (const char *input, struct tm *tm) @end smallexample @node General Time String Parsing -@subsubsection A user-friendlier way to parse times and dates +@subsubsection A More User-friendly Way to Parse Times and Dates -The Unix standard defines another function to parse date strings. The -interface is, mildly said, weird. But if this function fits into the -application to be written it is just fine. It is a problem when using -this function in multi-threaded programs or in libraries since it -returns a pointer to a static variable, uses a global variable, and a -global state (an environment variable). +The Unix standard defines another function for parsing date strings. +The interface is weird, but if the function happens to suit your +application it is just fine. It is problematic to use this function +in multi-threaded programs or libraries, since it returns a pointer to +a static variable, and uses a global variable and global state (an +environment variable). @comment time.h @comment Unix98 @defvar getdate_err -This variable of type @code{int} will contain the error code of the last -unsuccessful call of the @code{getdate} function. Defined values are: +This variable of type @code{int} contains the error code of the last +unsuccessful call to @code{getdate}. Defined values are: @table @math @item 1 @@ -1455,7 +1451,7 @@ cannot be opened. @item 3 Information about the template file cannot retrieved. @item 4 -The template file is no regular file. +The template file is not a regular file. @item 5 An I/O error occurred while reading the template file. @item 6 @@ -1463,67 +1459,66 @@ Not enough memory available to execute the function. @item 7 The template file contains no matching template. @item 8 -The input string is invalid for a template which would match otherwise. -This includes error like February 31st, or return values which can be -represented using @code{time_t}. +The input date is invalid, but would match a template otherwise. This +includes dates like February 31st, and dates which cannot be represented +in a @code{time_t} variable. @end table @end defvar @comment time.h @comment Unix98 @deftypefun {struct tm *} getdate (const char *@var{string}) -The interface of the @code{getdate} function is the simplest possible -for a function to parse a string and return the value. @var{string} is -the input string and the result is passed to the user in a statically -allocated variable. +The interface to @code{getdate} is the simplest possible for a function +to parse a string and return the value. @var{string} is the input +string and the result is returned in a statically-allocated variable. -The details about how the string is processed is hidden from the user. -In fact, it can be outside the control of the program. Which formats +The details about how the string is processed are hidden from the user. +In fact, they can be outside the control of the program. Which formats are recognized is controlled by the file named by the environment -variable @code{DATEMSK}. The content of the named file should contain +variable @code{DATEMSK}. This file should contain lines of valid format strings which could be passed to @code{strptime}. The @code{getdate} function reads these format strings one after the other and tries to match the input string. The first line which completely matches the input string is used. -Elements which were not initialized through the format string get -assigned the values of the time the @code{getdate} function is called. +Elements not initialized through the format string retain the values +present at the time of the @code{getdate} function call. -The format elements recognized by @code{getdate} are the same as for +The formats recognized by @code{getdate} are the same as for @code{strptime}. See above for an explanation. There are only a few -extension to the @code{strptime} behavior: +extensions to the @code{strptime} behavior: @itemize @bullet @item If the @code{%Z} format is given the broken-down time is based on the -current time in the timezone matched, not in the current timezone of the +current time of the timezone matched, not of the current timezone of the runtime environment. @emph{Note}: This is not implemented (currently). The problem is that timezone names are not unique. If a fixed timezone is assumed for a -given string |
