Update from Gnulib

This incorporates:
2020-02-23 use 'restrict'
* lib/careadlinkat.h, lib/md5.h, lib/sha1.h, lib/sha256.h:
* lib/sha512.h, lib/strftime.h, lib/string.in.h, m4/nstrftime.m4:
Copy from Gnulib.
* m4/gnulib-comp.m4: Regenerate.
This commit is contained in:
Paul Eggert 2020-02-23 16:14:24 -08:00
parent b95f78ed7b
commit c4ca8219dd
9 changed files with 45 additions and 26 deletions

View file

@ -47,7 +47,7 @@ struct allocator;
set errno. */
char *careadlinkat (int fd, char const *filename,
char *buffer, size_t buffer_size,
char *restrict buffer, size_t buffer_size,
struct allocator const *alloc,
ssize_t (*preadlinkat) (int, char const *,
char *, size_t));

View file

@ -105,13 +105,15 @@ extern void __md5_process_bytes (const void *buffer, size_t len,
in first 16 bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest. */
extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *restrict resbuf)
__THROW;
/* Put result from CTX in first 16 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest. */
extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *restrict resbuf)
__THROW;
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
@ -119,7 +121,7 @@ extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
output yields to the wanted ASCII representation of the message
digest. */
extern void *__md5_buffer (const char *buffer, size_t len,
void *resblock) __THROW;
void *restrict resblock) __THROW;
# endif
/* Compute MD5 message digest for bytes read from STREAM.

View file

@ -71,20 +71,21 @@ extern void sha1_process_bytes (const void *buffer, size_t len,
in first 20 bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest. */
extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *restrict resbuf);
/* Put result from CTX in first 20 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest. */
extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *restrict resbuf);
/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
extern void *sha1_buffer (const char *buffer, size_t len,
void *restrict resblock);
# endif
/* Compute SHA1 message digest for bytes read from STREAM.

View file

@ -70,23 +70,27 @@ extern void sha256_process_bytes (const void *buffer, size_t len,
in first 32 (28) bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest. */
extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
/* Put result from CTX in first 32 (28) bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest. */
extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
extern void *sha256_read_ctx (const struct sha256_ctx *ctx,
void *restrict resbuf);
extern void *sha224_read_ctx (const struct sha256_ctx *ctx,
void *restrict resbuf);
/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER.
The result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
extern void *sha256_buffer (const char *buffer, size_t len,
void *restrict resblock);
extern void *sha224_buffer (const char *buffer, size_t len,
void *restrict resblock);
# endif
/* Compute SHA256 (SHA224) message digest for bytes read from STREAM.

View file

@ -70,8 +70,8 @@ extern void sha512_process_bytes (const void *buffer, size_t len,
in first 64 (48) bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest. */
extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *restrict resbuf);
extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *restrict resbuf);
/* Put result from CTX in first 64 (48) bytes following RESBUF. The result is
@ -80,16 +80,20 @@ extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
extern void *sha512_read_ctx (const struct sha512_ctx *ctx,
void *restrict resbuf);
extern void *sha384_read_ctx (const struct sha512_ctx *ctx,
void *restrict resbuf);
/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER.
The result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
extern void *sha512_buffer (const char *buffer, size_t len,
void *restrict resblock);
extern void *sha384_buffer (const char *buffer, size_t len,
void *restrict resblock);
# endif
/* Compute SHA512 (SHA384) message digest for bytes read from STREAM.

View file

@ -25,7 +25,7 @@ extern "C" {
POSIX requires that strftime use the local timezone information.
Use the timezone __TZ instead. Use __NS as the number of
nanoseconds in the %N directive. */
size_t nstrftime (char *, size_t, char const *, struct tm const *,
size_t nstrftime (char *restrict, size_t, char const *, struct tm const *,
timezone_t __tz, int __ns);
#ifdef __cplusplus

View file

@ -969,7 +969,8 @@ _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
Caveat: The identity of the delimiting character is lost.
See also mbssep(). */
_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
char **save_ptr)
_GL_ARG_NONNULL ((2, 3));
#endif

View file

@ -211,6 +211,7 @@ AC_DEFUN([gl_INIT],
gl_MODULE_INDICATOR([canonicalize-lgpl])
gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
gl_STDLIB_MODULE_INDICATOR([realpath])
AC_REQUIRE([AC_C_RESTRICT])
AC_CHECK_FUNCS_ONCE([readlinkat])
gl_CLOCK_TIME
gl_MODULE_INDICATOR([close-stream])
@ -219,9 +220,13 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([copy-file-range])
fi
gl_UNISTD_MODULE_INDICATOR([copy-file-range])
AC_REQUIRE([AC_C_RESTRICT])
gl_MD5
AC_REQUIRE([AC_C_RESTRICT])
gl_SHA1
AC_REQUIRE([AC_C_RESTRICT])
gl_SHA256
AC_REQUIRE([AC_C_RESTRICT])
gl_SHA512
gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE
gl_DIRENT_H

View file

@ -1,4 +1,4 @@
# serial 34
# serial 35
# Copyright (C) 1996-1997, 1999-2007, 2009-2020 Free Software Foundation, Inc.
#
@ -10,6 +10,8 @@
AC_DEFUN([gl_FUNC_GNU_STRFTIME],
[
AC_REQUIRE([AC_C_RESTRICT])
# This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
AC_REQUIRE([AC_STRUCT_TIMEZONE])