annotate doc/posix-functions/ctime_r.texi @ 9638:070329237839

Rename two directories: headers -> posix-headers, functions -> posix-functions.
author Bruno Haible <bruno@clisp.org>
date Sun, 20 Jan 2008 00:09:59 +0100
parents
children c83dc7e8df57
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node ctime_r
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section @code{ctime_r}
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 @findex ctime_r
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 POSIX specification: @url{http://www.opengroup.org/susv3xsh/ctime_r.html}
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 Gnulib module: ---
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 Portability problems fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 Portability problems not fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 @item
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 This function is missing on some platforms:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 mingw.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 @item
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 This function may put more than 26 bytes into the argument buffer if an
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 invalid year is passed.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 @code{ctime_r} takes a pre-allocated buffer and length of the buffer,
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 and returns @code{NULL} on errors.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 The input buffer should be at least 26 bytes in size. The output
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 string is locale-independent. However, years can have more than 4
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 digits if @code{time_t} is sufficiently wide, so the length of the
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 required output buffer is not easy to determine. Increasing the
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 buffer size when @code{ctime_r} returns @code{NULL} is not necessarily
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 sufficient. The @code{NULL} return value could mean some other error
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 condition, which will not go away by increasing the buffer size.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 A more flexible function is @code{strftime}. However, note that it is
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 locale dependent.