libntlm-1.6/ 0000755 0000000 0000000 00000000000 13647003167 007777 5 0000000 0000000 libntlm-1.6/gl/ 0000755 0000000 0000000 00000000000 13647003167 010401 5 0000000 0000000 libntlm-1.6/gl/md4.h 0000644 0000000 0000000 00000006142 13635703245 011162 0000000 0000000 /* Declarations of functions and data types used for MD4 sum
library functions.
Copyright (C) 2000-2001, 2003, 2005, 2008-2020 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see . */
#ifndef MD4_H
# define MD4_H 1
# include
# include
# ifdef __cplusplus
extern "C" {
# endif
# define MD4_DIGEST_SIZE 16
/* Structure to save state of computation between the single steps. */
struct md4_ctx
{
uint32_t A;
uint32_t B;
uint32_t C;
uint32_t D;
uint32_t total[2];
uint32_t buflen;
uint32_t buffer[32];
};
/* Initialize structure containing state of computation. */
extern void md4_init_ctx (struct md4_ctx *ctx);
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
extern void md4_process_block (const void *buffer, size_t len,
struct md4_ctx *ctx);
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
extern void md4_process_bytes (const void *buffer, size_t len,
struct md4_ctx *ctx);
/* Process the remaining bytes in the buffer and 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 *md4_finish_ctx (struct md4_ctx *ctx, void *restrict resbuf);
/* 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 *md4_read_ctx (const struct md4_ctx *ctx, void *restrict resbuf);
/* Compute MD4 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
extern int md4_stream (FILE * stream, void *resblock);
/* Compute MD4 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 *md4_buffer (const char *buffer, size_t len,
void *restrict resblock);
# ifdef __cplusplus
}
# endif
#endif
libntlm-1.6/gl/strverscmp.c 0000644 0000000 0000000 00000006201 13635703245 012675 0000000 0000000 /* Compare strings while treating digits characters numerically.
Copyright (C) 1997-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jean-François Bignolles , 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
. */
#ifndef _LIBC
# include
# define __strverscmp strverscmp
#endif
#include
#include
#include
/* states: S_N: normal, S_I: comparing integral part, S_F: comparing
fractional parts, S_Z: idem but with leading Zeroes only */
#define S_N 0x0
#define S_I 0x3
#define S_F 0x6
#define S_Z 0x9
/* result_type: CMP: return diff; LEN: compare using len_diff/diff */
#define CMP 2
#define LEN 3
/* Compare S1 and S2 as strings holding indices/version numbers,
returning less than, equal to or greater than zero if S1 is less than,
equal to or greater than S2 (for more info, see the texinfo doc).
*/
int
__strverscmp (const char *s1, const char *s2)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
/* Symbol(s) 0 [1-9] others
Transition (10) 0 (01) d (00) x */
static const uint_least8_t next_state[] =
{
/* state x d 0 */
/* S_N */ S_N, S_I, S_Z,
/* S_I */ S_N, S_I, S_I,
/* S_F */ S_N, S_F, S_F,
/* S_Z */ S_N, S_F, S_Z
};
static const int_least8_t result_type[] =
{
/* state x/x x/d x/0 d/x d/d d/0 0/x 0/d 0/0 */
/* S_N */ CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP,
/* S_I */ CMP, -1, -1, +1, LEN, LEN, +1, LEN, LEN,
/* S_F */ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
/* S_Z */ CMP, +1, +1, -1, CMP, CMP, -1, CMP, CMP
};
if (p1 == p2)
return 0;
unsigned char c1 = *p1++;
unsigned char c2 = *p2++;
/* Hint: '0' is a digit too. */
int state = S_N + ((c1 == '0') + (isdigit (c1) != 0));
int diff;
while ((diff = c1 - c2) == 0)
{
if (c1 == '\0')
return diff;
state = next_state[state];
c1 = *p1++;
c2 = *p2++;
state += (c1 == '0') + (isdigit (c1) != 0);
}
state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))];
switch (state)
{
case CMP:
return diff;
case LEN:
while (isdigit (*p1++))
if (!isdigit (*p2++))
return 1;
return isdigit (*p2) ? -1 : diff;
default:
return state;
}
}
libc_hidden_def (__strverscmp)
weak_alias (__strverscmp, strverscmp)
libntlm-1.6/gl/arg-nonnull.h 0000644 0000000 0000000 00000002326 13635703244 012731 0000000 0000000 /* A C macro for declaring that specific arguments must not be NULL.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see . */
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
that the values passed as arguments n, ..., m must be non-NULL pointers.
n = 1 stands for the first argument, n = 2 for the second argument etc. */
#ifndef _GL_ARG_NONNULL
# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
# else
# define _GL_ARG_NONNULL(params)
# endif
#endif
libntlm-1.6/gl/tests/ 0000755 0000000 0000000 00000000000 13647003167 011543 5 0000000 0000000 libntlm-1.6/gl/tests/dummy.c 0000644 0000000 0000000 00000003255 13635703245 012770 0000000 0000000 /* A dummy file, to prevent empty libraries from breaking builds.
Copyright (C) 2004, 2007, 2009-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
libraries without any object files. You might get an error like:
> ar cru .libs/libgl.a
> ar: no archive members specified
Compiling this file, and adding its object file to the library, will
prevent the library from being empty. */
/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
that don't export any symbol. You might get an error like:
> cc ... libgnu.a
> ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a
Compiling this file, and adding its object file to the library, will
prevent the library from exporting no symbols. */
#ifdef __sun
/* This declaration ensures that the library will export at least 1 symbol. */
int gl_dummy_symbol;
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
#endif
libntlm-1.6/gl/tests/test-vc-list-files-cvs.sh 0000755 0000000 0000000 00000003257 13635703245 016261 0000000 0000000 #!/bin/sh
# Unit tests for vc-list-files
# Copyright (C) 2008-2020 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see . */
: ${srcdir=.}
. "$srcdir/init.sh"; path_prepend_ .
tmpdir=vc-cvs
repo=`pwd`/$tmpdir/repo
fail=0
for i in with-cvsu without; do
# On the first iteration, test using cvsu, if it's in your path.
# On the second iteration, ensure that cvsu fails, so we'll
# exercise the awk-using code.
if test $i = without; then
printf '%s\n' '#!/bin/sh' 'exit 1' > cvsu
chmod a+x cvsu
PATH=`pwd`:$PATH
export PATH
fi
ok=0
mkdir $tmpdir && cd $tmpdir &&
# without cvs, skip the test
{ ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \
|| skip_ "cvs not found in PATH"; } &&
mkdir w && cd w &&
mkdir d &&
touch d/a b c &&
cvs -Q -d "$repo" import -m imp m M M0 &&
cvs -Q -d "$repo" co m && cd m &&
printf '%s\n' b c d/a > expected &&
$BOURNE_SHELL "$abs_aux_dir/vc-list-files" | sort > actual &&
compare expected actual &&
ok=1
test $ok = 0 && fail=1
done
Exit $fail
libntlm-1.6/gl/tests/inttypes.in.h 0000644 0000000 0000000 00000065407 13635703245 014135 0000000 0000000 /* Copyright (C) 2006-2020 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/*
* ISO C 99 for platforms that lack it.
*
*/
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
/* Include the original if it exists, and if this file
has not been included yet or if this file includes gnulib stdint.h
which in turn includes this file.
The include_next requires a split double-inclusion guard. */
#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
# if @HAVE_INTTYPES_H@
/* Some pre-C++11 implementations need this. */
# if defined __cplusplus && ! defined __STDC_FORMAT_MACROS
# define __STDC_FORMAT_MACROS 1
# endif
# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
# define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
# endif
#endif
#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
#define INTTYPES_H
/* Include or the gnulib replacement.
But avoid namespace pollution on glibc systems. */
#ifndef __GLIBC__
# include
#endif
/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */
#include
/* On mingw, __USE_MINGW_ANSI_STDIO only works if is also included */
#if defined _WIN32 && ! defined __CYGWIN__
# include
#endif
#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
# error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to ."
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
/* 7.8.1 Macros for format specifiers */
#if defined _TNS_R_TARGET
/* Tandem NonStop R series and compatible platforms released before
July 2005 support %Ld but not %lld. */
# define _LONG_LONG_FORMAT_PREFIX "L"
#else
# define _LONG_LONG_FORMAT_PREFIX "ll"
#endif
#if !defined PRId8 || @PRI_MACROS_BROKEN@
# undef PRId8
# ifdef INT8_MAX
# define PRId8 "d"
# endif
#endif
#if !defined PRIi8 || @PRI_MACROS_BROKEN@
# undef PRIi8
# ifdef INT8_MAX
# define PRIi8 "i"
# endif
#endif
#if !defined PRIo8 || @PRI_MACROS_BROKEN@
# undef PRIo8
# ifdef UINT8_MAX
# define PRIo8 "o"
# endif
#endif
#if !defined PRIu8 || @PRI_MACROS_BROKEN@
# undef PRIu8
# ifdef UINT8_MAX
# define PRIu8 "u"
# endif
#endif
#if !defined PRIx8 || @PRI_MACROS_BROKEN@
# undef PRIx8
# ifdef UINT8_MAX
# define PRIx8 "x"
# endif
#endif
#if !defined PRIX8 || @PRI_MACROS_BROKEN@
# undef PRIX8
# ifdef UINT8_MAX
# define PRIX8 "X"
# endif
#endif
#if !defined PRId16 || @PRI_MACROS_BROKEN@
# undef PRId16
# ifdef INT16_MAX
# define PRId16 "d"
# endif
#endif
#if !defined PRIi16 || @PRI_MACROS_BROKEN@
# undef PRIi16
# ifdef INT16_MAX
# define PRIi16 "i"
# endif
#endif
#if !defined PRIo16 || @PRI_MACROS_BROKEN@
# undef PRIo16
# ifdef UINT16_MAX
# define PRIo16 "o"
# endif
#endif
#if !defined PRIu16 || @PRI_MACROS_BROKEN@
# undef PRIu16
# ifdef UINT16_MAX
# define PRIu16 "u"
# endif
#endif
#if !defined PRIx16 || @PRI_MACROS_BROKEN@
# undef PRIx16
# ifdef UINT16_MAX
# define PRIx16 "x"
# endif
#endif
#if !defined PRIX16 || @PRI_MACROS_BROKEN@
# undef PRIX16
# ifdef UINT16_MAX
# define PRIX16 "X"
# endif
#endif
#if !defined PRId32 || @PRI_MACROS_BROKEN@
# undef PRId32
# ifdef INT32_MAX
# define PRId32 "d"
# endif
#endif
#if !defined PRIi32 || @PRI_MACROS_BROKEN@
# undef PRIi32
# ifdef INT32_MAX
# define PRIi32 "i"
# endif
#endif
#if !defined PRIo32 || @PRI_MACROS_BROKEN@
# undef PRIo32
# ifdef UINT32_MAX
# define PRIo32 "o"
# endif
#endif
#if !defined PRIu32 || @PRI_MACROS_BROKEN@
# undef PRIu32
# ifdef UINT32_MAX
# define PRIu32 "u"
# endif
#endif
#if !defined PRIx32 || @PRI_MACROS_BROKEN@
# undef PRIx32
# ifdef UINT32_MAX
# define PRIx32 "x"
# endif
#endif
#if !defined PRIX32 || @PRI_MACROS_BROKEN@
# undef PRIX32
# ifdef UINT32_MAX
# define PRIX32 "X"
# endif
#endif
#ifdef INT64_MAX
# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
# define _PRI64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _PRI64_PREFIX "I64"
# elif LONG_MAX >> 30 == 1
# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# if !defined PRId64 || @PRI_MACROS_BROKEN@
# undef PRId64
# define PRId64 _PRI64_PREFIX "d"
# endif
# if !defined PRIi64 || @PRI_MACROS_BROKEN@
# undef PRIi64
# define PRIi64 _PRI64_PREFIX "i"
# endif
#endif
#ifdef UINT64_MAX
# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
# define _PRIu64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _PRIu64_PREFIX "I64"
# elif ULONG_MAX >> 31 == 1
# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# if !defined PRIo64 || @PRI_MACROS_BROKEN@
# undef PRIo64
# define PRIo64 _PRIu64_PREFIX "o"
# endif
# if !defined PRIu64 || @PRI_MACROS_BROKEN@
# undef PRIu64
# define PRIu64 _PRIu64_PREFIX "u"
# endif
# if !defined PRIx64 || @PRI_MACROS_BROKEN@
# undef PRIx64
# define PRIx64 _PRIu64_PREFIX "x"
# endif
# if !defined PRIX64 || @PRI_MACROS_BROKEN@
# undef PRIX64
# define PRIX64 _PRIu64_PREFIX "X"
# endif
#endif
#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
# undef PRIdLEAST8
# define PRIdLEAST8 "d"
#endif
#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
# undef PRIiLEAST8
# define PRIiLEAST8 "i"
#endif
#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
# undef PRIoLEAST8
# define PRIoLEAST8 "o"
#endif
#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
# undef PRIuLEAST8
# define PRIuLEAST8 "u"
#endif
#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
# undef PRIxLEAST8
# define PRIxLEAST8 "x"
#endif
#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
# undef PRIXLEAST8
# define PRIXLEAST8 "X"
#endif
#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
# undef PRIdLEAST16
# define PRIdLEAST16 "d"
#endif
#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
# undef PRIiLEAST16
# define PRIiLEAST16 "i"
#endif
#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
# undef PRIoLEAST16
# define PRIoLEAST16 "o"
#endif
#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
# undef PRIuLEAST16
# define PRIuLEAST16 "u"
#endif
#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
# undef PRIxLEAST16
# define PRIxLEAST16 "x"
#endif
#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
# undef PRIXLEAST16
# define PRIXLEAST16 "X"
#endif
#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
# undef PRIdLEAST32
# define PRIdLEAST32 "d"
#endif
#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
# undef PRIiLEAST32
# define PRIiLEAST32 "i"
#endif
#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
# undef PRIoLEAST32
# define PRIoLEAST32 "o"
#endif
#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
# undef PRIuLEAST32
# define PRIuLEAST32 "u"
#endif
#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
# undef PRIxLEAST32
# define PRIxLEAST32 "x"
#endif
#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
# undef PRIXLEAST32
# define PRIXLEAST32 "X"
#endif
#ifdef INT64_MAX
# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
# undef PRIdLEAST64
# define PRIdLEAST64 PRId64
# endif
# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
# undef PRIiLEAST64
# define PRIiLEAST64 PRIi64
# endif
#endif
#ifdef UINT64_MAX
# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
# undef PRIoLEAST64
# define PRIoLEAST64 PRIo64
# endif
# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
# undef PRIuLEAST64
# define PRIuLEAST64 PRIu64
# endif
# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
# undef PRIxLEAST64
# define PRIxLEAST64 PRIx64
# endif
# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
# undef PRIXLEAST64
# define PRIXLEAST64 PRIX64
# endif
#endif
#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
# undef PRIdFAST8
# if INT_FAST8_MAX > INT32_MAX
# define PRIdFAST8 PRId64
# else
# define PRIdFAST8 "d"
# endif
#endif
#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@
# undef PRIiFAST8
# if INT_FAST8_MAX > INT32_MAX
# define PRIiFAST8 PRIi64
# else
# define PRIiFAST8 "i"
# endif
#endif
#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
# undef PRIoFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define PRIoFAST8 PRIo64
# else
# define PRIoFAST8 "o"
# endif
#endif
#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@
# undef PRIuFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define PRIuFAST8 PRIu64
# else
# define PRIuFAST8 "u"
# endif
#endif
#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
# undef PRIxFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define PRIxFAST8 PRIx64
# else
# define PRIxFAST8 "x"
# endif
#endif
#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@
# undef PRIXFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define PRIXFAST8 PRIX64
# else
# define PRIXFAST8 "X"
# endif
#endif
#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
# undef PRIdFAST16
# if INT_FAST16_MAX > INT32_MAX
# define PRIdFAST16 PRId64
# else
# define PRIdFAST16 "d"
# endif
#endif
#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@
# undef PRIiFAST16
# if INT_FAST16_MAX > INT32_MAX
# define PRIiFAST16 PRIi64
# else
# define PRIiFAST16 "i"
# endif
#endif
#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
# undef PRIoFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define PRIoFAST16 PRIo64
# else
# define PRIoFAST16 "o"
# endif
#endif
#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@
# undef PRIuFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define PRIuFAST16 PRIu64
# else
# define PRIuFAST16 "u"
# endif
#endif
#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
# undef PRIxFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define PRIxFAST16 PRIx64
# else
# define PRIxFAST16 "x"
# endif
#endif
#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@
# undef PRIXFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define PRIXFAST16 PRIX64
# else
# define PRIXFAST16 "X"
# endif
#endif
#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
# undef PRIdFAST32
# if INT_FAST32_MAX > INT32_MAX
# define PRIdFAST32 PRId64
# else
# define PRIdFAST32 "d"
# endif
#endif
#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@
# undef PRIiFAST32
# if INT_FAST32_MAX > INT32_MAX
# define PRIiFAST32 PRIi64
# else
# define PRIiFAST32 "i"
# endif
#endif
#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
# undef PRIoFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define PRIoFAST32 PRIo64
# else
# define PRIoFAST32 "o"
# endif
#endif
#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@
# undef PRIuFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define PRIuFAST32 PRIu64
# else
# define PRIuFAST32 "u"
# endif
#endif
#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
# undef PRIxFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define PRIxFAST32 PRIx64
# else
# define PRIxFAST32 "x"
# endif
#endif
#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@
# undef PRIXFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define PRIXFAST32 PRIX64
# else
# define PRIXFAST32 "X"
# endif
#endif
#ifdef INT64_MAX
# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
# undef PRIdFAST64
# define PRIdFAST64 PRId64
# endif
# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
# undef PRIiFAST64
# define PRIiFAST64 PRIi64
# endif
#endif
#ifdef UINT64_MAX
# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
# undef PRIoFAST64
# define PRIoFAST64 PRIo64
# endif
# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
# undef PRIuFAST64
# define PRIuFAST64 PRIu64
# endif
# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
# undef PRIxFAST64
# define PRIxFAST64 PRIx64
# endif
# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
# undef PRIXFAST64
# define PRIXFAST64 PRIX64
# endif
#endif
#if !defined PRIdMAX || @PRI_MACROS_BROKEN@
# undef PRIdMAX
# if @INT32_MAX_LT_INTMAX_MAX@
# define PRIdMAX PRId64
# else
# define PRIdMAX "ld"
# endif
#endif
#if !defined PRIiMAX || @PRI_MACROS_BROKEN@
# undef PRIiMAX
# if @INT32_MAX_LT_INTMAX_MAX@
# define PRIiMAX PRIi64
# else
# define PRIiMAX "li"
# endif
#endif
#if !defined PRIoMAX || @PRI_MACROS_BROKEN@
# undef PRIoMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define PRIoMAX PRIo64
# else
# define PRIoMAX "lo"
# endif
#endif
#if !defined PRIuMAX || @PRI_MACROS_BROKEN@
# undef PRIuMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define PRIuMAX PRIu64
# else
# define PRIuMAX "lu"
# endif
#endif
#if !defined PRIxMAX || @PRI_MACROS_BROKEN@
# undef PRIxMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define PRIxMAX PRIx64
# else
# define PRIxMAX "lx"
# endif
#endif
#if !defined PRIXMAX || @PRI_MACROS_BROKEN@
# undef PRIXMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define PRIXMAX PRIX64
# else
# define PRIXMAX "lX"
# endif
#endif
#if !defined PRIdPTR || @PRI_MACROS_BROKEN@
# undef PRIdPTR
# ifdef INTPTR_MAX
# define PRIdPTR @PRIPTR_PREFIX@ "d"
# endif
#endif
#if !defined PRIiPTR || @PRI_MACROS_BROKEN@
# undef PRIiPTR
# ifdef INTPTR_MAX
# define PRIiPTR @PRIPTR_PREFIX@ "i"
# endif
#endif
#if !defined PRIoPTR || @PRI_MACROS_BROKEN@
# undef PRIoPTR
# ifdef UINTPTR_MAX
# define PRIoPTR @PRIPTR_PREFIX@ "o"
# endif
#endif
#if !defined PRIuPTR || @PRI_MACROS_BROKEN@
# undef PRIuPTR
# ifdef UINTPTR_MAX
# define PRIuPTR @PRIPTR_PREFIX@ "u"
# endif
#endif
#if !defined PRIxPTR || @PRI_MACROS_BROKEN@
# undef PRIxPTR
# ifdef UINTPTR_MAX
# define PRIxPTR @PRIPTR_PREFIX@ "x"
# endif
#endif
#if !defined PRIXPTR || @PRI_MACROS_BROKEN@
# undef PRIXPTR
# ifdef UINTPTR_MAX
# define PRIXPTR @PRIPTR_PREFIX@ "X"
# endif
#endif
#if !defined SCNd8 || @PRI_MACROS_BROKEN@
# undef SCNd8
# ifdef INT8_MAX
# define SCNd8 "hhd"
# endif
#endif
#if !defined SCNi8 || @PRI_MACROS_BROKEN@
# undef SCNi8
# ifdef INT8_MAX
# define SCNi8 "hhi"
# endif
#endif
#if !defined SCNo8 || @PRI_MACROS_BROKEN@
# undef SCNo8
# ifdef UINT8_MAX
# define SCNo8 "hho"
# endif
#endif
#if !defined SCNu8 || @PRI_MACROS_BROKEN@
# undef SCNu8
# ifdef UINT8_MAX
# define SCNu8 "hhu"
# endif
#endif
#if !defined SCNx8 || @PRI_MACROS_BROKEN@
# undef SCNx8
# ifdef UINT8_MAX
# define SCNx8 "hhx"
# endif
#endif
#if !defined SCNd16 || @PRI_MACROS_BROKEN@
# undef SCNd16
# ifdef INT16_MAX
# define SCNd16 "hd"
# endif
#endif
#if !defined SCNi16 || @PRI_MACROS_BROKEN@
# undef SCNi16
# ifdef INT16_MAX
# define SCNi16 "hi"
# endif
#endif
#if !defined SCNo16 || @PRI_MACROS_BROKEN@
# undef SCNo16
# ifdef UINT16_MAX
# define SCNo16 "ho"
# endif
#endif
#if !defined SCNu16 || @PRI_MACROS_BROKEN@
# undef SCNu16
# ifdef UINT16_MAX
# define SCNu16 "hu"
# endif
#endif
#if !defined SCNx16 || @PRI_MACROS_BROKEN@
# undef SCNx16
# ifdef UINT16_MAX
# define SCNx16 "hx"
# endif
#endif
#if !defined SCNd32 || @PRI_MACROS_BROKEN@
# undef SCNd32
# ifdef INT32_MAX
# define SCNd32 "d"
# endif
#endif
#if !defined SCNi32 || @PRI_MACROS_BROKEN@
# undef SCNi32
# ifdef INT32_MAX
# define SCNi32 "i"
# endif
#endif
#if !defined SCNo32 || @PRI_MACROS_BROKEN@
# undef SCNo32
# ifdef UINT32_MAX
# define SCNo32 "o"
# endif
#endif
#if !defined SCNu32 || @PRI_MACROS_BROKEN@
# undef SCNu32
# ifdef UINT32_MAX
# define SCNu32 "u"
# endif
#endif
#if !defined SCNx32 || @PRI_MACROS_BROKEN@
# undef SCNx32
# ifdef UINT32_MAX
# define SCNx32 "x"
# endif
#endif
#ifdef INT64_MAX
# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
# define _SCN64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _SCN64_PREFIX "I64"
# elif LONG_MAX >> 30 == 1
# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# if !defined SCNd64 || @PRI_MACROS_BROKEN@
# undef SCNd64
# define SCNd64 _SCN64_PREFIX "d"
# endif
# if !defined SCNi64 || @PRI_MACROS_BROKEN@
# undef SCNi64
# define SCNi64 _SCN64_PREFIX "i"
# endif
#endif
#ifdef UINT64_MAX
# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
# define _SCNu64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _SCNu64_PREFIX "I64"
# elif ULONG_MAX >> 31 == 1
# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# if !defined SCNo64 || @PRI_MACROS_BROKEN@
# undef SCNo64
# define SCNo64 _SCNu64_PREFIX "o"
# endif
# if !defined SCNu64 || @PRI_MACROS_BROKEN@
# undef SCNu64
# define SCNu64 _SCNu64_PREFIX "u"
# endif
# if !defined SCNx64 || @PRI_MACROS_BROKEN@
# undef SCNx64
# define SCNx64 _SCNu64_PREFIX "x"
# endif
#endif
#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
# undef SCNdLEAST8
# define SCNdLEAST8 "hhd"
#endif
#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
# undef SCNiLEAST8
# define SCNiLEAST8 "hhi"
#endif
#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
# undef SCNoLEAST8
# define SCNoLEAST8 "hho"
#endif
#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
# undef SCNuLEAST8
# define SCNuLEAST8 "hhu"
#endif
#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
# undef SCNxLEAST8
# define SCNxLEAST8 "hhx"
#endif
#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
# undef SCNdLEAST16
# define SCNdLEAST16 "hd"
#endif
#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
# undef SCNiLEAST16
# define SCNiLEAST16 "hi"
#endif
#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
# undef SCNoLEAST16
# define SCNoLEAST16 "ho"
#endif
#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
# undef SCNuLEAST16
# define SCNuLEAST16 "hu"
#endif
#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
# undef SCNxLEAST16
# define SCNxLEAST16 "hx"
#endif
#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
# undef SCNdLEAST32
# define SCNdLEAST32 "d"
#endif
#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
# undef SCNiLEAST32
# define SCNiLEAST32 "i"
#endif
#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
# undef SCNoLEAST32
# define SCNoLEAST32 "o"
#endif
#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
# undef SCNuLEAST32
# define SCNuLEAST32 "u"
#endif
#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
# undef SCNxLEAST32
# define SCNxLEAST32 "x"
#endif
#ifdef INT64_MAX
# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
# undef SCNdLEAST64
# define SCNdLEAST64 SCNd64
# endif
# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
# undef SCNiLEAST64
# define SCNiLEAST64 SCNi64
# endif
#endif
#ifdef UINT64_MAX
# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
# undef SCNoLEAST64
# define SCNoLEAST64 SCNo64
# endif
# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
# undef SCNuLEAST64
# define SCNuLEAST64 SCNu64
# endif
# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
# undef SCNxLEAST64
# define SCNxLEAST64 SCNx64
# endif
#endif
#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
# undef SCNdFAST8
# if INT_FAST8_MAX > INT32_MAX
# define SCNdFAST8 SCNd64
# elif INT_FAST8_MAX == 0x7fff
# define SCNdFAST8 "hd"
# elif INT_FAST8_MAX == 0x7f
# define SCNdFAST8 "hhd"
# else
# define SCNdFAST8 "d"
# endif
#endif
#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@
# undef SCNiFAST8
# if INT_FAST8_MAX > INT32_MAX
# define SCNiFAST8 SCNi64
# elif INT_FAST8_MAX == 0x7fff
# define SCNiFAST8 "hi"
# elif INT_FAST8_MAX == 0x7f
# define SCNiFAST8 "hhi"
# else
# define SCNiFAST8 "i"
# endif
#endif
#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@
# undef SCNoFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define SCNoFAST8 SCNo64
# elif UINT_FAST8_MAX == 0xffff
# define SCNoFAST8 "ho"
# elif UINT_FAST8_MAX == 0xff
# define SCNoFAST8 "hho"
# else
# define SCNoFAST8 "o"
# endif
#endif
#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@
# undef SCNuFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define SCNuFAST8 SCNu64
# elif UINT_FAST8_MAX == 0xffff
# define SCNuFAST8 "hu"
# elif UINT_FAST8_MAX == 0xff
# define SCNuFAST8 "hhu"
# else
# define SCNuFAST8 "u"
# endif
#endif
#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@
# undef SCNxFAST8
# if UINT_FAST8_MAX > UINT32_MAX
# define SCNxFAST8 SCNx64
# elif UINT_FAST8_MAX == 0xffff
# define SCNxFAST8 "hx"
# elif UINT_FAST8_MAX == 0xff
# define SCNxFAST8 "hhx"
# else
# define SCNxFAST8 "x"
# endif
#endif
#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@
# undef SCNdFAST16
# if INT_FAST16_MAX > INT32_MAX
# define SCNdFAST16 SCNd64
# elif INT_FAST16_MAX == 0x7fff
# define SCNdFAST16 "hd"
# else
# define SCNdFAST16 "d"
# endif
#endif
#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@
# undef SCNiFAST16
# if INT_FAST16_MAX > INT32_MAX
# define SCNiFAST16 SCNi64
# elif INT_FAST16_MAX == 0x7fff
# define SCNiFAST16 "hi"
# else
# define SCNiFAST16 "i"
# endif
#endif
#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@
# undef SCNoFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define SCNoFAST16 SCNo64
# elif UINT_FAST16_MAX == 0xffff
# define SCNoFAST16 "ho"
# else
# define SCNoFAST16 "o"
# endif
#endif
#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@
# undef SCNuFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define SCNuFAST16 SCNu64
# elif UINT_FAST16_MAX == 0xffff
# define SCNuFAST16 "hu"
# else
# define SCNuFAST16 "u"
# endif
#endif
#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@
# undef SCNxFAST16
# if UINT_FAST16_MAX > UINT32_MAX
# define SCNxFAST16 SCNx64
# elif UINT_FAST16_MAX == 0xffff
# define SCNxFAST16 "hx"
# else
# define SCNxFAST16 "x"
# endif
#endif
#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@
# undef SCNdFAST32
# if INT_FAST32_MAX > INT32_MAX
# define SCNdFAST32 SCNd64
# else
# define SCNdFAST32 "d"
# endif
#endif
#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@
# undef SCNiFAST32
# if INT_FAST32_MAX > INT32_MAX
# define SCNiFAST32 SCNi64
# else
# define SCNiFAST32 "i"
# endif
#endif
#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
# undef SCNoFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define SCNoFAST32 SCNo64
# else
# define SCNoFAST32 "o"
# endif
#endif
#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@
# undef SCNuFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define SCNuFAST32 SCNu64
# else
# define SCNuFAST32 "u"
# endif
#endif
#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
# undef SCNxFAST32
# if UINT_FAST32_MAX > UINT32_MAX
# define SCNxFAST32 SCNx64
# else
# define SCNxFAST32 "x"
# endif
#endif
#ifdef INT64_MAX
# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
# undef SCNdFAST64
# define SCNdFAST64 SCNd64
# endif
# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
# undef SCNiFAST64
# define SCNiFAST64 SCNi64
# endif
#endif
#ifdef UINT64_MAX
# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
# undef SCNoFAST64
# define SCNoFAST64 SCNo64
# endif
# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
# undef SCNuFAST64
# define SCNuFAST64 SCNu64
# endif
# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
# undef SCNxFAST64
# define SCNxFAST64 SCNx64
# endif
#endif
#if !defined SCNdMAX || @PRI_MACROS_BROKEN@
# undef SCNdMAX
# if @INT32_MAX_LT_INTMAX_MAX@
# define SCNdMAX SCNd64
# else
# define SCNdMAX "ld"
# endif
#endif
#if !defined SCNiMAX || @PRI_MACROS_BROKEN@
# undef SCNiMAX
# if @INT32_MAX_LT_INTMAX_MAX@
# define SCNiMAX SCNi64
# else
# define SCNiMAX "li"
# endif
#endif
#if !defined SCNoMAX || @PRI_MACROS_BROKEN@
# undef SCNoMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define SCNoMAX SCNo64
# else
# define SCNoMAX "lo"
# endif
#endif
#if !defined SCNuMAX || @PRI_MACROS_BROKEN@
# undef SCNuMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define SCNuMAX SCNu64
# else
# define SCNuMAX "lu"
# endif
#endif
#if !defined SCNxMAX || @PRI_MACROS_BROKEN@
# undef SCNxMAX
# if @UINT32_MAX_LT_UINTMAX_MAX@
# define SCNxMAX SCNx64
# else
# define SCNxMAX "lx"
# endif
#endif
#if !defined SCNdPTR || @PRI_MACROS_BROKEN@
# undef SCNdPTR
# ifdef INTPTR_MAX
# define SCNdPTR @PRIPTR_PREFIX@ "d"
# endif
#endif
#if !defined SCNiPTR || @PRI_MACROS_BROKEN@
# undef SCNiPTR
# ifdef INTPTR_MAX
# define SCNiPTR @PRIPTR_PREFIX@ "i"
# endif
#endif
#if !defined SCNoPTR || @PRI_MACROS_BROKEN@
# undef SCNoPTR
# ifdef UINTPTR_MAX
# define SCNoPTR @PRIPTR_PREFIX@ "o"
# endif
#endif
#if !defined SCNuPTR || @PRI_MACROS_BROKEN@
# undef SCNuPTR
# ifdef UINTPTR_MAX
# define SCNuPTR @PRIPTR_PREFIX@ "u"
# endif
#endif
#if !defined SCNxPTR || @PRI_MACROS_BROKEN@
# undef SCNxPTR
# ifdef UINTPTR_MAX
# define SCNxPTR @PRIPTR_PREFIX@ "x"
# endif
#endif
/* 7.8.2 Functions for greatest-width integer types */
#ifdef __cplusplus
extern "C" {
#endif
#if @GNULIB_IMAXABS@
# if !@HAVE_DECL_IMAXABS@
extern intmax_t imaxabs (intmax_t);
# endif
#elif defined GNULIB_POSIXCHECK
# undef imaxabs
# if HAVE_RAW_DECL_IMAXABS
_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
"use gnulib module imaxabs for portability");
# endif
#endif
#if @GNULIB_IMAXDIV@
# if !@HAVE_IMAXDIV_T@
# if !GNULIB_defined_imaxdiv_t
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
# define GNULIB_defined_imaxdiv_t 1
# endif
# endif
# if !@HAVE_DECL_IMAXDIV@
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
# endif
#elif defined GNULIB_POSIXCHECK
# undef imaxdiv
# if HAVE_RAW_DECL_IMAXDIV
_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
"use gnulib module imaxdiv for portability");
# endif
#endif
#if @GNULIB_STRTOIMAX@
# if @REPLACE_STRTOIMAX@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef strtoimax
# define strtoimax rpl_strtoimax
# endif
_GL_FUNCDECL_RPL (strtoimax, intmax_t,
(const char *restrict, char **restrict, int)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoimax, intmax_t,
(const char *restrict, char **restrict, int));
# else
# if !@HAVE_DECL_STRTOIMAX@
# undef strtoimax
_GL_FUNCDECL_SYS (strtoimax, intmax_t,
(const char *restrict, char **restrict, int)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoimax, intmax_t,
(const char *restrict, char **restrict, int));
# endif
_GL_CXXALIASWARN (strtoimax);
#elif defined GNULIB_POSIXCHECK
# undef strtoimax
# if HAVE_RAW_DECL_STRTOIMAX
_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
"use gnulib module strtoimax for portability");
# endif
#endif
#if @GNULIB_STRTOUMAX@
# if @REPLACE_STRTOUMAX@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef strtoumax
# define strtoumax rpl_strtoumax
# endif
_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int));
# else
# if !@HAVE_DECL_STRTOUMAX@
# undef strtoumax
_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
(const char *restrict, char **restrict, int));
# endif
_GL_CXXALIASWARN (strtoumax);
#elif defined GNULIB_POSIXCHECK
# undef strtoumax
# if HAVE_RAW_DECL_STRTOUMAX
_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - "
"use gnulib module strtoumax for portability");
# endif
#endif
/* Don't bother defining or declaring wcstoimax and wcstoumax, since
wide-character functions like this are hardly ever useful. */
#ifdef __cplusplus
}
#endif
#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */
libntlm-1.6/gl/tests/test-init.sh 0000755 0000000 0000000 00000004634 13635703245 013752 0000000 0000000 #!/bin/sh
# Unit tests for init.sh
# Copyright (C) 2011-2020 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see . */
: ${srcdir=.}
. "$srcdir/init.sh"; path_prepend_ .
fail=0
test_compare()
{
touch empty || fail=1
echo xyz > in || fail=1
compare /dev/null /dev/null >out 2>err || fail=1
test -s out && fail_ "out not empty: $(cat out)"
# "err" should be empty, too, but has "set -x" output when VERBOSE=yes
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
compare /dev/null empty >out 2>err || fail=1
test -s out && fail_ "out not empty: $(cat out)"
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
compare in in >out 2>err || fail=1
test -s out && fail_ "out not empty: $(cat out)"
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
compare /dev/null in >out 2>err && fail=1
cat <<\EOF > exp
diff -u /dev/null in
--- /dev/null 1970-01-01
+++ in 1970-01-01
+xyz
EOF
compare exp out || fail=1
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
compare empty in >out 2>err && fail=1
# Compare against expected output only if compare is using diff -u.
if grep @ out >/dev/null; then
# Remove the TAB-date suffix on each --- and +++ line,
# for both the expected and the actual output files.
# Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ:
# -@@ -0,0 +1 @@
# +@@ -1,0 +1,1 @@
# Also, remove space after leading '+', since AIX 7.1 diff outputs a space.
sed 's/ .*//;/^@@/d;s/^+ /+/' out > k && mv k out
cat <<\EOF > exp
--- empty
+++ in
+xyz
EOF
compare exp out || fail=1
fi
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
}
test_compare
Exit $fail
libntlm-1.6/gl/tests/arg-nonnull.h 0000644 0000000 0000000 00000002301 13635703245 014065 0000000 0000000 /* A C macro for declaring that specific arguments must not be NULL.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
that the values passed as arguments n, ..., m must be non-NULL pointers.
n = 1 stands for the first argument, n = 2 for the second argument etc. */
#ifndef _GL_ARG_NONNULL
# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
# else
# define _GL_ARG_NONNULL(params)
# endif
#endif
libntlm-1.6/gl/tests/test-verify-try.c 0000644 0000000 0000000 00000001620 13635703245 014724 0000000 0000000 /* Test the "verify" module.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* This is a separate source file, so that the execution of test-verify.sh
does not interfere with the building of the 'test-verify' program. */
#include "test-verify.c"
libntlm-1.6/gl/tests/c++defs.h 0000644 0000000 0000000 00000033664 13635703245 013063 0000000 0000000 /* C++ compatible function declaration macros.
Copyright (C) 2010-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
#ifndef _GL_CXXDEFS_H
#define _GL_CXXDEFS_H
/* Begin/end the GNULIB_NAMESPACE namespace. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
# define _GL_END_NAMESPACE }
#else
# define _GL_BEGIN_NAMESPACE
# define _GL_END_NAMESPACE
#endif
/* The three most frequent use cases of these macros are:
* For providing a substitute for a function that is missing on some
platforms, but is declared and works fine on the platforms on which
it exists:
#if @GNULIB_FOO@
# if !@HAVE_FOO@
_GL_FUNCDECL_SYS (foo, ...);
# endif
_GL_CXXALIAS_SYS (foo, ...);
_GL_CXXALIASWARN (foo);
#elif defined GNULIB_POSIXCHECK
...
#endif
* For providing a replacement for a function that exists on all platforms,
but is broken/insufficient and needs to be replaced on some platforms:
#if @GNULIB_FOO@
# if @REPLACE_FOO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef foo
# define foo rpl_foo
# endif
_GL_FUNCDECL_RPL (foo, ...);
_GL_CXXALIAS_RPL (foo, ...);
# else
_GL_CXXALIAS_SYS (foo, ...);
# endif
_GL_CXXALIASWARN (foo);
#elif defined GNULIB_POSIXCHECK
...
#endif
* For providing a replacement for a function that exists on some platforms
but is broken/insufficient and needs to be replaced on some of them and
is additionally either missing or undeclared on some other platforms:
#if @GNULIB_FOO@
# if @REPLACE_FOO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef foo
# define foo rpl_foo
# endif
_GL_FUNCDECL_RPL (foo, ...);
_GL_CXXALIAS_RPL (foo, ...);
# else
# if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
_GL_FUNCDECL_SYS (foo, ...);
# endif
_GL_CXXALIAS_SYS (foo, ...);
# endif
_GL_CXXALIASWARN (foo);
#elif defined GNULIB_POSIXCHECK
...
#endif
*/
/* _GL_EXTERN_C declaration;
performs the declaration with C linkage. */
#if defined __cplusplus
# define _GL_EXTERN_C extern "C"
#else
# define _GL_EXTERN_C extern
#endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
_GL_ARG_NONNULL ((1)));
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype rpl_func parameters_and_attributes
/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
_GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
_GL_ARG_NONNULL ((1)));
*/
#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype func parameters_and_attributes
/* _GL_CXXALIAS_RPL (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
Example:
_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
Wrapping rpl_func in an object with an inline conversion operator
avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
actually used in the program. */
#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
_GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return ::rpl_func; \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
except that the C function rpl_func may have a slightly different
declaration. A cast is used to silence the "invalid conversion" error
that would otherwise occur. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return reinterpret_cast(::rpl_func); \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_SYS (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to the system provided function func, if GNULIB_NAMESPACE
is defined.
Example:
_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
Wrapping func in an object with an inline conversion operator
avoids a reference to func unless GNULIB_NAMESPACE::func is
actually used in the program. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return ::func; \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
is like _GL_CXXALIAS_SYS (func, rettype, parameters);
except that the C function func may have a slightly different declaration.
A cast is used to silence the "invalid conversion" error that would
otherwise occur. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return reinterpret_cast(::func); \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
is like _GL_CXXALIAS_SYS (func, rettype, parameters);
except that the C function is picked among a set of overloaded functions,
namely the one with rettype2 and parameters2. Two consecutive casts
are used to silence the "cannot find a match" and "invalid conversion"
errors that would otherwise occur. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
/* The outer cast must be a reinterpret_cast.
The inner cast: When the function is defined as a set of overloaded
functions, it works as a static_cast<>, choosing the designated variant.
When the function is defined as a single variant, it works as a
reinterpret_cast<>. The parenthesized cast syntax works both ways. */
# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return reinterpret_cast((rettype2 (*) parameters2)(::func)); \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIASWARN (func);
causes a warning to be emitted when ::func is used but not when
GNULIB_NAMESPACE::func is used. func must be defined without overloaded
variants. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIASWARN(func) \
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN_1(func,namespace) \
_GL_CXXALIASWARN_2 (func, namespace)
/* To work around GCC bug ,
we enable the warning only when not optimizing. */
# if !__OPTIMIZE__
# define _GL_CXXALIASWARN_2(func,namespace) \
_GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN_2(func,namespace) \
extern __typeof__ (func) func
# else
# define _GL_CXXALIASWARN_2(func,namespace) \
_GL_EXTERN_C int _gl_cxxalias_dummy
# endif
#else
# define _GL_CXXALIASWARN(func) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
causes a warning to be emitted when the given overloaded variant of ::func
is used but not when GNULIB_NAMESPACE::func is used. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
_GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
/* To work around GCC bug ,
we enable the warning only when not optimizing. */
# if !__OPTIMIZE__
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
_GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
# else
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
_GL_EXTERN_C int _gl_cxxalias_dummy
# endif
#else
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
#endif /* _GL_CXXDEFS_H */
libntlm-1.6/gl/tests/test-strverscmp.c 0000644 0000000 0000000 00000003560 13635703245 015021 0000000 0000000 /* Test of strverscmp() function.
Copyright (C) 2008-2020 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see . */
/* Written by Eric Blake , 2008. */
#include
#include
#include "signature.h"
SIGNATURE_CHECK (strverscmp, int, (const char *, const char *));
#include "macros.h"
int
main (void)
{
ASSERT (strverscmp ("", "") == 0);
ASSERT (strverscmp ("a", "a") == 0);
ASSERT (strverscmp ("a", "b") < 0);
ASSERT (strverscmp ("b", "a") > 0);
ASSERT (strverscmp ("000", "00") < 0);
ASSERT (strverscmp ("00", "000") > 0);
ASSERT (strverscmp ("a0", "a") > 0);
ASSERT (strverscmp ("00", "01") < 0);
ASSERT (strverscmp ("01", "010") < 0);
ASSERT (strverscmp ("010", "09") < 0);
ASSERT (strverscmp ("09", "0") < 0);
ASSERT (strverscmp ("9", "10") < 0);
ASSERT (strverscmp ("0a", "0") > 0);
/* From glibc bug 9913. */
{
static char const a[] = "B0075022800016.gbp.corp.com";
static char const b[] = "B007502280067.gbp.corp.com";
static char const c[] = "B007502357019.GBP.CORP.COM";
ASSERT (strverscmp (a, b) < 0);
ASSERT (strverscmp (b, c) < 0);
ASSERT (strverscmp (a, c) < 0);
ASSERT (strverscmp (b, a) > 0);
ASSERT (strverscmp (c, b) > 0);
ASSERT (strverscmp (c, a) > 0);
}
return 0;
}
libntlm-1.6/gl/tests/macros.h 0000644 0000000 0000000 00000006731 13635703245 013130 0000000 0000000 /* Common macros used by gnulib tests.
Copyright (C) 2006-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* This file contains macros that are used by many gnulib tests.
Put here only frequently used macros, say, used by 10 tests or more. */
#include
#include
#ifndef FALLTHROUGH
# if __GNUC__ < 7
# define FALLTHROUGH ((void) 0)
# else
# define FALLTHROUGH __attribute__ ((__fallthrough__))
# endif
#endif
/* Define ASSERT_STREAM before including this file if ASSERT must
target a stream other than stderr. */
#ifndef ASSERT_STREAM
# define ASSERT_STREAM stderr
#endif
/* ASSERT (condition);
verifies that the specified condition is fulfilled. If not, a message
is printed to ASSERT_STREAM if defined (defaulting to stderr if
undefined) and the program is terminated with an error code.
This macro has the following properties:
- The programmer specifies the expected condition, not the failure
condition. This simplifies thinking.
- The condition is tested always, regardless of compilation flags.
(Unlike the macro from .)
- On Unix platforms, the tester can debug the test program with a
debugger (provided core dumps are enabled: "ulimit -c unlimited").
- For the sake of platforms where no debugger is available (such as
some mingw systems), an error message is printed on the error
stream that includes the source location of the ASSERT invocation.
*/
#define ASSERT(expr) \
do \
{ \
if (!(expr)) \
{ \
fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n", \
__FILE__, __LINE__, #expr); \
fflush (ASSERT_STREAM); \
abort (); \
} \
} \
while (0)
/* SIZEOF (array)
returns the number of elements of an array. It works for arrays that are
declared outside functions and for local variables of array type. It does
*not* work for function parameters of array type, because they are actually
parameters of pointer type. */
#define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
/* STREQ (str1, str2)
Return true if two strings compare equal. */
#define STREQ(a, b) (strcmp (a, b) == 0)
/* Some numbers in the interval [0,1). */
extern const float randomf[1000];
extern const double randomd[1000];
extern const long double randoml[1000];
libntlm-1.6/gl/tests/test-wchar.c 0000644 0000000 0000000 00000002136 13635703245 013713 0000000 0000000 /* Test of substitute.
Copyright (C) 2007-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Bruno Haible , 2007. */
#include
#include
#include "verify.h"
/* Check that the types wchar_t and wint_t are defined. */
wchar_t a = 'c';
wint_t b = 'x';
/* Check that NULL can be passed through varargs as a pointer type,
per POSIX 2008. */
verify (sizeof NULL == sizeof (void *));
int
main (void)
{
return 0;
}
libntlm-1.6/gl/tests/test-byteswap.c 0000644 0000000 0000000 00000001726 13635703245 014451 0000000 0000000 /* Test of substitute.
Copyright (C) 2007-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Bruno Haible , 2007. */
#include
#include
#include "macros.h"
int
main ()
{
ASSERT (bswap_16 (0xABCD) == 0xCDAB);
ASSERT (bswap_32 (0xDEADBEEF) == 0xEFBEADDE);
return 0;
}
libntlm-1.6/gl/tests/test-intprops.c 0000644 0000000 0000000 00000050156 13635703245 014472 0000000 0000000 /* Test intprops.h.
Copyright (C) 2011-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Paul Eggert. */
/* Tell gcc not to warn about the long expressions that the overflow
macros expand to, or about the (X < 0) expressions. */
#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
# pragma GCC diagnostic ignored "-Woverlength-strings"
# pragma GCC diagnostic ignored "-Wtype-limits"
/* Work around a bug in GCC 6.1 and earlier; see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 */
# pragma GCC diagnostic ignored "-Woverflow"
#endif
#include
#include "intprops.h"
#include "verify.h"
#include
#include
#include
#include "macros.h"
/* Compile-time verification of expression X.
In this file, we need it as a statement, rather than as a declaration. */
#define verify_stmt(x) do { verify (x); } while (0)
/* VERIFY (X) uses a static assertion for compilers that are known to work,
and falls back on a dynamic assertion for other compilers.
These tests should be checkable via 'verify' rather than 'ASSERT', but
using 'verify' would run into a bug with HP-UX 11.23 cc; see
. */
#if __GNUC__ || __SUNPRO_C
# define VERIFY(x) verify_stmt (x)
#else
# define VERIFY(x) ASSERT (x)
#endif
#define DONTCARE __LINE__
int int_minus_2 = -2;
int int_1 = 1;
int
main (void)
{
/* Use VERIFY for tests that must be integer constant expressions,
ASSERT otherwise. */
/* TYPE_IS_INTEGER. */
ASSERT (TYPE_IS_INTEGER (bool));
ASSERT (TYPE_IS_INTEGER (char));
ASSERT (TYPE_IS_INTEGER (signed char));
ASSERT (TYPE_IS_INTEGER (unsigned char));
ASSERT (TYPE_IS_INTEGER (short int));
ASSERT (TYPE_IS_INTEGER (unsigned short int));
ASSERT (TYPE_IS_INTEGER (int));
ASSERT (TYPE_IS_INTEGER (unsigned int));
ASSERT (TYPE_IS_INTEGER (long int));
ASSERT (TYPE_IS_INTEGER (unsigned long int));
ASSERT (TYPE_IS_INTEGER (intmax_t));
ASSERT (TYPE_IS_INTEGER (uintmax_t));
ASSERT (! TYPE_IS_INTEGER (float));
ASSERT (! TYPE_IS_INTEGER (double));
ASSERT (! TYPE_IS_INTEGER (long double));
/* TYPE_SIGNED. */
/* VERIFY (! TYPE_SIGNED (bool)); // not guaranteed by gnulib substitute */
VERIFY (TYPE_SIGNED (signed char));
VERIFY (! TYPE_SIGNED (unsigned char));
VERIFY (TYPE_SIGNED (short int));
VERIFY (! TYPE_SIGNED (unsigned short int));
VERIFY (TYPE_SIGNED (int));
VERIFY (! TYPE_SIGNED (unsigned int));
VERIFY (TYPE_SIGNED (long int));
VERIFY (! TYPE_SIGNED (unsigned long int));
VERIFY (TYPE_SIGNED (intmax_t));
VERIFY (! TYPE_SIGNED (uintmax_t));
ASSERT (TYPE_SIGNED (float));
ASSERT (TYPE_SIGNED (double));
ASSERT (TYPE_SIGNED (long double));
/* Integer representation. Check that it is two's complement. */
VERIFY (INT_MIN + INT_MAX < 0);
/* TYPE_MINIMUM, TYPE_MAXIMUM. */
VERIFY (TYPE_MINIMUM (char) == CHAR_MIN);
VERIFY (TYPE_MAXIMUM (char) == CHAR_MAX);
VERIFY (TYPE_MINIMUM (unsigned char) == 0);
VERIFY (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
VERIFY (TYPE_MINIMUM (signed char) == SCHAR_MIN);
VERIFY (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
VERIFY (TYPE_MINIMUM (short int) == SHRT_MIN);
VERIFY (TYPE_MAXIMUM (short int) == SHRT_MAX);
VERIFY (TYPE_MINIMUM (unsigned short int) == 0);
VERIFY (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
VERIFY (TYPE_MINIMUM (int) == INT_MIN);
VERIFY (TYPE_MAXIMUM (int) == INT_MAX);
VERIFY (TYPE_MINIMUM (unsigned int) == 0);
VERIFY (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
VERIFY (TYPE_MINIMUM (long int) == LONG_MIN);
VERIFY (TYPE_MAXIMUM (long int) == LONG_MAX);
VERIFY (TYPE_MINIMUM (unsigned long int) == 0);
VERIFY (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
#ifdef LLONG_MAX
verify_stmt (TYPE_MINIMUM (long long int) == LLONG_MIN);
verify_stmt (TYPE_MAXIMUM (long long int) == LLONG_MAX);
verify_stmt (TYPE_MINIMUM (unsigned long long int) == 0);
verify_stmt (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
#endif
VERIFY (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
VERIFY (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
VERIFY (TYPE_MINIMUM (uintmax_t) == 0);
VERIFY (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
/* TYPE_WIDTH. */
#ifdef CHAR_WIDTH
verify_stmt (TYPE_WIDTH (char) == CHAR_WIDTH);
verify_stmt (TYPE_WIDTH (signed char) == SCHAR_WIDTH);
verify_stmt (TYPE_WIDTH (unsigned char) == UCHAR_WIDTH);
verify_stmt (TYPE_WIDTH (short int) == SHRT_WIDTH);
verify_stmt (TYPE_WIDTH (unsigned short int) == USHRT_WIDTH);
verify_stmt (TYPE_WIDTH (int) == INT_WIDTH);
verify_stmt (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
verify_stmt (TYPE_WIDTH (long int) == LONG_WIDTH);
verify_stmt (TYPE_WIDTH (unsigned long int) == ULONG_WIDTH);
#ifdef LLONG_WIDTH
verify_stmt (TYPE_WIDTH (long long int) == LLONG_WIDTH);
verify_stmt (TYPE_WIDTH (unsigned long long int) == ULLONG_WIDTH);
#endif
#endif
/* INT_BITS_STRLEN_BOUND. */
VERIFY (INT_BITS_STRLEN_BOUND (1) == 1);
VERIFY (INT_BITS_STRLEN_BOUND (2620) == 789);
/* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND. */
#ifdef INT32_MAX /* POSIX guarantees int32_t; this ports to non-POSIX. */
VERIFY (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1);
VERIFY (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648"));
#endif
#ifdef INT64_MAX
VERIFY (INT_STRLEN_BOUND (int64_t) == sizeof ("-9223372036854775808") - 1);
VERIFY (INT_BUFSIZE_BOUND (int64_t) == sizeof ("-9223372036854775808"));
#endif
/* All the INT__RANGE_OVERFLOW tests are equally valid as
INT__OVERFLOW tests, so define macros to do both. OP is the
operation, OPNAME its symbolic name, A and B its operands, T the
result type, V the overflow flag, and VRES the result if V and if
two's complement. CHECK_BINOP is for most binary operatinos,
CHECK_SBINOP for binary +, -, * when the result type is signed,
and CHECK_UNOP for unary operations. */
#define CHECK_BINOP(op, opname, a, b, t, v, vres) \
VERIFY (INT_##opname##_RANGE_OVERFLOW (a, b, TYPE_MINIMUM (t), \
TYPE_MAXIMUM (t)) \
== (v)); \
VERIFY (INT_##opname##_OVERFLOW (a, b) == (v))
#define CHECK_SBINOP(op, opname, a, b, t, v, vres) \
CHECK_BINOP(op, opname, a, b, t, v, vres); \
{ \
t result; \
ASSERT (INT_##opname##_WRAPV (a, b, &result) == (v)); \
ASSERT (result == ((v) ? (vres) : ((a) op (b)))); \
}
#define CHECK_UNOP(op, opname, a, t, v) \
VERIFY (INT_##opname##_RANGE_OVERFLOW (a, TYPE_MINIMUM (t), \
TYPE_MAXIMUM (t)) \
== (v)); \
VERIFY (INT_##opname##_OVERFLOW (a) == (v))
/* INT__RANGE_OVERFLOW, INT__OVERFLOW. */
VERIFY (INT_ADD_RANGE_OVERFLOW (INT_MAX, 1, INT_MIN, INT_MAX));
VERIFY (INT_ADD_OVERFLOW (INT_MAX, 1));
CHECK_SBINOP (+, ADD, INT_MAX, 1, int, true, INT_MIN);
CHECK_SBINOP (+, ADD, INT_MAX, -1, int, false, INT_MAX - 1);
CHECK_SBINOP (+, ADD, INT_MIN, 1, int, false, INT_MIN + 1);
CHECK_SBINOP (+, ADD, INT_MIN, -1, int, true, INT_MAX);
CHECK_BINOP (+, ADD, UINT_MAX, 1u, unsigned int, true, 0u);
CHECK_BINOP (+, ADD, 0u, 1u, unsigned int, false, 1u);
CHECK_SBINOP (-, SUBTRACT, INT_MAX, 1, int, false, INT_MAX - 1);
CHECK_SBINOP (-, SUBTRACT, INT_MAX, -1, int, true, INT_MIN);
CHECK_SBINOP (-, SUBTRACT, INT_MIN, 1, int, true, INT_MAX);
CHECK_SBINOP (-, SUBTRACT, INT_MIN, -1, int, false, INT_MIN - -1);
CHECK_BINOP (-, SUBTRACT, UINT_MAX, 1u, unsigned int, false, UINT_MAX - 1u);
CHECK_BINOP (-, SUBTRACT, 0u, 1u, unsigned int, true, 0u - 1u);
CHECK_UNOP (-, NEGATE, INT_MIN, int, true);
CHECK_UNOP (-, NEGATE, 0, int, false);
CHECK_UNOP (-, NEGATE, INT_MAX, int, false);
CHECK_UNOP (-, NEGATE, 0u, unsigned int, false);
CHECK_UNOP (-, NEGATE, 1u, unsigned int, true);
CHECK_UNOP (-, NEGATE, UINT_MAX, unsigned int, true);
CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MAX, int, true, 1);
CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MIN, int, true, INT_MIN);
CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MAX, int, true, INT_MIN);
CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0);
CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int,
INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
#if !defined __HP_cc
CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX,
long int, false, LONG_MIN - LONG_MIN % INT_MAX);
#endif
CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int,
INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
CHECK_BINOP (/, DIVIDE, INT_MAX, 1, int, false, INT_MAX);
CHECK_BINOP (/, DIVIDE, (unsigned int) INT_MIN, -1u, unsigned int,
false, INT_MIN / -1u);
CHECK_BINOP (%, REMAINDER, INT_MIN, -1, int, INT_NEGATE_OVERFLOW (INT_MIN), 0);
CHECK_BINOP (%, REMAINDER, INT_MAX, 1, int, false, 0);
CHECK_BINOP (%, REMAINDER, (unsigned int) INT_MIN, -1u, unsigned int,
false, INT_MIN % -1u);
CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX, 1, unsigned int, true, UINT_MAX << 1);
CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2 + 1, 1, unsigned int, true,
(UINT_MAX / 2 + 1) << 1);
CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2, 1, unsigned int, false,
(UINT_MAX / 2) << 1);
/* INT__OVERFLOW and INT__WRAPV with mixed types. */
#define CHECK_SUM(a, b, t, v, vres) \
CHECK_SUM1 (a, b, t, v, vres); \
CHECK_SUM1 (b, a, t, v, vres)
#define CHECK_SUM_WRAPV(a, b, t, v, vres, okres) \
CHECK_SUM_WRAPV1 (a, b, t, v, vres, okres); \
CHECK_SUM_WRAPV1 (b, a, t, v, vres, okres)
#define CHECK_SUM1(a, b, t, v, vres) \
VERIFY (INT_ADD_OVERFLOW (a, b) == (v)); \
CHECK_SUM_WRAPV1 (a, b, t, v, vres, (a) + (b))
#define CHECK_SUM_WRAPV1(a, b, t, v, vres, okres) \
{ \
t result; \
ASSERT (INT_ADD_WRAPV (a, b, &result) == (v)); \
ASSERT (result == ((v) ? (vres) : (okres))); \
}
CHECK_SUM (-1, LONG_MIN, long int, true, LONG_MAX);
CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE);
CHECK_SUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN,
INT_MIN == LONG_MIN ? INT_MAX : DONTCARE);
CHECK_SUM (0u, -1, unsigned int, true, 0u + -1);
CHECK_SUM (0u, 0, unsigned int, false, DONTCARE);
CHECK_SUM (0u, 1, unsigned int, false, DONTCARE);
CHECK_SUM (1, LONG_MAX, long int, true, LONG_MIN);
CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u);
CHECK_SUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX,
INT_MAX == LONG_MAX ? INT_MIN : DONTCARE);
CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX);
CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN);
CHECK_SUM_WRAPV (-1, 1u, int, false, DONTCARE, 0);
CHECK_SUM_WRAPV (-1, 1ul, int, false, DONTCARE, 0);
CHECK_SUM_WRAPV (-1l, 1u, int, false, DONTCARE, 0);
CHECK_SUM_WRAPV (-100, 1000u, int, false, DONTCARE, 900);
CHECK_SUM_WRAPV (INT_MIN, UINT_MAX, int, false, DONTCARE, INT_MAX);
CHECK_SUM_WRAPV (1u, INT_MAX, int, true, INT_MIN, DONTCARE);
CHECK_SUM_WRAPV (INT_MAX, 1, long int, LONG_MAX <= INT_MAX, INT_MIN,
INT_MAX + 1L);
CHECK_SUM_WRAPV (UINT_MAX, 1, long int, LONG_MAX <= UINT_MAX, 0,
UINT_MAX + 1L);
CHECK_SUM_WRAPV (INT_MAX, 1, unsigned long int, ULONG_MAX <= INT_MAX, 0,
INT_MAX + 1uL);
CHECK_SUM_WRAPV (UINT_MAX, 1, unsigned long int, ULONG_MAX <= UINT_MAX, 0,
UINT_MAX + 1uL);
{
long int result;
ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX));
ASSERT (INT_ADD_WRAPV (-1, INT_MIN, &result) == (INT_MIN == LONG_MIN));
}
#define CHECK_DIFFERENCE(a, b, t, v, vres) \
VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v))
#define CHECK_SDIFFERENCE(a, b, t, v, vres) \
CHECK_DIFFERENCE (a, b, t, v, vres); \
CHECK_SDIFFERENCE_WRAPV (a, b, t, v, vres)
#define CHECK_SDIFFERENCE_WRAPV(a, b, t, v, vres) \
{ \
t result; \
ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v)); \
ASSERT (result == ((v) ? (vres) : ((a) - (b)))); \
}
CHECK_DIFFERENCE (INT_MAX, 1u, unsigned int, UINT_MAX < INT_MAX - 1,
INT_MAX - 1u);
CHECK_DIFFERENCE (UINT_MAX, 1, unsigned int, false, UINT_MAX - 1);
CHECK_DIFFERENCE (0u, -1, unsigned int, false, 0u - -1);
CHECK_DIFFERENCE (UINT_MAX, -1, unsigned int, true, UINT_MAX - -1);
CHECK_DIFFERENCE (INT_MIN, 1u, unsigned int, true, INT_MIN - 1u);
CHECK_DIFFERENCE (-1, 0u, unsigned int, true, -1 - 0u);
CHECK_SDIFFERENCE (-1, INT_MIN, int, false, -1 - INT_MIN);
CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX);
CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN);
CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX);
CHECK_SDIFFERENCE_WRAPV (-1, 1u, int, false, DONTCARE);
CHECK_SDIFFERENCE_WRAPV (-1, 1ul, int, false, DONTCARE);
CHECK_SDIFFERENCE_WRAPV (-1l, 1u, int, false, DONTCARE);
CHECK_SDIFFERENCE_WRAPV (0u, INT_MAX, int, false, DONTCARE);
CHECK_SDIFFERENCE_WRAPV (1u, INT_MIN, int, true, 1u - INT_MIN);
{
long int result;
ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX));
ASSERT (INT_SUBTRACT_WRAPV (INT_MIN, 1, &result) == (INT_MAX == LONG_MAX));
}
#define CHECK_PRODUCT(a, b, t, v, vres) \
CHECK_PRODUCT1 (a, b, t, v, vres); \
CHECK_PRODUCT1 (b, a, t, v, vres)
#define CHECK_SPRODUCT(a, b, t, v, vres) \
CHECK_SPRODUCT1 (a, b, t, v, vres); \
CHECK_SPRODUCT1 (b, a, t, v, vres)
#define CHECK_SPRODUCT_WRAPV(a, b, t, v, vres) \
CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres); \
CHECK_SPRODUCT_WRAPV1 (b, a, t, v, vres)
#define CHECK_PRODUCT1(a, b, t, v, vres) \
VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v))
#define CHECK_SPRODUCT1(a, b, t, v, vres) \
CHECK_PRODUCT1 (a, b, t, v, vres); \
CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres)
#define CHECK_SPRODUCT_WRAPV1(a, b, t, v, vres) \
{ \
t result; \
ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v)); \
ASSERT (result == ((v) ? (vres) : ((a) * (b)))); \
}
CHECK_PRODUCT (-1, 1u, unsigned int, true, -1 * 1u);
CHECK_SPRODUCT (-1, INT_MIN, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
CHECK_PRODUCT (-1, UINT_MAX, unsigned int, true, -1 * UINT_MAX);
CHECK_SPRODUCT (-32768, LONG_MAX / -32768 - 1, long int, true, LONG_MIN);
CHECK_SPRODUCT (-12345, LONG_MAX / -12345, long int, false, DONTCARE);
CHECK_SPRODUCT (0, -1, int, false, DONTCARE);
CHECK_SPRODUCT (0, 0, int, false, DONTCARE);
CHECK_PRODUCT (0, 0u, unsigned int, false, DONTCARE);
CHECK_SPRODUCT (0, 1, int, false, DONTCARE);
CHECK_SPRODUCT (0, INT_MAX, int, false, DONTCARE);
CHECK_SPRODUCT (0, INT_MIN, int, false, DONTCARE);
CHECK_PRODUCT (0, UINT_MAX, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, -1, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, 0, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, 0u, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, 1, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, INT_MAX, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, INT_MIN, unsigned int, false, DONTCARE);
CHECK_PRODUCT (0u, UINT_MAX, unsigned int, false, DONTCARE);
CHECK_SPRODUCT (1, INT_MAX, int, false, DONTCARE);
CHECK_SPRODUCT (1, INT_MIN, int, false, DONTCARE);
CHECK_PRODUCT (1, UINT_MAX, unsigned int, false, DONTCARE);
CHECK_PRODUCT (1u, INT_MIN, unsigned int, true, 1u * INT_MIN);
CHECK_PRODUCT (1u, INT_MAX, unsigned int, UINT_MAX < INT_MAX, 1u * INT_MAX);
CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX);
CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true,
INT_MAX * ULONG_MAX);
#if !defined __HP_cc
CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN);
CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE);
#endif
CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX);
CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true,
INT_MIN * ULONG_MAX);
CHECK_SPRODUCT_WRAPV (-1, INT_MAX + 1u, int, false, DONTCARE);
CHECK_SPRODUCT_WRAPV (-1, 1u, int, false, DONTCARE);
CHECK_SPRODUCT (0, ULONG_MAX, int, false, DONTCARE);
CHECK_SPRODUCT (0u, LONG_MIN, int, false, DONTCARE);
{
long int result;
ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
== (LONG_MAX / INT_MAX < INT_MAX));
ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
|| result == INT_MAX * (long int) INT_MAX);
ASSERT (INT_MULTIPLY_WRAPV (INT_MIN, INT_MIN, &result)
|| result == INT_MIN * (long int) INT_MIN);
}
# ifdef LLONG_MAX
{
long long int result;
ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result)
== (LLONG_MAX / LONG_MAX < LONG_MAX));
ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result)
|| result == LONG_MAX * (long long int) LONG_MAX);
ASSERT (INT_MULTIPLY_WRAPV (LONG_MIN, LONG_MIN, &result)
|| result == LONG_MIN * (long long int) LONG_MIN);
}
# endif
/* Check for GCC bug 91450. */
{
unsigned long long result;
ASSERT (INT_MULTIPLY_WRAPV (int_minus_2, int_1, &result) && result == -2);
}
#define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v))
CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN);
CHECK_QUOTIENT (INT_MIN, UINT_MAX, false);
CHECK_QUOTIENT (INTMAX_MIN, UINTMAX_MAX, false);
CHECK_QUOTIENT (INTMAX_MIN, UINT_MAX, false);
CHECK_QUOTIENT (-11, 10u, true);
CHECK_QUOTIENT (-10, 10u, true);
CHECK_QUOTIENT (-9, 10u, false);
CHECK_QUOTIENT (11u, -10, true);
CHECK_QUOTIENT (10u, -10, true);
CHECK_QUOTIENT (9u, -10, false);
#define CHECK_REMAINDER(a, b, v) VERIFY (INT_REMAINDER_OVERFLOW (a, b) == (v))
CHECK_REMAINDER (INT_MIN, -1L, INT_MIN == LONG_MIN);
CHECK_REMAINDER (-1, UINT_MAX, true);
CHECK_REMAINDER ((intmax_t) -1, UINTMAX_MAX, true);
CHECK_REMAINDER (INTMAX_MIN, UINT_MAX,
(INTMAX_MAX < UINT_MAX
&& - (unsigned int) INTMAX_MIN % UINT_MAX != 0));
CHECK_REMAINDER (INT_MIN, ULONG_MAX, INT_MIN % ULONG_MAX != 1);
CHECK_REMAINDER (1u, -1, false);
CHECK_REMAINDER (37*39u, -39, false);
CHECK_REMAINDER (37*39u + 1, -39, true);
CHECK_REMAINDER (37*39u - 1, -39, true);
CHECK_REMAINDER (LONG_MAX, -INT_MAX, false);
return 0;
}
libntlm-1.6/gl/tests/test-verify.sh 0000755 0000000 0000000 00000001325 13340050227 014271 0000000 0000000 #!/bin/sh
. "${srcdir=.}/init.sh"
# We are not interested in triggering bugs in the compilers and tools
# (such as gcc 4.3.1 on openSUSE 11.0).
unset MALLOC_PERTURB_
# Rather than figure out how to invoke the compiler with the right
# include path ourselves, we let make do it:
(cd "$initial_cwd_" \
&& rm -f test-verify-try.o \
&& $MAKE test-verify-try.o >/dev/null 2>&1) \
|| skip_ "cannot compile error-free"
# Now, prove that we encounter all expected compilation failures:
: >out
: >err
for i in 1 2 3 4 5; do
(cd "$initial_cwd_"
rm -f test-verify-try.o
$MAKE CFLAGS=-DEXP_FAIL=$i test-verify-try.o) >>out 2>>err \
&& { warn_ "compiler didn't detect verification failure $i"; fail=1; }
done
Exit $fail
libntlm-1.6/gl/tests/test-des.c 0000644 0000000 0000000 00000014701 13635703245 013363 0000000 0000000 /*
* Copyright (C) 2005, 2007, 2010-2020 Free Software Foundation, Inc.
* Written by Simon Josefsson
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see . */
/* Adapted for gnulib by Simon Josefsson, based on Libgcrypt. */
#include
#include "des.h"
#include
#include
int
main (int argc, char *argv[])
{
/*
* DES Maintenance Test
*/
{
int i;
char key[8] = { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 };
char input[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
char result[8] = { 0x24, 0x6e, 0x9d, 0xb9, 0xc5, 0x50, 0x38, 0x1a };
char temp1[8], temp2[8], temp3[8];
gl_des_ctx des;
for (i = 0; i < 64; ++i)
{
gl_des_setkey (&des, key);
gl_des_ecb_encrypt (&des, input, temp1);
gl_des_ecb_encrypt (&des, temp1, temp2);
gl_des_setkey (&des, temp2);
gl_des_ecb_decrypt (&des, temp1, temp3);
memcpy (key, temp3, 8);
memcpy (input, temp1, 8);
}
if (memcmp (temp3, result, 8))
return 1;
}
/*
* Self made Triple-DES test (Does somebody know an official test?)
*/
{
int i;
char input[8] = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
char key1[8] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 };
char key2[8] = { 0x11, 0x22, 0x33, 0x44, 0xff, 0xaa, 0xcc, 0xdd };
char result[8] = { 0x7b, 0x38, 0x3b, 0x23, 0xa2, 0x7d, 0x26, 0xd3 };
gl_3des_ctx des3;
for (i = 0; i < 16; ++i)
{
gl_3des_set2keys (&des3, key1, key2);
gl_3des_ecb_encrypt (&des3, input, key1);
gl_3des_ecb_decrypt (&des3, input, key2);
gl_3des_set3keys (&des3, key1, input, key2);
gl_3des_ecb_encrypt (&des3, input, input);
}
if (memcmp (input, result, 8))
return 1;
}
/*
* More Triple-DES test. These are testvectors as used by SSLeay,
* thanks to Jeroen C. van Gelderen.
*/
{
struct
{
char key[24];
char plain[8];
char cipher[8];
} testdata[] =
{
{
{
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
{
0x95, 0xF8, 0xA5, 0xE5, 0xDD, 0x31, 0xD9, 0x00},
{
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
{
{
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
{
0x9D, 0x64, 0x55, 0x5A, 0x9A, 0x10, 0xB8, 0x52,},
{
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00}
},
{
{
0x38, 0x49, 0x67, 0x4C, 0x26, 0x02, 0x31, 0x9E,
0x38, 0x49, 0x67, 0x4C, 0x26, 0x02, 0x31, 0x9E,
0x38, 0x49, 0x67, 0x4C, 0x26, 0x02, 0x31, 0x9E},
{
0x51, 0x45, 0x4B, 0x58, 0x2D, 0xDF, 0x44, 0x0A},
{
0x71, 0x78, 0x87, 0x6E, 0x01, 0xF1, 0x9B, 0x2A}
},
{
{
0x04, 0xB9, 0x15, 0xBA, 0x43, 0xFE, 0xB5, 0xB6,
0x04, 0xB9, 0x15, 0xBA, 0x43, 0xFE, 0xB5, 0xB6,
0x04, 0xB9, 0x15, 0xBA, 0x43, 0xFE, 0xB5, 0xB6},
{
0x42, 0xFD, 0x44, 0x30, 0x59, 0x57, 0x7F, 0xA2},
{
0xAF, 0x37, 0xFB, 0x42, 0x1F, 0x8C, 0x40, 0x95}
},
{
{
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
{
0x73, 0x6F, 0x6D, 0x65, 0x64, 0x61, 0x74, 0x61},
{
0x3D, 0x12, 0x4F, 0xE2, 0x19, 0x8B, 0xA3, 0x18}
},
{
{
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
{
0x73, 0x6F, 0x6D, 0x65, 0x64, 0x61, 0x74, 0x61},
{
0xFB, 0xAB, 0xA1, 0xFF, 0x9D, 0x05, 0xE9, 0xB1}
},
{
{
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10},
{
0x73, 0x6F, 0x6D, 0x65, 0x64, 0x61, 0x74, 0x61},
{
0x18, 0xd7, 0x48, 0xe5, 0x63, 0x62, 0x05, 0x72}
},
{
{
0x03, 0x52, 0x02, 0x07, 0x67, 0x20, 0x82, 0x17,
0x86, 0x02, 0x87, 0x66, 0x59, 0x08, 0x21, 0x98,
0x64, 0x05, 0x6A, 0xBD, 0xFE, 0xA9, 0x34, 0x57},
{
0x73, 0x71, 0x75, 0x69, 0x67, 0x67, 0x6C, 0x65},
{
0xc0, 0x7d, 0x2a, 0x0f, 0xa5, 0x66, 0xfa, 0x30}
},
{
{
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02},
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{
0xe6, 0xe6, 0xdd, 0x5b, 0x7e, 0x72, 0x29, 0x74}
},
{
{
0x10, 0x46, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20,
0x91, 0x07, 0xD0, 0x15, 0x89, 0x19, 0x01, 0x01,
0x19, 0x07, 0x92, 0x10, 0x98, 0x1A, 0x01, 0x01},
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{
0xe1, 0xef, 0x62, 0xc3, 0x32, 0xfe, 0x82, 0x5b}
}
};
char result[8];
int i;
gl_3des_ctx des3;
for (i = 0; i < sizeof (testdata) / sizeof (*testdata); ++i)
{
gl_3des_set3keys (&des3, testdata[i].key,
testdata[i].key + 8, testdata[i].key + 16);
gl_3des_ecb_encrypt (&des3, testdata[i].plain, result);
if (memcmp (testdata[i].cipher, result, 8))
{
return 1;
}
gl_3des_ecb_decrypt (&des3, testdata[i].cipher, result);
if (memcmp (testdata[i].plain, result, 8))
{
return 1;
}
}
}
return 0;
}
libntlm-1.6/gl/tests/test-vc-list-files-git.sh 0000755 0000000 0000000 00000002655 13635703245 016252 0000000 0000000 #!/bin/sh
# Unit tests for vc-list-files
# Copyright (C) 2008-2020 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see . */
: ${srcdir=.}
. "$srcdir/init.sh"; path_prepend_ .
tmpdir=vc-git-$$
GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE
fail=1
mkdir $tmpdir && cd $tmpdir &&
# without git, skip the test
# The double use of 'exit' is needed for the reference to $? inside the trap.
{ ( git init -q ) > /dev/null 2>&1 \
|| skip_ "git not found in PATH"; } &&
mkdir d &&
touch d/a b c &&
git config user.email "you@example.com" &&
git config user.name "Your Name" &&
git add . > /dev/null &&
git commit -q -a -m log &&
printf '%s\n' b c d/a > expected &&
$BOURNE_SHELL "$abs_aux_dir/vc-list-files" > actual &&
compare expected actual &&
fail=0
Exit $fail
libntlm-1.6/gl/tests/init.sh 0000644 0000000 0000000 00000054754 13635703245 013002 0000000 0000000 # source this file; set up for tests
# Copyright (C) 2009-2020 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# Using this file in a test
# =========================
#
# The typical skeleton of a test looks like this:
#
# #!/bin/sh
# . "${srcdir=.}/init.sh"; path_prepend_ .
# Execute some commands.
# Note that these commands are executed in a subdirectory, therefore you
# need to prepend "../" to relative filenames in the build directory.
# Note that the "path_prepend_ ." is useful only if the body of your
# test invokes programs residing in the initial directory.
# For example, if the programs you want to test are in src/, and this test
# script is named tests/test-1, then you would use "path_prepend_ ../src",
# or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
# to all tests via automake's TESTS_ENVIRONMENT.
# Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
# Use the skip_ and fail_ functions to print a diagnostic and then exit
# with the corresponding exit code.
# Exit $?
# Executing a test that uses this file
# ====================================
#
# Running a single test:
# $ make check TESTS=test-foo.sh
#
# Running a single test, with verbose output:
# $ make check TESTS=test-foo.sh VERBOSE=yes
#
# Running a single test, keeping the temporary directory:
# $ make check TESTS=test-foo.sh KEEP=yes
#
# Running a single test, with single-stepping:
# 1. Go into a sub-shell:
# $ bash
# 2. Set relevant environment variables from TESTS_ENVIRONMENT in the
# Makefile:
# $ export srcdir=../../tests # this is an example
# 3. Execute the commands from the test, copy&pasting them one by one:
# $ . "$srcdir/init.sh"; path_prepend_ .
# ...
# 4. Finally
# $ exit
# =============================================================================
# Elementary diagnostics
ME_=`expr "./$0" : '.*/\(.*\)$'`
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
# contains only /bin. Note that ksh looks also at the FPATH variable,
# so we have to set that as well for the test.
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|| PATH_SEPARATOR=';'
}
fi
# We use a trap below for cleanup. This requires us to go through
# hoops to get the right exit status transported through the handler.
# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
# sh inside this function.
Exit () { set +e; (exit $1); exit $1; }
# Print warnings (e.g., about skipped and failed tests) to this file number.
# Override by defining to say, 9, in init.cfg, and putting say,
# export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2
# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file.
# This is useful when using automake's parallel tests mode, to print
# the reason for skip/failure to console, rather than to the .log files.
: ${stderr_fileno_=2}
# Note that correct expansion of "$*" depends on IFS starting with ' '.
# Always write the full diagnostic to stderr.
# When stderr_fileno_ is not 2, also emit the first line of the
# diagnostic to that file descriptor.
warn_ ()
{
# If IFS does not start with ' ', set it and emit the warning in a subshell.
case $IFS in
' '*) printf '%s\n' "$*" >&2
test $stderr_fileno_ = 2 \
|| { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
*) (IFS=' '; warn_ "$@");;
esac
}
fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
# =============================================================================
# Ensure the shell supports modern syntax.
# Sanitize this shell to POSIX mode, if possible.
DUALCASE=1; export DUALCASE
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
fi
# We require $(...) support unconditionally.
# We require that the printf built-in work correctly regarding octal escapes;
# this eliminates /bin/sh on AIX 7.2.
# We require non-surprising "local" semantics (this eliminates dash).
# This takes the admittedly draconian step of eliminating dash, because the
# assignment tab=$(printf '\t') works fine, yet preceding it with "local "
# transforms it into an assignment that sets the variable to the empty string.
# That is too counter-intuitive, and can lead to subtle run-time malfunction.
# The example below is less subtle in that with dash, it evokes the run-time
# exception "dash: 1: local: 1: bad variable name".
# We require a few additional shell features only when $EXEEXT is nonempty,
# in order to support automatic $EXEEXT emulation:
# - hyphen-containing alias names
# - we prefer to use ${var#...} substitution, rather than having
# to work around lack of support for that feature.
# The following code attempts to find a shell with support for these features.
# If the current shell passes the test, we're done. Otherwise, test other
# shells until we find one that passes. If one is found, re-exec it.
# If no acceptable shell is found, skip the current test.
#
# The "...set -x; P=1 true 2>err..." test is to disqualify any shell that
# emits "P=1" into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do.
#
# Use "9" to indicate success (rather than 0), in case some shell acts
# like Solaris 10's /bin/sh but exits successfully instead of with status 2.
# Eval this code in a subshell to determine a shell's suitability.
# 10 - passes all tests; ok to use
# 9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
# ? - not ok
gl_shell_test_script_='
test $(echo y) = y || exit 1
LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \
| LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \
|| exit 1
printf "\\351" 2>/dev/null \
| LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \
|| exit 1
f_local_() { local v=1; }; f_local_ || exit 1
f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_
score_=10
if test "$VERBOSE" = yes; then
test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9
fi
test -z "$EXEEXT" && exit $score_
shopt -s expand_aliases
alias a-b="echo zoo"
v=abx
test ${v%x} = ab \
&& test ${v#a} = bx \
&& test $(a-b) = zoo \
&& exit $score_
'
if test "x$1" = "x--no-reexec"; then
shift
else
# Assume a working shell. Export to subshells (setup_ needs this).
gl_set_x_corrupts_stderr_=false
export gl_set_x_corrupts_stderr_
# Record the first marginally acceptable shell.
marginal_=
# Search for a shell that meets our requirements.
for re_shell_ in __current__ "${CONFIG_SHELL:-no_shell}" \
/bin/sh bash dash zsh pdksh fail
do
test "$re_shell_" = no_shell && continue
# If we've made it all the way to the sentinel, "fail" without
# finding even a marginal shell, skip this test.
if test "$re_shell_" = fail; then
test -z "$marginal_" && skip_ failed to find an adequate shell
re_shell_=$marginal_
break
fi
# When testing the current shell, simply "eval" the test code.
# Otherwise, run it via $re_shell_ -c ...
if test "$re_shell_" = __current__; then
# 'eval'ing this code makes Solaris 10's /bin/sh exit with
# $? set to 2. It does not evaluate any of the code after the
# "unexpected" first '('. Thus, we must run it in a subshell.
( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
else
"$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
fi
st_=$?
# $re_shell_ works just fine. Use it.
if test $st_ = 10; then
gl_set_x_corrupts_stderr_=false
break
fi
# If this is our first marginally acceptable shell, remember it.
if test "$st_:$marginal_" = 9: ; then
marginal_="$re_shell_"
gl_set_x_corrupts_stderr_=true
fi
done
if test "$re_shell_" != __current__; then
# Found a usable shell. Preserve -v and -x.
case $- in
*v*x* | *x*v*) opts_=-vx ;;
*v*) opts_=-v ;;
*x*) opts_=-x ;;
*) opts_= ;;
esac
re_shell=$re_shell_
export re_shell
exec "$re_shell_" $opts_ "$0" --no-reexec "$@"
echo "$ME_: exec failed" 1>&2
exit 127
fi
fi
# =============================================================================
# Ensure the shell behaves reasonably.
# If this is bash, turn off all aliases.
test -n "$BASH_VERSION" && unalias -a
# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
# That is part of the shell-selection test above. Why use aliases rather
# than functions? Because support for hyphen-containing aliases is more
# widespread than that for hyphen-containing function names.
test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases
# =============================================================================
# Creating a temporary directory (needed by the core test framework)
# Create a temporary directory, much like mktemp -d does.
# Written by Jim Meyering.
#
# Usage: mktempd_ /tmp phoey.XXXXXXXXXX
#
# First, try to use the mktemp program.
# Failing that, we'll roll our own mktemp-like function:
# - try to get random bytes from /dev/urandom
# - failing that, generate output from a combination of quickly-varying
# sources and gzip. Ignore non-varying gzip header, and extract
# "random" bits from there.
# - given those bits, map to file-name bytes using tr, and try to create
# the desired directory.
# - make only $MAX_TRIES_ attempts
# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9.
rand_bytes_ ()
{
n_=$1
# Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first?
# But if they have openssl, they probably have mktemp, too.
chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
dev_rand_=/dev/urandom
if test -r "$dev_rand_"; then
# Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
| LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
return
fi
n_plus_50_=`expr $n_ + 50`
cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef'
data_=` (eval "$cmds_") 2>&1 | gzip `
# Ensure that $data_ has length at least 50+$n_
while :; do
len_=`echo "$data_"|wc -c`
test $n_plus_50_ -le $len_ && break;
data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip `
done
echo "$data_" \
| dd bs=1 skip=50 count=$n_ 2>/dev/null \
| LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
}
mktempd_ ()
{
case $# in
2);;
*) fail_ "Usage: mktempd_ DIR TEMPLATE";;
esac
destdir_=$1
template_=$2
MAX_TRIES_=4
# Disallow any trailing slash on specified destdir:
# it would subvert the post-mktemp "case"-based destdir test.
case $destdir_ in
/ | //) destdir_slash_=$destdir;;
*/) fail_ "invalid destination dir: remove trailing slash(es)";;
*) destdir_slash_=$destdir_/;;
esac
case $template_ in
*XXXX) ;;
*) fail_ \
"invalid template: $template_ (must have a suffix of at least 4 X's)";;
esac
# First, try to use mktemp.
d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
# The resulting name must be in the specified directory.
case $d in "$destdir_slash_"*) :;; *) false;; esac &&
# It must have created the directory.
test -d "$d" &&
# It must have 0700 permissions. Handle sticky "S" bits.
perms=`ls -dgo "$d" 2>/dev/null` &&
case $perms in drwx--[-S]---*) :;; *) false;; esac && {
echo "$d"
return
}
# If we reach this point, we'll have to create a directory manually.
# Get a copy of the template without its suffix of X's.
base_template_=`echo "$template_"|sed 's/XX*$//'`
# Calculate how many X's we've just removed.
template_length_=`echo "$template_" | wc -c`
nx_=`echo "$base_template_" | wc -c`
nx_=`expr $template_length_ - $nx_`
err_=
i_=1
while :; do
X_=`rand_bytes_ $nx_`
candidate_dir_="$destdir_slash_$base_template_$X_"
err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
&& { echo "$candidate_dir_"; return; }
test $MAX_TRIES_ -le $i_ && break;
i_=`expr $i_ + 1`
done
fail_ "$err_"
}
# =============================================================================
# Core test framework
# An arbitrary prefix to help distinguish test directories.
testdir_prefix_ () { printf gt; }
# Set up the environment for the test to run in.
setup_ ()
{
if test "$VERBOSE" = yes; then
# Test whether set -x may cause the selected shell to corrupt an
# application's stderr. Many do, including zsh-4.3.10 and the /bin/sh
# from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5.
# If enabling verbose output this way would cause trouble, simply
# issue a warning and refrain.
if $gl_set_x_corrupts_stderr_; then
warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr"
else
set -x
fi
fi
initial_cwd_=$PWD
# Create and enter the temporary directory.
pfx_=`testdir_prefix_`
test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
|| fail_ "failed to create temporary directory in $initial_cwd_"
cd "$test_dir_" || fail_ "failed to cd to temporary directory"
# Set variables srcdir, builddir, for the convenience of the test.
case $srcdir in
/* | ?:*) ;;
*) srcdir="../$srcdir" ;;
esac
builddir=".."
export srcdir builddir
# As autoconf-generated configure scripts do, ensure that IFS
# is defined initially, so that saving and restoring $IFS works.
gl_init_sh_nl_='
'
IFS=" "" $gl_init_sh_nl_"
# This trap statement, along with a trap on 0 below, ensure that the
# temporary directory, $test_dir_, is removed upon exit as well as
# upon receipt of any of the listed signals.
for sig_ in 1 2 3 13 15; do
eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
done
}
# This is a stub function that is run upon trap (upon regular exit and
# interrupt). Override it with a per-test function, e.g., to unmount
# a partition, or to undo any other global state changes.
cleanup_ () { :; }
# Run the user-overridable cleanup_ function, remove the temporary
# directory and exit with the incoming value of $?.
remove_tmp_ ()
{
__st=$?
cleanup_
if test "$KEEP" = yes; then
echo "Not removing temporary directory $test_dir_"
else
# cd out of the directory we're about to remove
cd "$initial_cwd_" || cd / || cd /tmp
chmod -R u+rwx "$test_dir_"
# If removal fails and exit status was to be 0, then change it to 1.
rm -rf "$test_dir_" || { test $__st = 0 && __st=1; }
fi
exit $__st
}
# =============================================================================
# Prepending directories to PATH
# Given a directory name, DIR, if every entry in it that matches *.exe
# contains only the specified bytes (see the case stmt below), then print
# a space-separated list of those names and return 0. Otherwise, don't
# print anything and return 1. Naming constraints apply also to DIR.
find_exe_basenames_ ()
{
feb_dir_=$1
feb_fail_=0
feb_result_=
feb_sp_=
for feb_file_ in $feb_dir_/*.exe; do
# If there was no *.exe file, or there existed a file named "*.exe" that
# was deleted between the above glob expansion and the existence test
# below, just skip it.
test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
&& continue
# Exempt [.exe, since we can't create a function by that name, yet
# we can't invoke [ by PATH search anyways due to shell builtins.
test "x$feb_file_" = "x$feb_dir_/[.exe" && continue
case $feb_file_ in
*[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
*) # Remove leading file name components as well as the .exe suffix.
feb_file_=${feb_file_##*/}
feb_file_=${feb_file_%.exe}
feb_result_="$feb_result_$feb_sp_$feb_file_";;
esac
feb_sp_=' '
done
test $feb_fail_ = 0 && printf %s "$feb_result_"
return $feb_fail_
}
# Consider the files in directory, $1.
# For each file name of the form PROG.exe, create an alias named
# PROG that simply invokes PROG.exe, then return 0. If any selected
# file name or the directory name, $1, contains an unexpected character,
# define no alias and return 1.
create_exe_shims_ ()
{
case $EXEEXT in
'') return 0 ;;
.exe) ;;
*) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;;
esac
base_names_=`find_exe_basenames_ $1` \
|| { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; }
if test -n "$base_names_"; then
for base_ in $base_names_; do
alias "$base_"="$base_$EXEEXT"
done
fi
return 0
}
# Use this function to prepend to PATH an absolute name for each
# specified, possibly-$initial_cwd_-relative, directory.
path_prepend_ ()
{
while test $# != 0; do
path_dir_=$1
case $path_dir_ in
'') fail_ "invalid path dir: '$1'";;
/* | ?:*) abs_path_dir_=$path_dir_;;
*) abs_path_dir_=$initial_cwd_/$path_dir_;;
esac
case $abs_path_dir_ in
*$PATH_SEPARATOR*) fail_ "invalid path dir: '$abs_path_dir_'";;
esac
PATH="$abs_path_dir_$PATH_SEPARATOR$PATH"
# Create an alias, FOO, for each FOO.exe in this directory.
create_exe_shims_ "$abs_path_dir_" \
|| fail_ "something failed (above): $abs_path_dir_"
shift
done
export PATH
}
# =============================================================================
# Convenience environment variables for the tests
# -----------------------------------------------------------------------------
# Enable glibc's malloc-perturbing option.
# This is useful for exposing code that depends on the fact that
# malloc-related functions often return memory that is mostly zeroed.
# If you have the time and cycles, use valgrind to do an even better job.
: ${MALLOC_PERTURB_=87}
export MALLOC_PERTURB_
# -----------------------------------------------------------------------------
# The interpreter for Bourne-shell scripts.
# No special standards compatibility requirements.
# Some environments, such as Android, don't have /bin/sh.
if test -f /bin/sh$EXEEXT; then
BOURNE_SHELL=/bin/sh
else
BOURNE_SHELL=sh
fi
# =============================================================================
# Convenience functions for the tests
# -----------------------------------------------------------------------------
# Return value checking
# This is used to simplify checking of the return value
# which is useful when ensuring a command fails as desired.
# I.e., just doing `command ... &&fail=1` will not catch
# a segfault in command for example. With this helper you
# instead check an explicit exit code like
# returns_ 1 command ... || fail
returns_ () {
# Disable tracing so it doesn't interfere with stderr of the wrapped command
{ set +x; } 2>/dev/null
local exp_exit="$1"
shift
"$@"
test $? -eq $exp_exit && ret_=0 || ret_=1
if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then
set -x
fi
{ return $ret_; } 2>/dev/null
}
# -----------------------------------------------------------------------------
# Text file comparison
# Emit a header similar to that from diff -u; Print the simulated "diff"
# command so that the order of arguments is clear. Don't bother with @@ lines.
emit_diff_u_header_ ()
{
printf '%s\n' "diff -u $*" \
"--- $1 1970-01-01" \
"+++ $2 1970-01-01"
}
# Arrange not to let diff or cmp operate on /dev/null,
# since on some systems (at least OSF/1 5.1), that doesn't work.
# When there are not two arguments, or no argument is /dev/null, return 2.
# When one argument is /dev/null and the other is not empty,
# cat the nonempty file to stderr and return 1.
# Otherwise, return 0.
compare_dev_null_ ()
{
test $# = 2 || return 2
if test "x$1" = x/dev/null; then
test -s "$2" || return 0
emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
return 1
fi
if test "x$2" = x/dev/null; then
test -s "$1" || return 0
emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
return 1
fi
return 2
}
for diff_opt_ in -u -U3 -c '' no; do
test "$diff_opt_" != no &&
diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` &&
break
done
if test "$diff_opt_" != no; then
if test -z "$diff_out_"; then
compare_ () { diff $diff_opt_ "$@"; }
else
compare_ ()
{
# If no differences were found, AIX and HP-UX 'diff' produce output
# like "No differences encountered". Hide this output.
diff $diff_opt_ "$@" > diff.out
diff_status_=$?
test $diff_status_ -eq 0 || cat diff.out || diff_status_=2
rm -f diff.out || diff_status_=2
return $diff_status_
}
fi
elif cmp -s /dev/null /dev/null 2>/dev/null; then
compare_ () { cmp -s "$@"; }
else
compare_ () { cmp "$@"; }
fi
# Usage: compare EXPECTED ACTUAL
#
# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
# Otherwise, propagate $? to caller: any diffs have already been printed.
compare ()
{
# This looks like it can be factored to use a simple "case $?"
# after unchecked compare_dev_null_ invocation, but that would
# fail in a "set -e" environment.
if compare_dev_null_ "$@"; then
return 0
else
case $? in
1) return 1;;
*) compare_ "$@";;
esac
fi
}
# -----------------------------------------------------------------------------
# If you want to override the testdir_prefix_ function,
# or to add more utility functions, use this file.
test -f "$srcdir/init.cfg" \
&& . "$srcdir/init.cfg"
# =============================================================================
# Set up the environment for the test to run in.
setup_ "$@"
# This trap is here, rather than in the setup_ function, because some
# shells run the exit trap at shell function exit, rather than script exit.
trap remove_tmp_ 0
libntlm-1.6/gl/tests/test-limits-h.c 0000644 0000000 0000000 00000007622 13635703245 014342 0000000 0000000 /* Test of substitute.
Copyright 2016-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
/* Written by Paul Eggert. */
#include
#include
#include "verify.h"
#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
# pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
#define verify_width(width, min, max) \
verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
/* Macros borrowed from intprops.h. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
#define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
? (t) -1 \
: ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
/* Type width macros. */
int type_bits[] =
{
CHAR_BIT,
WORD_BIT,
LONG_BIT
};
verify_width (CHAR_BIT, CHAR_MIN, CHAR_MAX);
verify_width (WORD_BIT, INT_MIN, INT_MAX);
verify_width (LONG_BIT, LONG_MIN, LONG_MAX);
/* Numerical limit macros. */
char limits1[] = { CHAR_MIN, CHAR_MAX };
verify (TYPE_MINIMUM (char) == CHAR_MIN);
verify (TYPE_MAXIMUM (char) == CHAR_MAX);
signed char limits2[] = { SCHAR_MIN, SCHAR_MAX };
verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
unsigned char limits3[] = { UCHAR_MAX };
verify (TYPE_MINIMUM (unsigned char) == 0);
verify (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
short limits4[] = { SHRT_MIN, SHRT_MAX };
verify (TYPE_MINIMUM (short int) == SHRT_MIN);
verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
unsigned short limits5[] = { USHRT_MAX };
verify (TYPE_MINIMUM (unsigned short int) == 0);
verify (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
int limits6[] = { INT_MIN, INT_MAX };
verify (TYPE_MINIMUM (int) == INT_MIN);
verify (TYPE_MAXIMUM (int) == INT_MAX);
unsigned int limits7[] = { UINT_MAX };
verify (TYPE_MINIMUM (unsigned int) == 0);
verify (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
long limits8[] = { LONG_MIN, LONG_MAX };
verify (TYPE_MINIMUM (long int) == LONG_MIN);
verify (TYPE_MAXIMUM (long int) == LONG_MAX);
unsigned long limits9[] = { ULONG_MAX };
verify (TYPE_MINIMUM (unsigned long int) == 0);
verify (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
long long limits10[] = { LLONG_MIN, LLONG_MAX };
verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
unsigned long long limits11[] = { ULLONG_MAX };
verify (TYPE_MINIMUM (unsigned long long int) == 0);
verify (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
/* Macros specified by ISO/IEC TS 18661-1:2014. */
verify_width (CHAR_WIDTH, CHAR_MIN, CHAR_MAX);
verify_width (SCHAR_WIDTH, SCHAR_MIN, SCHAR_MAX);
verify_width (UCHAR_WIDTH, 0, UCHAR_MAX);
verify_width (SHRT_WIDTH, SHRT_MIN, SHRT_MAX);
verify_width (USHRT_WIDTH, 0, USHRT_MAX);
verify_width (INT_WIDTH, INT_MIN, INT_MAX);
verify_width (UINT_WIDTH, 0, UINT_MAX);
verify_width (LONG_WIDTH, LONG_MIN, LONG_MAX);
verify_width (ULONG_WIDTH, 0, ULONG_MAX);
verify_width (LLONG_WIDTH, LLONG_MIN, LLONG_MAX);
verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
int
main (void)
{
return 0;
}
libntlm-1.6/gl/tests/test-update-copyright.sh 0000755 0000000 0000000 00000042715 13647001114 016266 0000000 0000000 #!/bin/sh
# Test suite for update-copyright.
# Copyright (C) 2009-2020 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
diffout=`diff -u /dev/null /dev/null 2>&1`
if test x"$diffout" = x"" && test $? -eq 0; then
compare() { diff -u "$@"; }
else
compare() { cmp "$@"; }
fi
# Ensure the update-copyright program gets found.
PATH=$abs_aux_dir:$PATH
export PATH
TMP_BASE=update-copyright.test
trap 'rm -f $TMP_BASE*' 0 1 2 3 15
## --------------------------------- ##
## Skip if user does not have perl. ##
## --------------------------------- ##
TMP=$TMP_BASE
s=$TMP-script
cat <<\EOF > $s
#!/bin/sh
#! -*-perl-*-
# This is a prologue that allows to run a perl script as an executable
# on systems that are compliant to a POSIX version before POSIX:2017.
# On such systems, the usual invocation of an executable through execlp()
# or execvp() fails with ENOEXEC if it is a script that does not start
# with a #! line. The script interpreter mentioned in the #! line has
# to be /bin/sh, because on GuixSD systems that is the only program that
# has a fixed file name. The second line is essential for perl and is
# also useful for editing this file in Emacs. The next two lines below
# are valid code in both sh and perl. When executed by sh, they re-execute
# the script through the perl program found in $PATH. The '-x' option
# is essential as well; without it, perl would re-execute the script
# through /bin/sh. When executed by perl, the next two lines are a no-op.
eval 'exec perl -wSx -pi "$0" "$@"'
if 0;
s/a/b/
EOF
chmod a+x $s
echo a > $TMP-in
./$s $TMP-in 2>/dev/null && test b = "`cat $TMP-in 2>/dev/null`" ||
{
printf '%s\n' "$0: skipping this test;" \
'your system has insufficient support for Perl' 1>&2
exit 77
}
# Skip this test if Perl is too old. FIXME: 5.8.0 is just a guess.
# We have a report that 5.6.1 is inadequate and that 5.8.0 works.
perl -e 'require 5.8.0' || {
echo '$0: skipping this test; Perl version is too old' 1>&2
exit 77
}
# Do not let a different envvar setting perturb results.
UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
export UPDATE_COPYRIGHT_MAX_LINE_LENGTH
## ----------------------------- ##
## Examples from documentation. ##
## ----------------------------- ##
TMP=$TMP_BASE-ex
cat > $TMP.1 < $TMP.2 < $TMP.3 < $TMP.4 < $TMP.5 < $TMP.6 < $TMP.7 < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP <<\EOF
Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
Rem 98, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
Rem 2009 Free Software Foundation, Inc.@
EOF
UPDATE_COPYRIGHT_YEAR=2010 \
update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
tr @ '\015' > $TMP-exp <<\EOF
Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
Rem 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
Rem 2009, 2010 Free Software Foundation, Inc.@
EOF
compare $TMP-exp $TMP || exit 1
rm $TMP*
## --------------- ##
## Omitted "(C)". ##
## --------------- ##
TMP=$TMP_BASE-omitted-circle-c
cat > $TMP < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP < $TMP.star < $TMP.space < $TMP.single-line < $TMP.single-line-wrapped < $TMP.extra-text-star < $TMP.extra-text-space < $TMP.two-digit-final-is-substr-of-first < $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare /dev/null $TMP-stderr || exit 1
compare - $TMP.star <