diff options
Diffstat (limited to 'lib')
46 files changed, 12280 insertions, 3494 deletions
@@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.7.5. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30705 -/* Bison version. */ -#define YYBISON_VERSION "3.3.2" +/* Bison version string. */ +#define YYBISON_VERSION "3.7.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,22 +63,22 @@ /* Pull parsers. */ #define YYPULL 1 - +/* Substitute the type names. */ +#define YYSTYPE _ASN1_YYSTYPE /* Substitute the variable and function names. */ #define yyparse _asn1_yyparse #define yylex _asn1_yylex #define yyerror _asn1_yyerror #define yydebug _asn1_yydebug #define yynerrs _asn1_yynerrs - #define yylval _asn1_yylval #define yychar _asn1_yychar /* First part of user prologue. */ -#line 1 "ASN1.y" /* yacc.c:337 */ +#line 1 "ASN1.y" /* - * Copyright (C) 2001-2014 Free Software Foundation, Inc. + * Copyright (C) 2001-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -108,6 +109,7 @@ #include <parser_aux.h> #include <structure.h> #include <libtasn1.h> +#include "c-ctype.h" static list_type *e_list = NULL; static FILE *file_asn1; /* Pointer to file to parse */ @@ -130,6 +132,9 @@ static const char *file_name; /* file to parse */ static void _asn1_yyerror (const char *); static int _asn1_yylex(void); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#define SAFE_COPY(dst, dst_size, fmt, ...) { snprintf(dst, dst_size, fmt, __VA_ARGS__); } +#else #define SAFE_COPY(dst, dst_size, fmt, ...) { \ int _ret = snprintf(dst, dst_size, fmt, __VA_ARGS__); \ if (_ret != (int)strlen(dst)) \ @@ -139,8 +144,19 @@ static int _asn1_yylex(void); exit(1); \ } \ } +#endif -#line 144 "ASN1.c" /* yacc.c:337 */ +#line 150 "ASN1.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast<Type> (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -153,77 +169,86 @@ static int _asn1_yylex(void); # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - /* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +#ifndef _ASN1_YYDEBUG +# if defined YYDEBUG #if YYDEBUG +# define _ASN1_YYDEBUG 1 +# else +# define _ASN1_YYDEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define _ASN1_YYDEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined _ASN1_YYDEBUG */ +#if _ASN1_YYDEBUG extern int _asn1_yydebug; #endif -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype +/* Token kinds. */ +#ifndef _ASN1_YYTOKENTYPE +# define _ASN1_YYTOKENTYPE + enum _asn1_yytokentype { - ASSIG = 258, - NUM = 259, - IDENTIFIER = 260, - OPTIONAL = 261, - INTEGER = 262, - SIZE = 263, - OCTET = 264, - STRING = 265, - SEQUENCE = 266, - BIT = 267, - UNIVERSAL = 268, - PRIVATE = 269, - APPLICATION = 270, - DEFAULT = 271, - CHOICE = 272, - OF = 273, - OBJECT = 274, - STR_IDENTIFIER = 275, - BOOLEAN = 276, - ASN1_TRUE = 277, - ASN1_FALSE = 278, - TOKEN_NULL = 279, - ANY = 280, - DEFINED = 281, - BY = 282, - SET = 283, - EXPLICIT = 284, - IMPLICIT = 285, - DEFINITIONS = 286, - TAGS = 287, - BEGIN = 288, - END = 289, - UTCTime = 290, - GeneralizedTime = 291, - GeneralString = 292, - NumericString = 293, - IA5String = 294, - TeletexString = 295, - PrintableString = 296, - UniversalString = 297, - BMPString = 298, - UTF8String = 299, - VisibleString = 300, - FROM = 301, - IMPORTS = 302, - ENUMERATED = 303 + _ASN1_YYEMPTY = -2, + _ASN1_YYEOF = 0, /* "end of file" */ + _ASN1_YYerror = 256, /* error */ + _ASN1_YYUNDEF = 257, /* "invalid token" */ + ASSIG = 258, /* "::=" */ + NUM = 259, /* NUM */ + IDENTIFIER = 260, /* IDENTIFIER */ + OPTIONAL = 261, /* OPTIONAL */ + INTEGER = 262, /* INTEGER */ + SIZE = 263, /* SIZE */ + OCTET = 264, /* OCTET */ + STRING = 265, /* STRING */ + SEQUENCE = 266, /* SEQUENCE */ + BIT = 267, /* BIT */ + UNIVERSAL = 268, /* UNIVERSAL */ + PRIVATE = 269, /* PRIVATE */ + APPLICATION = 270, /* APPLICATION */ + DEFAULT = 271, /* DEFAULT */ + CHOICE = 272, /* CHOICE */ + OF = 273, /* OF */ + OBJECT = 274, /* OBJECT */ + STR_IDENTIFIER = 275, /* STR_IDENTIFIER */ + BOOLEAN = 276, /* BOOLEAN */ + ASN1_TRUE = 277, /* ASN1_TRUE */ + ASN1_FALSE = 278, /* ASN1_FALSE */ + TOKEN_NULL = 279, /* TOKEN_NULL */ + ANY = 280, /* ANY */ + DEFINED = 281, /* DEFINED */ + BY = 282, /* BY */ + SET = 283, /* SET */ + EXPLICIT = 284, /* EXPLICIT */ + IMPLICIT = 285, /* IMPLICIT */ + DEFINITIONS = 286, /* DEFINITIONS */ + TAGS = 287, /* TAGS */ + BEGIN = 288, /* BEGIN */ + END = 289, /* END */ + UTCTime = 290, /* UTCTime */ + GeneralizedTime = 291, /* GeneralizedTime */ + GeneralString = 292, /* GeneralString */ + NumericString = 293, /* NumericString */ + IA5String = 294, /* IA5String */ + TeletexString = 295, /* TeletexString */ + PrintableString = 296, /* PrintableString */ + UniversalString = 297, /* UniversalString */ + BMPString = 298, /* BMPString */ + UTF8String = 299, /* UTF8String */ + VisibleString = 300, /* VisibleString */ + FROM = 301, /* FROM */ + IMPORTS = 302, /* IMPORTS */ + ENUMERATED = 303 /* ENUMERATED */ }; + typedef enum _asn1_yytokentype _asn1_yytoken_kind_t; #endif -/* Tokens. */ +/* Token kinds. */ +#define _ASN1_YYEMPTY -2 +#define _ASN1_YYEOF 0 +#define _ASN1_YYerror 256 +#define _ASN1_YYUNDEF 257 #define ASSIG 258 #define NUM 259 #define IDENTIFIER 260 @@ -272,30 +297,150 @@ extern int _asn1_yydebug; #define ENUMERATED 303 /* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE +#if ! defined _ASN1_YYSTYPE && ! defined _ASN1_YYSTYPE_IS_DECLARED +union _ASN1_YYSTYPE { -#line 72 "ASN1.y" /* yacc.c:352 */ +#line 77 "ASN1.y" unsigned int constant; char str[ASN1_MAX_NAME_SIZE+1]; asn1_node node; -#line 286 "ASN1.c" /* yacc.c:352 */ -}; +#line 310 "ASN1.c" -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 +}; +typedef union _ASN1_YYSTYPE _ASN1_YYSTYPE; +# define _ASN1_YYSTYPE_IS_TRIVIAL 1 +# define _ASN1_YYSTYPE_IS_DECLARED 1 #endif -extern YYSTYPE _asn1_yylval; +extern _ASN1_YYSTYPE _asn1_yylval; int _asn1_yyparse (void); +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_ASSIG = 3, /* "::=" */ + YYSYMBOL_NUM = 4, /* NUM */ + YYSYMBOL_IDENTIFIER = 5, /* IDENTIFIER */ + YYSYMBOL_OPTIONAL = 6, /* OPTIONAL */ + YYSYMBOL_INTEGER = 7, /* INTEGER */ + YYSYMBOL_SIZE = 8, /* SIZE */ + YYSYMBOL_OCTET = 9, /* OCTET */ + YYSYMBOL_STRING = 10, /* STRING */ + YYSYMBOL_SEQUENCE = 11, /* SEQUENCE */ + YYSYMBOL_BIT = 12, /* BIT */ + YYSYMBOL_UNIVERSAL = 13, /* UNIVERSAL */ + YYSYMBOL_PRIVATE = 14, /* PRIVATE */ + YYSYMBOL_APPLICATION = 15, /* APPLICATION */ + YYSYMBOL_DEFAULT = 16, /* DEFAULT */ + YYSYMBOL_CHOICE = 17, /* CHOICE */ + YYSYMBOL_OF = 18, /* OF */ + YYSYMBOL_OBJECT = 19, /* OBJECT */ + YYSYMBOL_STR_IDENTIFIER = 20, /* STR_IDENTIFIER */ + YYSYMBOL_BOOLEAN = 21, /* BOOLEAN */ + YYSYMBOL_ASN1_TRUE = 22, /* ASN1_TRUE */ + YYSYMBOL_ASN1_FALSE = 23, /* ASN1_FALSE */ + YYSYMBOL_TOKEN_NULL = 24, /* TOKEN_NULL */ + YYSYMBOL_ANY = 25, /* ANY */ + YYSYMBOL_DEFINED = 26, /* DEFINED */ + YYSYMBOL_BY = 27, /* BY */ + YYSYMBOL_SET = 28, /* SET */ + YYSYMBOL_EXPLICIT = 29, /* EXPLICIT */ + YYSYMBOL_IMPLICIT = 30, /* IMPLICIT */ + YYSYMBOL_DEFINITIONS = 31, /* DEFINITIONS */ + YYSYMBOL_TAGS = 32, /* TAGS */ + YYSYMBOL_BEGIN = 33, /* BEGIN */ + YYSYMBOL_END = 34, /* END */ + YYSYMBOL_UTCTime = 35, /* UTCTime */ + YYSYMBOL_GeneralizedTime = 36, /* GeneralizedTime */ + YYSYMBOL_GeneralString = 37, /* GeneralString */ + YYSYMBOL_NumericString = 38, /* NumericString */ + YYSYMBOL_IA5String = 39, /* IA5String */ + YYSYMBOL_TeletexString = 40, /* TeletexString */ + YYSYMBOL_PrintableString = 41, /* PrintableString */ + YYSYMBOL_UniversalString = 42, /* UniversalString */ + YYSYMBOL_BMPString = 43, /* BMPString */ + YYSYMBOL_UTF8String = 44, /* UTF8String */ + YYSYMBOL_VisibleString = 45, /* VisibleString */ + YYSYMBOL_FROM = 46, /* FROM */ + YYSYMBOL_IMPORTS = 47, /* IMPORTS */ + YYSYMBOL_ENUMERATED = 48, /* ENUMERATED */ + YYSYMBOL_49_ = 49, /* '+' */ + YYSYMBOL_50_ = 50, /* '-' */ + YYSYMBOL_51_ = 51, /* '(' */ + YYSYMBOL_52_ = 52, /* ')' */ + YYSYMBOL_53_ = 53, /* ',' */ + YYSYMBOL_54_ = 54, /* '[' */ + YYSYMBOL_55_ = 55, /* ']' */ + YYSYMBOL_56_ = 56, /* '|' */ + YYSYMBOL_57_ = 57, /* '{' */ + YYSYMBOL_58_ = 58, /* '}' */ + YYSYMBOL_59_ = 59, /* '.' */ + YYSYMBOL_YYACCEPT = 60, /* $accept */ + YYSYMBOL_definitions = 61, /* definitions */ + YYSYMBOL_pos_num = 62, /* pos_num */ + YYSYMBOL_neg_num = 63, /* neg_num */ + YYSYMBOL_pos_neg_num = 64, /* pos_neg_num */ + YYSYMBOL_num_identifier = 65, /* num_identifier */ + YYSYMBOL_int_identifier = 66, /* int_identifier */ + YYSYMBOL_pos_neg_identifier = 67, /* pos_neg_identifier */ + YYSYMBOL_constant = 68, /* constant */ + YYSYMBOL_constant_list = 69, /* constant_list */ + YYSYMBOL_obj_constant = 70, /* obj_constant */ + YYSYMBOL_obj_constant_list = 71, /* obj_constant_list */ + YYSYMBOL_class = 72, /* class */ + YYSYMBOL_tag_type = 73, /* tag_type */ + YYSYMBOL_tag = 74, /* tag */ + YYSYMBOL_default = 75, /* default */ + YYSYMBOL_pos_neg_list = 76, /* pos_neg_list */ + YYSYMBOL_integer_def = 77, /* integer_def */ + YYSYMBOL_boolean_def = 78, /* boolean_def */ + YYSYMBOL_Time = 79, /* Time */ + YYSYMBOL_size_def2 = 80, /* size_def2 */ + YYSYMBOL_size_def = 81, /* size_def */ + YYSYMBOL_generalstring_def = 82, /* generalstring_def */ + YYSYMBOL_numericstring_def = 83, /* numericstring_def */ + YYSYMBOL_ia5string_def = 84, /* ia5string_def */ + YYSYMBOL_teletexstring_def = 85, /* teletexstring_def */ + YYSYMBOL_printablestring_def = 86, /* printablestring_def */ + YYSYMBOL_universalstring_def = 87, /* universalstring_def */ + YYSYMBOL_bmpstring_def = 88, /* bmpstring_def */ + YYSYMBOL_utf8string_def = 89, /* utf8string_def */ + YYSYMBOL_visiblestring_def = 90, /* visiblestring_def */ + YYSYMBOL_octet_string_def = 91, /* octet_string_def */ + YYSYMBOL_bit_element = 92, /* bit_element */ + YYSYMBOL_bit_element_list = 93, /* bit_element_list */ + YYSYMBOL_bit_string_def = 94, /* bit_string_def */ + YYSYMBOL_enumerated_def = 95, /* enumerated_def */ + YYSYMBOL_object_def = 96, /* object_def */ + YYSYMBOL_type_assig_right = 97, /* type_assig_right */ + YYSYMBOL_type_assig_right_tag = 98, /* type_assig_right_tag */ + YYSYMBOL_type_assig_right_tag_default = 99, /* type_assig_right_tag_default */ + YYSYMBOL_type_assig = 100, /* type_assig */ + YYSYMBOL_type_assig_list = 101, /* type_assig_list */ + YYSYMBOL_sequence_def = 102, /* sequence_def */ + YYSYMBOL_set_def = 103, /* set_def */ + YYSYMBOL_choise_def = 104, /* choise_def */ + YYSYMBOL_any_def = 105, /* any_def */ + YYSYMBOL_known_string = 106, /* known_string */ + YYSYMBOL_type_invalid = 107, /* type_invalid */ + YYSYMBOL_type_def = 108, /* type_def */ + YYSYMBOL_constant_def = 109, /* constant_def */ + YYSYMBOL_type_constant = 110, /* type_constant */ + YYSYMBOL_type_constant_list = 111, /* type_constant_list */ + YYSYMBOL_definitions_id = 112, /* definitions_id */ + YYSYMBOL_explicit_implicit = 113 /* explicit_implicit */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + @@ -303,28 +448,87 @@ int _asn1_yyparse (void); # undef short #endif -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + <limits.h> and (if available) <stdint.h> are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include <limits.h> /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include <stdint.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif #endif -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; #else -typedef unsigned short yytype_uint16; +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; #else -typedef short yytype_int16; +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -332,7 +536,7 @@ typedef short yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -340,7 +544,20 @@ typedef short yytype_int16; # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_uint8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -354,38 +571,37 @@ typedef short yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif #ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif #endif #ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value @@ -398,8 +614,22 @@ typedef short yytype_int16; # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) -#if ! defined yyoverflow || YYERROR_VERBOSE +#if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -464,27 +694,26 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* 1 */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined _ASN1_YYSTYPE_IS_TRIVIAL && _ASN1_YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; + yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -497,11 +726,11 @@ union yyalloc # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ - YYSIZE_T yynewbytes; \ + YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) @@ -513,12 +742,12 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ - YYSIZE_T yyi; \ + YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ @@ -530,28 +759,31 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 223 +#define YYLAST 248 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 60 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 52 +#define YYNNTS 54 /* YYNRULES -- Number of rules. */ -#define YYNRULES 128 +#define YYNRULES 137 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 223 +#define YYNSTATES 238 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 303 + /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ -static const yytype_uint8 yytranslate[] = +static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -586,62 +818,76 @@ static const yytype_uint8 yytranslate[] = 45, 46, 47, 48 }; -#if YYDEBUG +#if _ASN1_YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +static const yytype_int16 yyrline[] = { - 0, 145, 145, 158, 159, 162, 165, 166, 169, 170, - 173, 174, 175, 178, 179, 182, 184, 189, 190, 194, - 196, 201, 202, 206, 207, 208, 211, 213, 217, 218, - 219, 222, 224, 225, 229, 230, 234, 235, 237, 238, - 245, 248, 249, 252, 254, 260, 261, 264, 265, 269, - 270, 274, 275, 279, 280, 284, 285, 289, 290, 294, - 295, 299, 300, 304, 305, 309, 310, 314, 319, 320, - 324, 325, 326, 331, 337, 340, 342, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 360, 361, 362, 363, 364, 365, 368, 369, - 374, 375, 378, 381, 384, 385, 389, 391, 393, 398, - 400, 402, 407, 411, 412, 417, 419, 422, 426, 431, - 437, 438, 441, 442, 446, 449, 451, 475, 476 + 0, 151, 151, 164, 165, 168, 171, 172, 175, 176, + 179, 180, 181, 184, 185, 188, 190, 195, 196, 200, + 202, 207, 208, 212, 213, 214, 217, 219, 223, 224, + 225, 228, 230, 231, 235, 236, 240, 241, 243, 244, + 248, 251, 252, 255, 257, 263, 264, 267, 268, 272, + 273, 277, 278, 282, 283, 287, 288, 292, 293, 297, + 298, 302, 303, 307, 308, 312, 313, 317, 322, 323, + 327, 328, 330, 335, 341, 344, 346, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 372, 373, + 378, 379, 382, 385, 388, 389, 393, 395, 397, 402, + 404, 406, 411, 415, 416, 421, 422, 423, 424, 425, + 426, 427, 428, 431, 438, 441, 445, 450, 456, 457, + 458, 461, 462, 473, 476, 478, 502, 503 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 1 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if 1 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "\"::=\"", "NUM", "IDENTIFIER", - "OPTIONAL", "INTEGER", "SIZE", "OCTET", "STRING", "SEQUENCE", "BIT", - "UNIVERSAL", "PRIVATE", "APPLICATION", "DEFAULT", "CHOICE", "OF", - "OBJECT", "STR_IDENTIFIER", "BOOLEAN", "ASN1_TRUE", "ASN1_FALSE", - "TOKEN_NULL", "ANY", "DEFINED", "BY", "SET", "EXPLICIT", "IMPLICIT", - "DEFINITIONS", "TAGS", "BEGIN", "END", "UTCTime", "GeneralizedTime", - "GeneralString", "NumericString", "IA5String", "TeletexString", - "PrintableString", "UniversalString", "BMPString", "UTF8String", - "VisibleString", "FROM", "IMPORTS", "ENUMERATED", "'+'", "'-'", "'('", - "')'", "','", "'['", "']'", "'|'", "'{'", "'}'", "'.'", "$accept", - "definitions", "pos_num", "neg_num", "pos_neg_num", "num_identifier", - "int_identifier", "pos_neg_identifier", "constant", "constant_list", - "obj_constant", "obj_constant_list", "class", "tag_type", "tag", - "default", "pos_neg_list", "integer_def", "boolean_def", "Time", - "size_def2", "size_def", "generalstring_def", "numericstring_def", - "ia5string_def", "teletexstring_def", "printablestring_def", - "universalstring_def", "bmpstring_def", "utf8string_def", - "visiblestring_def", "octet_string_def", "bit_element", + "\"end of file\"", "error", "\"invalid token\"", "\"::=\"", "NUM", + "IDENTIFIER", "OPTIONAL", "INTEGER", "SIZE", "OCTET", "STRING", + "SEQUENCE", "BIT", "UNIVERSAL", "PRIVATE", "APPLICATION", "DEFAULT", + "CHOICE", "OF", "OBJECT", "STR_IDENTIFIER", "BOOLEAN", "ASN1_TRUE", + "ASN1_FALSE", "TOKEN_NULL", "ANY", "DEFINED", "BY", "SET", "EXPLICIT", + "IMPLICIT", "DEFINITIONS", "TAGS", "BEGIN", "END", "UTCTime", + "GeneralizedTime", "GeneralString", "NumericString", "IA5String", + "TeletexString", "PrintableString", "UniversalString", "BMPString", + "UTF8String", "VisibleString", "FROM", "IMPORTS", "ENUMERATED", "'+'", + "'-'", "'('", "')'", "','", "'['", "']'", "'|'", "'{'", "'}'", "'.'", + "$accept", "definitions", "pos_num", "neg_num", "pos_neg_num", + "num_identifier", "int_identifier", "pos_neg_identifier", "constant", + "constant_list", "obj_constant", "obj_constant_list", "class", + "tag_type", "tag", "default", "pos_neg_list", "integer_def", + "boolean_def", "Time", "size_def2", "size_def", "generalstring_def", + "numericstring_def", "ia5string_def", "teletexstring_def", + "printablestring_def", "universalstring_def", "bmpstring_def", + "utf8string_def", "visiblestring_def", "octet_string_def", "bit_element", "bit_element_list", "bit_string_def", "enumerated_def", "object_def", "type_assig_right", "type_assig_right_tag", "type_assig_right_tag_default", "type_assig", "type_assig_list", - "sequence_def", "set_def", "choise_def", "any_def", "type_def", - "constant_def", "type_constant", "type_constant_list", "definitions_id", - "explicit_implicit", YY_NULLPTR + "sequence_def", "set_def", "choise_def", "any_def", "known_string", + "type_invalid", "type_def", "constant_def", "type_constant", + "type_constant_list", "definitions_id", "explicit_implicit", YY_NULLPTR }; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} #endif -# ifdef YYPRINT +#ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = +static const yytype_int16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -650,45 +896,46 @@ static const yytype_uint16 yytoknum[] = 295, 296, 297, 298, 299, 300, 301, 302, 303, 43, 45, 40, 41, 44, 91, 93, 124, 123, 125, 46 }; -# endif +#endif -#define YYPACT_NINF -129 +#define YYPACT_NINF (-140) -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-129))) +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF -12 +#define YYTABLE_NINF (-12) -#define yytable_value_is_error(Yytable_value) \ +#define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - 36, -7, 74, 22, 3, -129, 26, -129, 34, -129, - -129, -129, 5, -129, -129, 55, 89, -129, -129, 97, - 57, 101, -129, 122, 141, 132, -129, -129, -129, 32, - 77, 77, 152, 165, 150, -129, -129, 6, 119, 167, - 18, 168, 124, 159, -129, -129, 156, 21, -129, -129, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 126, - 30, 38, 121, 133, -129, -129, -129, -129, -129, -129, - -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, - -129, -129, -129, -129, -129, -129, 128, 58, 183, 136, - 180, -129, -129, 20, 6, 121, 184, 172, -3, 184, - -129, 164, 121, 184, 174, -129, -129, -129, -129, -129, - -129, -129, -129, -129, 188, 139, -129, -129, -129, 191, - -129, -129, -129, 42, 149, -129, 192, 193, -129, -129, - -129, 142, 169, 146, 151, 58, -129, 53, -129, -129, - 77, -129, 71, 121, 188, -129, 83, 195, -129, 90, - 121, 153, -129, 94, -129, 148, 147, -129, 197, -129, - 154, 43, 7, -129, -129, 149, -129, -21, -129, 58, - 155, 20, -129, 24, -129, 184, -129, -129, 114, -129, - -129, -129, -129, 201, 188, -129, -129, 157, 158, -129, - 58, -129, 23, -129, 160, 162, -129, -129, -129, 54, - -129, -129, -129, 163, -129, 47, -129, -129, 169, -129, - -129, -129, -129, -129, -129, -129, -129, 204, 166, 170, - -129, -129, -129 + 41, -27, 32, 17, 0, -140, 90, -140, 19, -140, + -140, -140, 3, -140, -140, 24, 126, -140, -140, 98, + 80, 105, -140, 141, 30, -140, -140, -140, -140, -140, + -140, -140, -140, 131, -140, -140, -140, -140, 84, 67, + 148, 155, 170, 107, -140, -140, 6, 91, 184, 18, + 185, 139, 177, -140, -140, 172, 36, -140, -140, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 142, 25, + 145, 128, 149, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, 144, 64, 199, 174, 152, 196, + -140, -140, 26, 6, 128, 200, 189, 43, 200, -140, + 179, 128, 200, 190, -140, -140, -140, -140, -140, -140, + -140, -140, -140, 204, 156, -140, -140, -140, 206, -140, + -140, -140, 92, 173, -140, 208, 209, -140, -140, -140, + 157, 211, 188, 164, 166, 64, -140, -11, -140, -140, + 67, -140, 27, 128, 204, -140, 78, 213, -140, 97, + 128, 168, -140, 101, -140, 165, 162, -140, 218, -140, + 167, 10, 5, -140, -140, 173, 169, -140, -7, -140, + 64, 171, 26, -140, 37, -140, 200, -140, -140, 104, + -140, -140, -140, -140, 221, 204, -140, -140, 175, 176, + -140, 64, -140, 7, 197, -140, 178, 180, -140, -140, + -140, 94, -140, -140, -140, 181, -140, 23, -140, -140, + 219, 188, -140, -140, -140, -140, -140, -140, -140, -140, + 225, 186, 220, 187, -140, -140, -140, -140 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -696,51 +943,52 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 126, 0, 0, 0, 1, 0, 8, 9, 125, - 19, 21, 0, 127, 128, 0, 0, 124, 22, 0, - 0, 0, 20, 0, 0, 0, 120, 121, 122, 0, - 0, 0, 0, 0, 0, 2, 123, 75, 36, 0, - 0, 0, 0, 0, 40, 97, 113, 0, 41, 42, - 47, 49, 51, 53, 55, 57, 59, 61, 63, 0, - 0, 28, 0, 77, 79, 80, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 81, 82, 78, 93, 98, - 116, 92, 96, 94, 95, 115, 0, 0, 0, 0, - 0, 45, 76, 0, 65, 0, 0, 0, 70, 0, - 74, 0, 0, 0, 0, 48, 50, 52, 54, 56, - 58, 60, 62, 64, 0, 0, 23, 24, 25, 0, - 29, 30, 99, 0, 0, 3, 0, 0, 6, 7, - 119, 0, 0, 0, 0, 0, 17, 0, 66, 107, + 0, 135, 0, 0, 0, 1, 0, 8, 9, 134, + 19, 21, 0, 136, 137, 0, 0, 133, 22, 0, + 0, 0, 20, 0, 0, 120, 119, 121, 117, 118, + 122, 115, 116, 0, 129, 128, 130, 131, 0, 0, + 0, 0, 0, 0, 2, 132, 75, 36, 0, 0, + 0, 0, 0, 40, 97, 113, 0, 41, 42, 47, + 49, 51, 53, 55, 57, 59, 61, 63, 0, 0, + 28, 0, 77, 79, 80, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 81, 82, 78, 93, 98, 124, + 92, 96, 94, 95, 0, 0, 0, 0, 0, 0, + 45, 76, 0, 65, 0, 0, 0, 70, 0, 74, + 0, 0, 0, 0, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 0, 0, 23, 24, 25, 0, 29, + 30, 99, 0, 0, 3, 0, 0, 6, 7, 127, + 0, 0, 0, 0, 0, 0, 17, 0, 66, 107, 0, 104, 0, 0, 0, 71, 0, 0, 110, 0, 0, 0, 68, 0, 26, 0, 3, 12, 0, 34, - 0, 0, 0, 4, 5, 0, 9, 0, 46, 0, - 0, 0, 37, 100, 103, 0, 106, 108, 0, 112, - 114, 109, 111, 0, 0, 73, 27, 5, 0, 38, - 0, 118, 0, 43, 0, 0, 15, 18, 102, 0, - 101, 105, 72, 0, 69, 0, 35, 117, 0, 16, - 14, 32, 33, 13, 31, 67, 10, 0, 0, 0, - 11, 39, 44 + 0, 0, 0, 4, 5, 0, 0, 9, 0, 46, + 0, 0, 0, 37, 100, 103, 0, 106, 108, 0, + 112, 114, 109, 111, 0, 0, 73, 27, 5, 0, + 38, 0, 126, 0, 0, 43, 0, 0, 15, 18, + 102, 0, 101, 105, 72, 0, 69, 0, 35, 125, + 0, 0, 16, 14, 32, 33, 13, 31, 67, 10, + 0, 0, 0, 0, 11, 39, 123, 44 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -129, -129, -129, -129, -120, -128, 4, -129, 39, -129, - -12, -92, -129, -129, -129, -129, -129, -129, -129, -129, - 130, -34, -129, -129, -129, -129, -129, -129, -129, -129, - -129, -129, 27, 68, -129, -129, -129, -60, -30, -129, - 46, 72, -129, -129, -129, -129, -129, -129, 194, -129, - -129, -129 + -140, -140, -140, -140, -130, -139, 14, -140, 54, -140, + -12, -108, 143, -140, -140, -140, -140, -140, -140, -140, + 146, -43, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, 46, 88, -140, -140, -140, -70, 93, -140, + 58, -53, -140, -140, -140, -140, -140, -140, -140, -140, + 210, -140, -140, -140 }; /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +static const yytype_uint8 yydefgoto[] = { - -1, 2, 128, 129, 130, 10, 160, 214, 136, 137, - 11, 12, 119, 61, 62, 200, 161, 63, 64, 65, - 91, 92, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 152, 153, 76, 77, 78, 79, 80, 174, - 141, 142, 81, 82, 83, 84, 26, 27, 28, 29, - 3, 15 + 0, 2, 137, 138, 139, 10, 170, 227, 146, 147, + 11, 12, 128, 70, 71, 212, 171, 72, 73, 74, + 100, 101, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 162, 163, 85, 86, 87, 88, 89, 185, + 151, 152, 90, 91, 92, 93, 33, 34, 35, 36, + 37, 38, 3, 15 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -748,89 +996,94 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 18, 85, 122, 159, 167, 89, 97, 7, 8, 7, - 8, 7, 8, 104, 89, 170, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 134, 89, 7, 8, 89, - 198, 193, 162, 24, 115, 139, 95, 25, 194, 102, - 199, 1, 148, 116, 117, 118, 156, 157, 90, 195, - 4, 216, 157, 6, 144, 13, 14, 90, 125, 210, - 138, 9, 125, 17, 145, 191, 35, 120, 121, 90, - 206, 135, 90, 192, 5, 96, 211, 212, 103, 213, - 219, 207, 37, 177, 38, 16, 39, 19, 40, 41, - 182, 126, 158, 20, 42, 189, 43, 217, 44, 190, - 21, 45, 46, 126, 127, 47, 171, 126, 127, 22, - 173, 172, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 24, 175, 59, 37, 25, 38, 176, - 39, 60, 40, 41, 23, 31, 175, 32, 42, 33, - 43, 179, 44, 175, 30, 45, 46, 184, 181, 47, - 18, 34, 185, 7, 8, 86, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 184, 87, 59, - 88, 146, 202, 7, 166, 149, 93, 94, 98, 100, - 18, 99, 101, 114, 123, 124, 131, 132, 89, 140, - 143, 147, 150, 151, 154, 155, 163, 164, 168, 165, - 180, 187, 169, 186, 183, 203, -10, 196, 220, 218, - 197, 204, 178, 188, 209, 215, -11, 205, 221, 208, - 133, 201, 222, 36 + 18, 131, 169, 178, 7, 8, 106, 7, 8, 7, + 8, 7, 8, 113, 98, 181, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 172, 98, 229, 167, 124, + 4, 144, 5, 39, 149, 40, 104, 41, 125, 126, + 127, 158, 182, 210, 98, 205, 1, 183, 6, 42, + 207, 98, 206, 211, 111, 156, 19, 99, 9, 159, + 148, 17, 200, 202, 155, 219, 201, 203, 134, 99, + 16, 218, 46, 230, 47, 105, 48, 145, 49, 50, + 186, 226, 233, 188, 51, 187, 52, 99, 53, 24, + 193, 54, 55, 112, 99, 56, 166, 167, 134, 223, + 154, 21, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 135, 136, 68, 224, 225, 44, 13, + 14, 69, 25, 26, 27, 28, 29, 30, 31, 32, + 20, 186, 22, 46, 43, 47, 190, 48, 23, 49, + 50, 135, 168, 135, 136, 51, 24, 52, 102, 53, + 186, 94, 54, 55, 195, 192, 56, 195, 95, 196, + 18, 97, 214, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 129, 130, 68, 7, 8, 25, + 26, 27, 28, 29, 30, 31, 32, 125, 126, 127, + 96, 18, 7, 177, 103, 107, 108, 109, 110, 123, + 132, 133, 140, 142, 98, 150, 157, 153, 160, 161, + 165, 164, 173, 174, 175, 176, 179, 180, 191, 194, + 197, -10, 198, 208, 204, 215, 199, 220, 232, 234, + 236, 231, 222, 228, -11, 217, 209, 221, 235, 237, + 141, 216, 189, 184, 213, 143, 0, 0, 45 }; -static const yytype_uint8 yycheck[] = +static const yytype_int16 yycheck[] = { - 12, 31, 62, 123, 132, 8, 40, 4, 5, 4, - 5, 4, 5, 47, 8, 135, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 5, 8, 4, 5, 8, - 6, 52, 124, 1, 4, 95, 18, 5, 59, 18, - 16, 5, 102, 13, 14, 15, 4, 5, 51, 169, - 57, 4, 5, 31, 57, 29, 30, 51, 4, 5, - 94, 58, 4, 58, 98, 58, 34, 29, 30, 51, - 190, 51, 51, 165, 0, 57, 22, 23, 57, 199, - 208, 58, 5, 143, 7, 51, 9, 32, 11, 12, - 150, 49, 50, 4, 17, 52, 19, 50, 21, 56, - 3, 24, 25, 49, 50, 28, 53, 49, 50, 52, - 140, 58, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 1, 53, 48, 5, 5, 7, 58, - 9, 54, 11, 12, 33, 3, 53, 5, 17, 7, - 19, 58, 21, 53, 3, 24, 25, 53, 58, 28, - 162, 19, 58, 4, 5, 3, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 53, 3, 48, - 20, 99, 58, 4, 5, 103, 57, 10, 10, 20, - 192, 57, 26, 57, 51, 57, 3, 51, 8, 5, - 18, 27, 18, 5, 55, 4, 4, 4, 52, 57, - 5, 4, 51, 55, 51, 4, 59, 52, 4, 205, - 171, 184, 144, 59, 52, 52, 59, 59, 52, 59, - 90, 175, 52, 29 + 12, 71, 132, 142, 4, 5, 49, 4, 5, 4, + 5, 4, 5, 56, 8, 145, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 133, 8, 4, 5, 4, + 57, 5, 0, 3, 104, 5, 18, 7, 13, 14, + 15, 111, 53, 6, 8, 52, 5, 58, 31, 19, + 180, 8, 59, 16, 18, 108, 32, 51, 58, 112, + 103, 58, 52, 58, 107, 58, 56, 175, 4, 51, + 51, 201, 5, 50, 7, 57, 9, 51, 11, 12, + 53, 211, 221, 153, 17, 58, 19, 51, 21, 5, + 160, 24, 25, 57, 51, 28, 4, 5, 4, 5, + 57, 3, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 49, 50, 48, 22, 23, 34, 29, + 30, 54, 38, 39, 40, 41, 42, 43, 44, 45, + 4, 53, 52, 5, 3, 7, 58, 9, 33, 11, + 12, 49, 50, 49, 50, 17, 5, 19, 57, 21, + 53, 3, 24, 25, 53, 58, 28, 53, 3, 58, + 172, 54, 58, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 29, 30, 48, 4, 5, 38, + 39, 40, 41, 42, 43, 44, 45, 13, 14, 15, + 20, 203, 4, 5, 10, 10, 57, 20, 26, 57, + 51, 57, 3, 51, 8, 5, 27, 18, 18, 5, + 4, 55, 4, 4, 57, 4, 52, 51, 5, 51, + 55, 59, 4, 52, 55, 4, 59, 30, 9, 4, + 10, 217, 52, 52, 59, 59, 182, 59, 52, 52, + 97, 195, 154, 150, 186, 99, -1, -1, 38 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_int8 yystos[] = { - 0, 5, 61, 110, 57, 0, 31, 4, 5, 58, - 65, 70, 71, 29, 30, 111, 51, 58, 70, 32, - 4, 3, 52, 33, 1, 5, 106, 107, 108, 109, - 3, 3, 5, 7, 19, 34, 108, 5, 7, 9, - 11, 12, 17, 19, 21, 24, 25, 28, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, - 54, 73, 74, 77, 78, 79, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 94, 95, 96, 97, - 98, 102, 103, 104, 105, 98, 3, 3, 20, 8, - 51, 80, 81, 57, 10, 18, 57, 81, 10, 57, - 20, 26, 18, 57, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 57, 4, 13, 14, 15, 72, - 29, 30, 97, 51, 57, 4, 49, 50, 62, 63, - 64, 3, 51, 80, 5, 51, 68, 69, 81, 97, + 0, 5, 61, 112, 57, 0, 31, 4, 5, 58, + 65, 70, 71, 29, 30, 113, 51, 58, 70, 32, + 4, 3, 52, 33, 5, 38, 39, 40, 41, 42, + 43, 44, 45, 106, 107, 108, 109, 110, 111, 3, + 5, 7, 19, 3, 34, 110, 5, 7, 9, 11, + 12, 17, 19, 21, 24, 25, 28, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 48, 54, + 73, 74, 77, 78, 79, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 94, 95, 96, 97, 98, + 102, 103, 104, 105, 3, 3, 20, 54, 8, 51, + 80, 81, 57, 10, 18, 57, 81, 10, 57, 20, + 26, 18, 57, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 57, 4, 13, 14, 15, 72, 29, + 30, 97, 51, 57, 4, 49, 50, 62, 63, 64, + 3, 72, 51, 80, 5, 51, 68, 69, 81, 97, 5, 100, 101, 18, 57, 81, 101, 27, 97, 101, 18, 5, 92, 93, 55, 4, 4, 5, 50, 64, - 66, 76, 71, 4, 4, 57, 5, 65, 52, 51, - 64, 53, 58, 98, 99, 53, 58, 97, 93, 58, - 5, 58, 97, 51, 53, 58, 55, 4, 59, 52, - 56, 58, 71, 52, 59, 64, 52, 68, 6, 16, - 75, 100, 58, 4, 92, 59, 64, 58, 59, 52, - 5, 22, 23, 64, 67, 52, 4, 50, 66, 65, - 4, 52, 52 + 66, 76, 71, 4, 4, 57, 4, 5, 65, 52, + 51, 64, 53, 58, 98, 99, 53, 58, 97, 93, + 58, 5, 58, 97, 51, 53, 58, 55, 4, 59, + 52, 56, 58, 71, 55, 52, 59, 64, 52, 68, + 6, 16, 75, 100, 58, 4, 92, 59, 64, 58, + 30, 59, 52, 5, 22, 23, 64, 67, 52, 4, + 50, 66, 9, 65, 4, 52, 10, 52 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_int8 yyr1[] = { 0, 60, 61, 62, 62, 63, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 70, @@ -843,12 +1096,13 @@ static const yytype_uint8 yyr1[] = 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 99, 99, 99, 100, 101, 101, 102, 102, 102, 103, - 103, 103, 104, 105, 105, 106, 106, 107, 107, 107, - 108, 108, 109, 109, 110, 110, 110, 111, 111 + 103, 103, 104, 105, 105, 106, 106, 106, 106, 106, + 106, 106, 106, 107, 108, 109, 109, 109, 110, 110, + 110, 111, 111, 112, 112, 112, 113, 113 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +static const yytype_int8 yyr2[] = { 0, 2, 8, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 4, 1, 3, 1, @@ -861,15 +1115,16 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 3, 4, 3, 4, 4, - 3, 4, 4, 1, 4, 3, 3, 7, 6, 4, - 1, 1, 1, 2, 4, 3, 1, 1, 1 + 3, 4, 4, 1, 4, 1, 1, 1, 1, 1, + 1, 1, 1, 9, 3, 7, 6, 4, 1, 1, + 1, 1, 2, 4, 3, 1, 1, 1 }; +enum { YYENOMEM = -2 }; + #define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 +#define yyclearin (yychar = _ASN1_YYEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab @@ -880,7 +1135,7 @@ static const yytype_uint8 yyr2[] = #define YYBACKUP(Token, Value) \ do \ - if (yychar == YYEMPTY) \ + if (yychar == _ASN1_YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ @@ -895,14 +1150,13 @@ static const yytype_uint8 yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use _ASN1_YYerror or _ASN1_YYUNDEF. */ +#define YYERRCODE _ASN1_YYUNDEF /* Enable debugging if requested. */ -#if YYDEBUG +#if _ASN1_YYDEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ @@ -916,18 +1170,18 @@ do { \ } while (0) /* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif +# ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -938,17 +1192,20 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); + if (yykind < YYNTOKENS) + YYPRINT (yyo, yytoknum[yykind], *yyvaluep); # endif - YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -957,12 +1214,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `---------------------------*/ static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyo, yytype, yyvaluep); + yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } @@ -972,7 +1230,7 @@ yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `------------------------------------------------------------------*/ static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -995,21 +1253,21 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) { - unsigned long yylno = yyrline[yyrule]; + int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } @@ -1023,12 +1281,12 @@ do { \ /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +#else /* !_ASN1_YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +#endif /* !_ASN1_YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ @@ -1048,28 +1306,76 @@ int yydebug; #endif -#if YYERROR_VERBOSE +/* Context of a parse error. */ +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; +} yypcontext_t; + +/* Put in YYARG at most YYARGN of the expected tokens given the + current YYCTX, and return the number of tokens stored in YYARG. If + YYARG is null, return the number of expected tokens (guaranteed to + be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. + Return 0 if there are more than YYARGN expected tokens, yet fill + YYARG up to YYARGN. */ +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; +} + + -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else + +#ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else /* Return the length of YYSTR. */ -static YYSIZE_T +static YYPTRDIFF_T yystrlen (const char *yystr) { - YYSIZE_T yylen; + YYPTRDIFF_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } -# endif # endif +#endif -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else +#ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * @@ -1083,10 +1389,10 @@ yystpcpy (char *yydest, const char *yysrc) return yyd - 1; } -# endif # endif +#endif -# ifndef yytnamerr +#ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string @@ -1094,14 +1400,13 @@ yystpcpy (char *yydest, const char *yysrc) backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ -static YYSIZE_T +static YYPTRDIFF_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { - YYSIZE_T yyn = 0; + YYPTRDIFF_T yyn = 0; char const *yyp = yystr; - for (;;) switch (*++yyp) { @@ -1130,36 +1435,20 @@ yytnamerr (char *yyres, const char *yystr) do_not_strip_quotes: ; } - if (! yyres) + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } -# endif +#endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) { - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ + /* Actual size of YYARG. */ int yycount = 0; - /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action @@ -1183,49 +1472,54 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ - if (yytoken != YYEMPTY) + if (yyctx->yytoken != YYSYMBOL_YYEMPTY) { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; } + return yycount; +} + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; switch (yycount) { -# define YYCASE_(N, S) \ +#define YYCASE_(N, S) \ case N: \ yyformat = S; \ - break + break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); @@ -1233,15 +1527,23 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ +#undef YYCASE_ } + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } } if (*yymsg_alloc < yysize) @@ -1250,7 +1552,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; + return -1; } /* Avoid sprintf, as that infringes on the user's name space. @@ -1262,40 +1564,39 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr (yyp, yyarg[yyi++]); + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); yyformat += 2; } else { - yyp++; - yyformat++; + ++yyp; + ++yyformat; } } return 0; } -#endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } - - -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1304,6 +1605,8 @@ YYSTYPE yylval; int yynerrs; + + /*----------. | yyparse. | `----------*/ @@ -1311,43 +1614,39 @@ int yynerrs; int yyparse (void) { - int yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + int yyerrstatus = 0; - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - YYSIZE_T yystacksize; + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1355,16 +1654,9 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = _ASN1_YYEMPTY; /* Cause a token to be read. */ goto yysetstate; @@ -1378,10 +1670,15 @@ yynewstate: /*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | +| yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: - *yyssp = (yytype_int16) yystate; + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE @@ -1389,23 +1686,23 @@ yysetstate: #else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); + YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ + yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; @@ -1419,14 +1716,15 @@ yysetstate: yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; + yy_state_t *yyss1 = yyss; union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1435,16 +1733,16 @@ yysetstate: yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) YYACCEPT; @@ -1465,18 +1763,29 @@ yybackup: /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == _ASN1_YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } - if (yychar <= YYEOF) + if (yychar <= _ASN1_YYEOF) { - yychar = yytoken = YYEOF; + yychar = _ASN1_YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == _ASN1_YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = _ASN1_YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1504,15 +1813,13 @@ yybackup: /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + /* Discard the shifted token. */ + yychar = _ASN1_YYEMPTY; goto yynewstate; @@ -1547,9 +1854,9 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 148 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFINITIONS|(yyvsp[-5].constant)); + case 2: /* definitions: definitions_id DEFINITIONS explicit_implicit TAGS "::=" BEGIN type_constant_list END */ +#line 154 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFINITIONS|(yyvsp[-5].constant)); _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[-7].node))); _asn1_set_name((yyvsp[-7].node),""); _asn1_set_right((yyvsp[-7].node),(yyvsp[-1].node)); @@ -1557,813 +1864,877 @@ yyreduce: p_tree=(yyval.node); } -#line 1561 "ASN1.c" /* yacc.c:1652 */ +#line 1868 "ASN1.c" break; - case 3: -#line 158 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1567 "ASN1.c" /* yacc.c:1652 */ + case 3: /* pos_num: NUM */ +#line 164 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1874 "ASN1.c" break; - case 4: -#line 159 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1573 "ASN1.c" /* yacc.c:1652 */ + case 4: /* pos_num: '+' NUM */ +#line 165 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1880 "ASN1.c" break; - case 5: -#line 162 "ASN1.y" /* yacc.c:1652 */ - {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));} -#line 1579 "ASN1.c" /* yacc.c:1652 */ + case 5: /* neg_num: '-' NUM */ +#line 168 "ASN1.y" + {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));} +#line 1886 "ASN1.c" break; - case 6: -#line 165 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1585 "ASN1.c" /* yacc.c:1652 */ + case 6: /* pos_neg_num: pos_num */ +#line 171 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1892 "ASN1.c" break; - case 7: -#line 166 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1591 "ASN1.c" /* yacc.c:1652 */ + case 7: /* pos_neg_num: neg_num */ +#line 172 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1898 "ASN1.c" break; - case 8: -#line 169 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1597 "ASN1.c" /* yacc.c:1652 */ + case 8: /* num_identifier: NUM */ +#line 175 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1904 "ASN1.c" break; - case 9: -#line 170 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1603 "ASN1.c" /* yacc.c:1652 */ + case 9: /* num_identifier: IDENTIFIER */ +#line 176 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1910 "ASN1.c" break; - case 10: -#line 173 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1609 "ASN1.c" /* yacc.c:1652 */ + case 10: /* int_identifier: NUM */ +#line 179 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1916 "ASN1.c" break; - case 11: -#line 174 "ASN1.y" /* yacc.c:1652 */ - {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));} -#line 1615 "ASN1.c" /* yacc.c:1652 */ + case 11: /* int_identifier: '-' NUM */ +#line 180 "ASN1.y" + {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));} +#line 1922 "ASN1.c" break; - case 12: -#line 175 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1621 "ASN1.c" /* yacc.c:1652 */ + case 12: /* int_identifier: IDENTIFIER */ +#line 181 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1928 "ASN1.c" break; - case 13: -#line 178 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1627 "ASN1.c" /* yacc.c:1652 */ + case 13: /* pos_neg_identifier: pos_neg_num */ +#line 184 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1934 "ASN1.c" break; - case 14: -#line 179 "ASN1.y" /* yacc.c:1652 */ - {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} -#line 1633 "ASN1.c" /* yacc.c:1652 */ + case 14: /* pos_neg_identifier: IDENTIFIER */ +#line 185 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));} +#line 1940 "ASN1.c" break; - case 15: -#line 182 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); + case 15: /* constant: '(' pos_neg_num ')' */ +#line 188 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1640 "ASN1.c" /* yacc.c:1652 */ +#line 1947 "ASN1.c" break; - case 16: -#line 184 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); + case 16: /* constant: IDENTIFIER '(' pos_neg_num ')' */ +#line 190 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1648 "ASN1.c" /* yacc.c:1652 */ +#line 1955 "ASN1.c" break; - case 17: -#line 189 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 1654 "ASN1.c" /* yacc.c:1652 */ + case 17: /* constant_list: constant */ +#line 195 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 1961 "ASN1.c" break; - case 18: -#line 190 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[-2].node); + case 18: /* constant_list: constant_list ',' constant */ +#line 196 "ASN1.y" + {(yyval.node)=(yyvsp[-2].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));} -#line 1661 "ASN1.c" /* yacc.c:1652 */ +#line 1968 "ASN1.c" break; - case 19: -#line 194 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); + case 19: /* obj_constant: num_identifier */ +#line 200 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 1668 "ASN1.c" /* yacc.c:1652 */ +#line 1975 "ASN1.c" break; - case 20: -#line 196 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); + case 20: /* obj_constant: IDENTIFIER '(' NUM ')' */ +#line 202 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1676 "ASN1.c" /* yacc.c:1652 */ +#line 1983 "ASN1.c" break; - case 21: -#line 201 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 1682 "ASN1.c" /* yacc.c:1652 */ + case 21: /* obj_constant_list: obj_constant */ +#line 207 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 1989 "ASN1.c" break; - case 22: -#line 202 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[-1].node); + case 22: /* obj_constant_list: obj_constant_list obj_constant */ +#line 208 "ASN1.y" + {(yyval.node)=(yyvsp[-1].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));} -#line 1689 "ASN1.c" /* yacc.c:1652 */ +#line 1996 "ASN1.c" break; - case 23: -#line 206 "ASN1.y" /* yacc.c:1652 */ - {(yyval.constant)=CONST_UNIVERSAL;} -#line 1695 "ASN1.c" /* yacc.c:1652 */ + case 23: /* class: UNIVERSAL */ +#line 212 "ASN1.y" + {(yyval.constant)=CONST_UNIVERSAL;} +#line 2002 "ASN1.c" break; - case 24: -#line 207 "ASN1.y" /* yacc.c:1652 */ - {(yyval.constant)=CONST_PRIVATE;} -#line 1701 "ASN1.c" /* yacc.c:1652 */ + case 24: /* class: PRIVATE */ +#line 213 "ASN1.y" + {(yyval.constant)=CONST_PRIVATE;} +#line 2008 "ASN1.c" break; - case 25: -#line 208 "ASN1.y" /* yacc.c:1652 */ - {(yyval.constant)=CONST_APPLICATION;} -#line 1707 "ASN1.c" /* yacc.c:1652 */ + case 25: /* class: APPLICATION */ +#line 214 "ASN1.y" + {(yyval.constant)=CONST_APPLICATION;} +#line 2014 "ASN1.c" break; - case 26: -#line 211 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG); + case 26: /* tag_type: '[' NUM ']' */ +#line 217 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1714 "ASN1.c" /* yacc.c:1652 */ +#line 2021 "ASN1.c" break; - case 27: -#line 213 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG | (yyvsp[-2].constant)); + case 27: /* tag_type: '[' class NUM ']' */ +#line 219 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG | (yyvsp[-2].constant)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1721 "ASN1.c" /* yacc.c:1652 */ +#line 2028 "ASN1.c" break; - case 28: -#line 217 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 1727 "ASN1.c" /* yacc.c:1652 */ + case 28: /* tag: tag_type */ +#line 223 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2034 "ASN1.c" break; - case 29: -#line 218 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_EXPLICIT);} -#line 1733 "ASN1.c" /* yacc.c:1652 */ + case 29: /* tag: tag_type EXPLICIT */ +#line 224 "ASN1.y" + {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_EXPLICIT);} +#line 2040 "ASN1.c" break; - case 30: -#line 219 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_IMPLICIT);} -#line 1739 "ASN1.c" /* yacc.c:1652 */ + case 30: /* tag: tag_type IMPLICIT */ +#line 225 "ASN1.y" + {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_IMPLICIT);} +#line 2046 "ASN1.c" break; - case 31: -#line 222 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT); + case 31: /* default: DEFAULT pos_neg_identifier */ +#line 228 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 1746 "ASN1.c" /* yacc.c:1652 */ +#line 2053 "ASN1.c" break; - case 32: -#line 224 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_TRUE);} -#line 1752 "ASN1.c" /* yacc.c:1652 */ + case 32: /* default: DEFAULT ASN1_TRUE */ +#line 230 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_TRUE);} +#line 2059 "ASN1.c" break; - case 33: -#line 225 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_FALSE);} -#line 1758 "ASN1.c" /* yacc.c:1652 */ + case 33: /* default: DEFAULT ASN1_FALSE */ +#line 231 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_FALSE);} +#line 2065 "ASN1.c" break; - case 36: -#line 234 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);} -#line 1764 "ASN1.c" /* yacc.c:1652 */ + case 36: /* integer_def: INTEGER */ +#line 240 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);} +#line 2071 "ASN1.c" break; - case 37: -#line 235 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_LIST); + case 37: /* integer_def: INTEGER '{' constant_list '}' */ +#line 241 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 1771 "ASN1.c" /* yacc.c:1652 */ +#line 2078 "ASN1.c" break; - case 38: -#line 237 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);} -#line 1777 "ASN1.c" /* yacc.c:1652 */ + case 38: /* integer_def: integer_def '(' pos_neg_list ')' */ +#line 243 "ASN1.y" + {(yyval.node)=(yyvsp[-3].node);} +#line 2084 "ASN1.c" break; - case 39: -#line 239 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_MIN_MAX); - _asn1_set_down((yyval.node),_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE)); - _asn1_set_value(_asn1_get_down((yyval.node)),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1); - _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[-4].str));} -#line 1786 "ASN1.c" /* yacc.c:1652 */ + case 39: /* integer_def: integer_def '(' int_identifier '.' '.' int_identifier ')' */ +#line 245 "ASN1.y" + {(yyval.node)=(yyvsp[-6].node);} +#line 2090 "ASN1.c" break; - case 40: -#line 245 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BOOLEAN);} -#line 1792 "ASN1.c" /* yacc.c:1652 */ + case 40: /* boolean_def: BOOLEAN */ +#line 248 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BOOLEAN);} +#line 2096 "ASN1.c" break; - case 41: -#line 248 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTC_TIME);} -#line 1798 "ASN1.c" /* yacc.c:1652 */ + case 41: /* Time: UTCTime */ +#line 251 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTC_TIME);} +#line 2102 "ASN1.c" break; - case 42: -#line 249 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALIZED_TIME);} -#line 1804 "ASN1.c" /* yacc.c:1652 */ + case 42: /* Time: GeneralizedTime */ +#line 252 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALIZED_TIME);} +#line 2108 "ASN1.c" break; - case 43: -#line 252 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_1_PARAM); + case 43: /* size_def2: SIZE '(' num_identifier ')' */ +#line 255 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_1_PARAM); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1811 "ASN1.c" /* yacc.c:1652 */ +#line 2115 "ASN1.c" break; - case 44: -#line 255 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_MIN_MAX); + case 44: /* size_def2: SIZE '(' num_identifier '.' '.' num_identifier ')' */ +#line 258 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_MIN_MAX); _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1); _asn1_set_name((yyval.node),(yyvsp[-1].str));} -#line 1819 "ASN1.c" /* yacc.c:1652 */ +#line 2123 "ASN1.c" break; - case 45: -#line 260 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 1825 "ASN1.c" /* yacc.c:1652 */ + case 45: /* size_def: size_def2 */ +#line 263 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2129 "ASN1.c" break; - case 46: -#line 261 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[-1].node);} -#line 1831 "ASN1.c" /* yacc.c:1652 */ + case 46: /* size_def: '(' size_def2 ')' */ +#line 264 "ASN1.y" + {(yyval.node)=(yyvsp[-1].node);} +#line 2135 "ASN1.c" break; - case 47: -#line 264 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING);} -#line 1837 "ASN1.c" /* yacc.c:1652 */ + case 47: /* generalstring_def: GeneralString */ +#line 267 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING);} +#line 2141 "ASN1.c" break; - case 48: -#line 265 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING|CONST_SIZE); + case 48: /* generalstring_def: GeneralString size_def */ +#line 268 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1844 "ASN1.c" /* yacc.c:1652 */ +#line 2148 "ASN1.c" break; - case 49: -#line 269 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);} -#line 1850 "ASN1.c" /* yacc.c:1652 */ + case 49: /* numericstring_def: NumericString */ +#line 272 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);} +#line 2154 "ASN1.c" break; - case 50: -#line 270 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE); + case 50: /* numericstring_def: NumericString size_def */ +#line 273 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1857 "ASN1.c" /* yacc.c:1652 */ +#line 2161 "ASN1.c" break; - case 51: -#line 274 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING);} -#line 1863 "ASN1.c" /* yacc.c:1652 */ + case 51: /* ia5string_def: IA5String */ +#line 277 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING);} +#line 2167 "ASN1.c" break; - case 52: -#line 275 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING|CONST_SIZE); + case 52: /* ia5string_def: IA5String size_def */ +#line 278 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1870 "ASN1.c" /* yacc.c:1652 */ +#line 2174 "ASN1.c" break; - case 53: -#line 279 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING);} -#line 1876 "ASN1.c" /* yacc.c:1652 */ + case 53: /* teletexstring_def: TeletexString */ +#line 282 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING);} +#line 2180 "ASN1.c" break; - case 54: -#line 280 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING|CONST_SIZE); + case 54: /* teletexstring_def: TeletexString size_def */ +#line 283 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1883 "ASN1.c" /* yacc.c:1652 */ +#line 2187 "ASN1.c" break; - case 55: -#line 284 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING);} -#line 1889 "ASN1.c" /* yacc.c:1652 */ + case 55: /* printablestring_def: PrintableString */ +#line 287 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING);} +#line 2193 "ASN1.c" break; - case 56: -#line 285 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE); + case 56: /* printablestring_def: PrintableString size_def */ +#line 288 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1896 "ASN1.c" /* yacc.c:1652 */ +#line 2200 "ASN1.c" break; - case 57: -#line 289 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING);} -#line 1902 "ASN1.c" /* yacc.c:1652 */ + case 57: /* universalstring_def: UniversalString */ +#line 292 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING);} +#line 2206 "ASN1.c" break; - case 58: -#line 290 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE); + case 58: /* universalstring_def: UniversalString size_def */ +#line 293 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1909 "ASN1.c" /* yacc.c:1652 */ +#line 2213 "ASN1.c" break; - case 59: -#line 294 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING);} -#line 1915 "ASN1.c" /* yacc.c:1652 */ + case 59: /* bmpstring_def: BMPString */ +#line 297 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING);} +#line 2219 "ASN1.c" break; - case 60: -#line 295 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING|CONST_SIZE); + case 60: /* bmpstring_def: BMPString size_def */ +#line 298 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1922 "ASN1.c" /* yacc.c:1652 */ +#line 2226 "ASN1.c" break; - case 61: -#line 299 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING);} -#line 1928 "ASN1.c" /* yacc.c:1652 */ + case 61: /* utf8string_def: UTF8String */ +#line 302 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING);} +#line 2232 "ASN1.c" break; - case 62: -#line 300 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING|CONST_SIZE); + case 62: /* utf8string_def: UTF8String size_def */ +#line 303 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1935 "ASN1.c" /* yacc.c:1652 */ +#line 2239 "ASN1.c" break; - case 63: -#line 304 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING);} -#line 1941 "ASN1.c" /* yacc.c:1652 */ + case 63: /* visiblestring_def: VisibleString */ +#line 307 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING);} +#line 2245 "ASN1.c" break; - case 64: -#line 305 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE); + case 64: /* visiblestring_def: VisibleString size_def */ +#line 308 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1948 "ASN1.c" /* yacc.c:1652 */ +#line 2252 "ASN1.c" break; - case 65: -#line 309 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING);} -#line 1954 "ASN1.c" /* yacc.c:1652 */ + case 65: /* octet_string_def: OCTET STRING */ +#line 312 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING);} +#line 2258 "ASN1.c" break; - case 66: -#line 310 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING|CONST_SIZE); + case 66: /* octet_string_def: OCTET STRING size_def */ +#line 313 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 1961 "ASN1.c" /* yacc.c:1652 */ +#line 2265 "ASN1.c" break; - case 67: -#line 314 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); + case 67: /* bit_element: IDENTIFIER '(' NUM ')' */ +#line 317 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);} -#line 1969 "ASN1.c" /* yacc.c:1652 */ +#line 2273 "ASN1.c" break; - case 68: -#line 319 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 1975 "ASN1.c" /* yacc.c:1652 */ + case 68: /* bit_element_list: bit_element */ +#line 322 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2279 "ASN1.c" break; - case 69: -#line 320 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[-2].node); + case 69: /* bit_element_list: bit_element_list ',' bit_element */ +#line 323 "ASN1.y" + {(yyval.node)=(yyvsp[-2].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));} -#line 1982 "ASN1.c" /* yacc.c:1652 */ +#line 2286 "ASN1.c" break; - case 70: -#line 324 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING);} -#line 1988 "ASN1.c" /* yacc.c:1652 */ + case 70: /* bit_string_def: BIT STRING */ +#line 327 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING);} +#line 2292 "ASN1.c" break; - case 71: -#line 325 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_SIZE);} -#line 1994 "ASN1.c" /* yacc.c:1652 */ + case 71: /* bit_string_def: BIT STRING size_def */ +#line 328 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_SIZE); + _asn1_set_down((yyval.node),(yyvsp[0].node));} +#line 2299 "ASN1.c" break; - case 72: -#line 327 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_LIST); + case 72: /* bit_string_def: BIT STRING '{' bit_element_list '}' */ +#line 331 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2001 "ASN1.c" /* yacc.c:1652 */ +#line 2306 "ASN1.c" break; - case 73: -#line 332 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ENUMERATED|CONST_LIST); + case 73: /* enumerated_def: ENUMERATED '{' bit_element_list '}' */ +#line 336 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ENUMERATED|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2008 "ASN1.c" /* yacc.c:1652 */ +#line 2313 "ASN1.c" break; - case 74: -#line 337 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);} -#line 2014 "ASN1.c" /* yacc.c:1652 */ + case 74: /* object_def: OBJECT STR_IDENTIFIER */ +#line 341 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);} +#line 2319 "ASN1.c" break; - case 75: -#line 340 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER); + case 75: /* type_assig_right: IDENTIFIER */ +#line 344 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 2021 "ASN1.c" /* yacc.c:1652 */ +#line 2326 "ASN1.c" break; - case 76: -#line 342 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER|CONST_SIZE); + case 76: /* type_assig_right: IDENTIFIER size_def */ +#line 346 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER|CONST_SIZE); _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2029 "ASN1.c" /* yacc.c:1652 */ +#line 2334 "ASN1.c" break; - case 77: -#line 345 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2035 "ASN1.c" /* yacc.c:1652 */ + case 77: /* type_assig_right: integer_def */ +#line 349 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2340 "ASN1.c" break; - case 78: -#line 346 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2041 "ASN1.c" /* yacc.c:1652 */ + case 78: /* type_assig_right: enumerated_def */ +#line 350 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2346 "ASN1.c" break; - case 79: -#line 347 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2047 "ASN1.c" /* yacc.c:1652 */ + case 79: /* type_assig_right: boolean_def */ +#line 351 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2352 "ASN1.c" break; - case 81: -#line 349 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2053 "ASN1.c" /* yacc.c:1652 */ + case 81: /* type_assig_right: octet_string_def */ +#line 353 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2358 "ASN1.c" break; - case 82: -#line 350 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2059 "ASN1.c" /* yacc.c:1652 */ + case 82: /* type_assig_right: bit_string_def */ +#line 354 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2364 "ASN1.c" break; - case 83: -#line 351 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2065 "ASN1.c" /* yacc.c:1652 */ + case 83: /* type_assig_right: generalstring_def */ +#line 355 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2370 "ASN1.c" break; - case 84: -#line 352 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2071 "ASN1.c" /* yacc.c:1652 */ + case 84: /* type_assig_right: numericstring_def */ +#line 356 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2376 "ASN1.c" break; - case 85: -#line 353 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2077 "ASN1.c" /* yacc.c:1652 */ + case 85: /* type_assig_right: ia5string_def */ +#line 357 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2382 "ASN1.c" break; - case 86: -#line 354 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2083 "ASN1.c" /* yacc.c:1652 */ + case 86: /* type_assig_right: teletexstring_def */ +#line 358 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2388 "ASN1.c" break; - case 87: -#line 355 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2089 "ASN1.c" /* yacc.c:1652 */ + case 87: /* type_assig_right: printablestring_def */ +#line 359 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2394 "ASN1.c" break; - case 88: -#line 356 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2095 "ASN1.c" /* yacc.c:1652 */ + case 88: /* type_assig_right: universalstring_def */ +#line 360 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2400 "ASN1.c" break; - case 89: -#line 357 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2101 "ASN1.c" /* yacc.c:1652 */ + case 89: /* type_assig_right: bmpstring_def */ +#line 361 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2406 "ASN1.c" break; - case 90: -#line 358 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2107 "ASN1.c" /* yacc.c:1652 */ + case 90: /* type_assig_right: utf8string_def */ +#line 362 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2412 "ASN1.c" break; - case 91: -#line 359 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2113 "ASN1.c" /* yacc.c:1652 */ + case 91: /* type_assig_right: visiblestring_def */ +#line 363 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2418 "ASN1.c" break; - case 92: -#line 360 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2119 "ASN1.c" /* yacc.c:1652 */ + case 92: /* type_assig_right: sequence_def */ +#line 364 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2424 "ASN1.c" break; - case 93: -#line 361 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2125 "ASN1.c" /* yacc.c:1652 */ + case 93: /* type_assig_right: object_def */ +#line 365 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2430 "ASN1.c" break; - case 94: -#line 362 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2131 "ASN1.c" /* yacc.c:1652 */ + case 94: /* type_assig_right: choise_def */ +#line 366 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2436 "ASN1.c" break; - case 95: -#line 363 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2137 "ASN1.c" /* yacc.c:1652 */ + case 95: /* type_assig_right: any_def */ +#line 367 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2442 "ASN1.c" break; - case 96: -#line 364 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2143 "ASN1.c" /* yacc.c:1652 */ + case 96: /* type_assig_right: set_def */ +#line 368 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2448 "ASN1.c" break; - case 97: -#line 365 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NULL);} -#line 2149 "ASN1.c" /* yacc.c:1652 */ + case 97: /* type_assig_right: TOKEN_NULL */ +#line 369 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NULL);} +#line 2454 "ASN1.c" break; - case 98: -#line 368 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2155 "ASN1.c" /* yacc.c:1652 */ + case 98: /* type_assig_right_tag: type_assig_right */ +#line 372 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2460 "ASN1.c" break; - case 99: -#line 369 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_mod_type((yyvsp[0].node),CONST_TAG); + case 99: /* type_assig_right_tag: tag type_assig_right */ +#line 373 "ASN1.y" + {(yyval.node)=_asn1_mod_type((yyvsp[0].node),CONST_TAG); _asn1_set_right((yyvsp[-1].node),_asn1_get_down((yyval.node))); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2163 "ASN1.c" /* yacc.c:1652 */ +#line 2468 "ASN1.c" break; - case 100: -#line 374 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2169 "ASN1.c" /* yacc.c:1652 */ + case 100: /* type_assig_right_tag_default: type_assig_right_tag */ +#line 378 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2474 "ASN1.c" break; - case 101: -#line 375 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_DEFAULT); + case 101: /* type_assig_right_tag_default: type_assig_right_tag default */ +#line 379 "ASN1.y" + {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_DEFAULT); _asn1_set_right((yyvsp[0].node),_asn1_get_down((yyval.node))); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2177 "ASN1.c" /* yacc.c:1652 */ +#line 2482 "ASN1.c" break; - case 102: -#line 378 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_OPTION);} -#line 2183 "ASN1.c" /* yacc.c:1652 */ + case 102: /* type_assig_right_tag_default: type_assig_right_tag OPTIONAL */ +#line 382 "ASN1.y" + {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_OPTION);} +#line 2488 "ASN1.c" break; - case 103: -#line 381 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-1].str));} -#line 2189 "ASN1.c" /* yacc.c:1652 */ + case 103: /* type_assig: IDENTIFIER type_assig_right_tag_default */ +#line 385 "ASN1.y" + {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-1].str));} +#line 2494 "ASN1.c" break; - case 104: -#line 384 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2195 "ASN1.c" /* yacc.c:1652 */ + case 104: /* type_assig_list: type_assig */ +#line 388 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2500 "ASN1.c" break; - case 105: -#line 385 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[-2].node); + case 105: /* type_assig_list: type_assig_list ',' type_assig */ +#line 389 "ASN1.y" + {(yyval.node)=(yyvsp[-2].node); _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));} -#line 2202 "ASN1.c" /* yacc.c:1652 */ +#line 2507 "ASN1.c" break; - case 106: -#line 389 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE); + case 106: /* sequence_def: SEQUENCE '{' type_assig_list '}' */ +#line 393 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2209 "ASN1.c" /* yacc.c:1652 */ +#line 2514 "ASN1.c" break; - case 107: -#line 391 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF); + case 107: /* sequence_def: SEQUENCE OF type_assig_right */ +#line 395 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2216 "ASN1.c" /* yacc.c:1652 */ +#line 2521 "ASN1.c" break; - case 108: -#line 393 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE); + case 108: /* sequence_def: SEQUENCE size_def OF type_assig_right */ +#line 397 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE); _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node)); _asn1_set_down((yyval.node),(yyvsp[-2].node));} -#line 2224 "ASN1.c" /* yacc.c:1652 */ +#line 2529 "ASN1.c" break; - case 109: -#line 398 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET); + case 109: /* set_def: SET '{' type_assig_list '}' */ +#line 402 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2231 "ASN1.c" /* yacc.c:1652 */ +#line 2536 "ASN1.c" break; - case 110: -#line 400 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF); + case 110: /* set_def: SET OF type_assig_right */ +#line 404 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF); _asn1_set_down((yyval.node),(yyvsp[0].node));} -#line 2238 "ASN1.c" /* yacc.c:1652 */ +#line 2543 "ASN1.c" break; - case 111: -#line 402 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF|CONST_SIZE); + case 111: /* set_def: SET size_def OF type_assig_right */ +#line 406 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF|CONST_SIZE); _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node)); _asn1_set_down((yyval.node),(yyvsp[-2].node));} -#line 2246 "ASN1.c" /* yacc.c:1652 */ +#line 2551 "ASN1.c" break; - case 112: -#line 407 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CHOICE); + case 112: /* choise_def: CHOICE '{' type_assig_list '}' */ +#line 411 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CHOICE); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2253 "ASN1.c" /* yacc.c:1652 */ +#line 2558 "ASN1.c" break; - case 113: -#line 411 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY);} -#line 2259 "ASN1.c" /* yacc.c:1652 */ + case 113: /* any_def: ANY */ +#line 415 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY);} +#line 2564 "ASN1.c" break; - case 114: -#line 412 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY|CONST_DEFINED_BY); + case 114: /* any_def: ANY DEFINED BY IDENTIFIER */ +#line 416 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY|CONST_DEFINED_BY); _asn1_set_down((yyval.node),_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT)); _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[0].str));} -#line 2267 "ASN1.c" /* yacc.c:1652 */ +#line 2572 "ASN1.c" + break; + + case 115: /* known_string: UTF8String */ +#line 421 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2578 "ASN1.c" + break; + + case 116: /* known_string: VisibleString */ +#line 422 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2584 "ASN1.c" + break; + + case 117: /* known_string: PrintableString */ +#line 423 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2590 "ASN1.c" break; - case 115: -#line 417 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-2].str));} -#line 2273 "ASN1.c" /* yacc.c:1652 */ + case 118: /* known_string: UniversalString */ +#line 424 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2596 "ASN1.c" break; - case 116: -#line 419 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_set_name((yyvsp[0].node), last_error_token);} -#line 2279 "ASN1.c" /* yacc.c:1652 */ + case 119: /* known_string: IA5String */ +#line 425 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2602 "ASN1.c" break; - case 117: -#line 423 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN); + case 120: /* known_string: NumericString */ +#line 426 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2608 "ASN1.c" + break; + + case 121: /* known_string: TeletexString */ +#line 427 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2614 "ASN1.c" + break; + + case 122: /* known_string: BMPString */ +#line 428 "ASN1.y" + { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); } +#line 2620 "ASN1.c" + break; + + case 123: /* type_invalid: known_string "::=" '[' class NUM ']' IMPLICIT OCTET STRING */ +#line 431 "ASN1.y" + { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n", file_name, line_number, (yyvsp[-8].str)); +#endif +} +#line 2630 "ASN1.c" + break; + + case 124: /* type_def: IDENTIFIER "::=" type_assig_right_tag */ +#line 438 "ASN1.y" + { (yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-2].str));} +#line 2636 "ASN1.c" + break; + + case 125: /* constant_def: IDENTIFIER OBJECT STR_IDENTIFIER "::=" '{' obj_constant_list '}' */ +#line 442 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN); _asn1_set_name((yyval.node),(yyvsp[-6].str)); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2287 "ASN1.c" /* yacc.c:1652 */ +#line 2644 "ASN1.c" break; - case 118: -#line 427 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM); + case 126: /* constant_def: IDENTIFIER IDENTIFIER "::=" '{' obj_constant_list '}' */ +#line 446 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM); _asn1_set_name((yyval.node),(yyvsp[-5].str)); _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1); _asn1_set_down((yyval.node),(yyvsp[-1].node));} -#line 2296 "ASN1.c" /* yacc.c:1652 */ +#line 2653 "ASN1.c" break; - case 119: -#line 432 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_ASSIGN); + case 127: /* constant_def: IDENTIFIER INTEGER "::=" pos_neg_num */ +#line 451 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_ASSIGN); _asn1_set_name((yyval.node),(yyvsp[-3].str)); _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);} -#line 2304 "ASN1.c" /* yacc.c:1652 */ +#line 2661 "ASN1.c" break; - case 120: -#line 437 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2310 "ASN1.c" /* yacc.c:1652 */ + case 128: /* type_constant: type_def */ +#line 456 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2667 "ASN1.c" break; - case 121: -#line 438 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2316 "ASN1.c" /* yacc.c:1652 */ + case 129: /* type_constant: type_invalid */ +#line 457 "ASN1.y" + {(yyval.node)=NULL;} +#line 2673 "ASN1.c" break; - case 122: -#line 441 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[0].node);} -#line 2322 "ASN1.c" /* yacc.c:1652 */ + case 130: /* type_constant: constant_def */ +#line 458 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2679 "ASN1.c" break; - case 123: -#line 442 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=(yyvsp[-1].node); - _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));} -#line 2329 "ASN1.c" /* yacc.c:1652 */ + case 131: /* type_constant_list: type_constant */ +#line 461 "ASN1.y" + {(yyval.node)=(yyvsp[0].node);} +#line 2685 "ASN1.c" break; - case 124: -#line 446 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); + case 132: /* type_constant_list: type_constant_list type_constant */ +#line 462 "ASN1.y" + {if (!(yyvsp[-1].node)) + { + (yyval.node) = (yyvsp[0].node); + } + else + { + (yyval.node)=(yyvsp[-1].node); + if ((yyvsp[0].node)) _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node)); + }} +#line 2699 "ASN1.c" + break; + + case 133: /* definitions_id: IDENTIFIER '{' obj_constant_list '}' */ +#line 473 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); _asn1_set_down((yyval.node),(yyvsp[-1].node)); _asn1_set_name((yyval.node),(yyvsp[-3].str));} -#line 2337 "ASN1.c" /* yacc.c:1652 */ +#line 2707 "ASN1.c" break; - case 125: -#line 449 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); + case 134: /* definitions_id: IDENTIFIER '{' '}' */ +#line 476 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); _asn1_set_name((yyval.node),(yyvsp[-2].str));} -#line 2344 "ASN1.c" /* yacc.c:1652 */ +#line 2714 "ASN1.c" break; - case 126: -#line 451 "ASN1.y" /* yacc.c:1652 */ - {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); + case 135: /* definitions_id: IDENTIFIER */ +#line 478 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); _asn1_set_name((yyval.node),(yyvsp[0].str));} -#line 2351 "ASN1.c" /* yacc.c:1652 */ +#line 2721 "ASN1.c" break; - case 127: -#line 475 "ASN1.y" /* yacc.c:1652 */ - {(yyval.constant)=CONST_EXPLICIT;} -#line 2357 "ASN1.c" /* yacc.c:1652 */ + case 136: /* explicit_implicit: EXPLICIT */ +#line 502 "ASN1.y" + {(yyval.constant)=CONST_EXPLICIT;} +#line 2727 "ASN1.c" break; - case 128: -#line 476 "ASN1.y" /* yacc.c:1652 */ - {(yyval.constant)=CONST_IMPLICIT;} -#line 2363 "ASN1.c" /* yacc.c:1652 */ + case 137: /* explicit_implicit: IMPLICIT */ +#line 503 "ASN1.y" + {(yyval.constant)=CONST_IMPLICIT;} +#line 2733 "ASN1.c" break; -#line 2367 "ASN1.c" /* yacc.c:1652 */ +#line 2737 "ASN1.c" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2377,11 +2748,10 @@ yyreduce: case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -2405,66 +2775,60 @@ yyreduce: yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - + yytoken = yychar == _ASN1_YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { + yypcontext_t yyctx + = {yyssp, yytoken}; char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); if (yysyntax_error_status == 0) yymsgp = yymsg; - else if (yysyntax_error_status == 1) + else if (yysyntax_error_status == -1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yymsgp = yymsg; } else { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; } } yyerror (yymsgp); - if (yysyntax_error_status == 2) + if (yysyntax_error_status == YYENOMEM) goto yyexhaustedlab; } -# undef YYSYNTAX_ERROR -#endif } - - if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= YYEOF) + if (yychar <= _ASN1_YYEOF) { /* Return failure if at end of input. */ - if (yychar == YYEOF) + if (yychar == _ASN1_YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; + yychar = _ASN1_YYEMPTY; } } @@ -2497,13 +2861,14 @@ yyerrorlab: yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) @@ -2517,7 +2882,7 @@ yyerrlab1: yydestruct ("Error: popping", - yystos[yystate], yyvsp); + YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2529,7 +2894,7 @@ yyerrlab1: /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -2551,22 +2916,22 @@ yyabortlab: goto yyreturn; -#if !defined yyoverflow || YYERROR_VERBOSE +#if 1 /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ + goto yyreturn; #endif -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ +/*-------------------------------------------------------. +| yyreturn -- parsing is finished, clean up and return. | +`-------------------------------------------------------*/ yyreturn: - if (yychar != YYEMPTY) + if (yychar != _ASN1_YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2581,20 +2946,19 @@ yyreturn: while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); -#endif return yyresult; } -#line 480 "ASN1.y" /* yacc.c:1918 */ + +#line 507 "ASN1.y" @@ -2627,7 +2991,7 @@ static const int key_word_token[] = { /* Token identifier or ASCII code or 0(zero: End Of File) */ /*************************************************************/ static int -_asn1_yylex () +_asn1_yylex (void) { int c, counter = 0, k, lastc; char string[ASN1_MAX_NAME_SIZE + 1]; /* will contain the next token */ @@ -2683,7 +3047,7 @@ _asn1_yylex () } } } - string[counter++] = c; + string[counter++] = (char) c; /* Till the end of the token */ while (! ((c = fgetc (file_asn1)) == EOF || c == ' ' || c == '\t' @@ -2695,7 +3059,7 @@ _asn1_yylex () result_parse = ASN1_NAME_TOO_LONG; return 0; } - string[counter++] = c; + string[counter++] = (char) c; } ungetc (c, file_asn1); string[counter] = 0; @@ -2703,7 +3067,7 @@ _asn1_yylex () /* Is STRING a number? */ for (k = 0; k < counter; k++) - if (!isdigit ((int)string[k])) + if (!c_isdigit ((int)string[k])) break; if (k >= counter) { @@ -2781,20 +3145,18 @@ _asn1_create_errorDescription (int error, char *error_desc) * opening @file, %ASN1_SYNTAX_ERROR if the syntax is not * correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an * identifier that is not defined, %ASN1_NAME_TOO_LONG if in the - * file there is an identifier whith more than %ASN1_MAX_NAME_SIZE + * file there is an identifier with more than %ASN1_MAX_NAME_SIZE * characters. **/ int asn1_parser2tree (const char *file, asn1_node * definitions, char *error_desc) { - - p_tree = NULL; - if (*definitions != NULL) - return ASN1_ELEMENT_NOT_EMPTY; - - *definitions = NULL; + { + result_parse = ASN1_ELEMENT_NOT_EMPTY; + goto error; + } file_name = file; @@ -2804,54 +3166,48 @@ asn1_parser2tree (const char *file, asn1_node * definitions, if (file_asn1 == NULL) { result_parse = ASN1_FILE_NOT_FOUND; + goto error; } - else - { - result_parse = ASN1_SUCCESS; - - line_number = 1; - yyparse (); - - fclose (file_asn1); - - if (result_parse == ASN1_SUCCESS) - { /* syntax OK */ - /* set IMPLICIT or EXPLICIT property */ - _asn1_set_default_tag (p_tree); - /* set CONST_SET and CONST_NOT_USED */ - _asn1_type_set_config (p_tree); - /* check the identifier definitions */ - result_parse = _asn1_check_identifier (p_tree); - if (result_parse == ASN1_SUCCESS) - { /* all identifier defined */ - /* Delete the list and keep the ASN1 structure */ - _asn1_delete_list (e_list); - e_list = NULL; - /* Convert into DER coding the value assign to INTEGER constants */ - _asn1_change_integer_value (p_tree); - /* Expand the IDs of OBJECT IDENTIFIER constants */ - result_parse = _asn1_expand_object_id (e_list, p_tree); - if (result_parse != ASN1_SUCCESS) - goto error; - - *definitions = p_tree; - } - else /* some identifiers not defined */ - { - /* Delete the list and the ASN1 structure */ - _asn1_delete_list_and_nodes (e_list); - e_list = NULL; - } - } - else /* syntax error */ - { - /* Delete the list and the ASN1 structure */ - _asn1_delete_list_and_nodes (e_list); - e_list = NULL; - } - } - error: + result_parse = ASN1_SUCCESS; + + line_number = 1; + yyparse (); + + fclose (file_asn1); + + if (result_parse != ASN1_SUCCESS) + goto error; + + /* set IMPLICIT or EXPLICIT property */ + _asn1_set_default_tag (p_tree); + /* set CONST_SET and CONST_NOT_USED */ + _asn1_type_set_config (p_tree); + /* check the identifier definitions */ + result_parse = _asn1_check_identifier (p_tree); + if (result_parse != ASN1_SUCCESS) + goto error; + + /* Convert into DER coding the value assign to INTEGER constants */ + _asn1_change_integer_value (p_tree); + /* Expand the IDs of OBJECT IDENTIFIER constants */ + result_parse = _asn1_expand_object_id (&e_list, p_tree); + if (result_parse != ASN1_SUCCESS) + goto error; + + /* success */ + *definitions = p_tree; + _asn1_delete_list (e_list); + e_list = NULL; + p_tree = NULL; + *error_desc = 0; + return result_parse; + +error: + _asn1_delete_list_and_nodes (e_list); + e_list = NULL; + p_tree = NULL; + _asn1_create_errorDescription (result_parse, error_desc); return result_parse; @@ -2879,7 +3235,7 @@ asn1_parser2tree (const char *file, asn1_node * definitions, * while opening @inputFileName, %ASN1_SYNTAX_ERROR if the syntax is * not correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is * an identifier that is not defined, %ASN1_NAME_TOO_LONG if in the - * file there is an identifier whith more than %ASN1_MAX_NAME_SIZE + * file there is an identifier with more than %ASN1_MAX_NAME_SIZE * characters. **/ int @@ -2898,102 +3254,99 @@ asn1_parser2array (const char *inputFileName, const char *outputFileName, file_asn1 = fopen (inputFileName, "r"); if (file_asn1 == NULL) - result_parse = ASN1_FILE_NOT_FOUND; - else { - result_parse = ASN1_SUCCESS; - - line_number = 1; - yyparse (); - - fclose (file_asn1); - - if (result_parse == ASN1_SUCCESS) - { /* syntax OK */ - /* set IMPLICIT or EXPLICIT property */ - _asn1_set_default_tag (p_tree); - /* set CONST_SET and CONST_NOT_USED */ - _asn1_type_set_config (p_tree); - /* check the identifier definitions */ - result_parse = _asn1_check_identifier (p_tree); - - if (result_parse == ASN1_SUCCESS) - { /* all identifier defined */ + result_parse = ASN1_FILE_NOT_FOUND; + goto error2; + } - /* searching the last '/' and '.' in inputFileName */ - char_p = inputFileName; - slash_p = inputFileName; - while ((char_p = strchr (char_p, '/'))) - { - char_p++; - slash_p = char_p; - } + result_parse = ASN1_SUCCESS; + + line_number = 1; + yyparse (); + + fclose (file_asn1); + if (result_parse != ASN1_SUCCESS) + goto error1; + + /* set IMPLICIT or EXPLICIT property */ + _asn1_set_default_tag (p_tree); + /* set CONST_SET and CONST_NOT_USED */ + _asn1_type_set_config (p_tree); + /* check the identifier definitions */ + result_parse = _asn1_check_identifier (p_tree); + if (result_parse != ASN1_SUCCESS) + goto error2; + + /* all identifier defined */ + /* searching the last '/' and '.' in inputFileName */ + char_p = inputFileName; + slash_p = inputFileName; + while ((char_p = strchr (char_p, '/'))) + { + char_p++; + slash_p = char_p; + } - char_p = slash_p; - dot_p = inputFileName + strlen (inputFileName); + char_p = slash_p; + dot_p = inputFileName + strlen (inputFileName); - while ((char_p = strchr (char_p, '.'))) - { - dot_p = char_p; - char_p++; - } + while ((char_p = strchr (char_p, '.'))) + { + dot_p = char_p; + char_p++; + } - if (outputFileName == NULL) - { - /* file_out_name = inputFileName + _asn1_tab.c */ - file_out_name = malloc (dot_p - inputFileName + 1 + - sizeof ("_asn1_tab.c")-1); - memcpy (file_out_name, inputFileName, - dot_p - inputFileName); - file_out_name[dot_p - inputFileName] = 0; - strcat (file_out_name, "_asn1_tab.c"); - } - else - { - /* file_out_name = inputFileName */ - file_out_name = - (char *) malloc (strlen (outputFileName) + 1); - strcpy (file_out_name, outputFileName); - } + if (outputFileName == NULL) + { + /* file_out_name = inputFileName + _asn1_tab.c */ + file_out_name = malloc (dot_p - inputFileName + 1 + + sizeof ("_asn1_tab.c")-1); + memcpy (file_out_name, inputFileName, + dot_p - inputFileName); + file_out_name[dot_p - inputFileName] = 0; + strcat (file_out_name, "_asn1_tab.c"); + } + else + { + /* file_out_name = inputFileName */ + file_out_name = strdup(outputFileName); + } - if (vectorName == NULL) - { - unsigned len, i; - /* vector_name = file name + _asn1_tab */ - vector_name = malloc (dot_p - slash_p + 1 + - sizeof("_asn1_tab") - 1); - memcpy (vector_name, slash_p, dot_p - slash_p); - vector_name[dot_p - slash_p] = 0; - strcat (vector_name, "_asn1_tab"); - - len = strlen(vector_name); - for (i=0;i<len;i++) - { - if (vector_name[i] == '-') - vector_name[i] = '_'; - } - } - else - { - /* vector_name = vectorName */ - vector_name = (char *) malloc (strlen (vectorName) + 1); - strcpy (vector_name, vectorName); - } + if (vectorName == NULL) + { + unsigned len, i; + /* vector_name = file name + _asn1_tab */ + vector_name = malloc (dot_p - slash_p + 1 + + sizeof("_asn1_tab") - 1); + memcpy (vector_name, slash_p, dot_p - slash_p); + vector_name[dot_p - slash_p] = 0; + strcat (vector_name, "_asn1_tab"); + + len = strlen(vector_name); + for (i=0;i<len;i++) + { + if (vector_name[i] == '-') + vector_name[i] = '_'; + } + } + else + { + /* vector_name = vectorName */ + vector_name = strdup(vectorName); + } - /* Save structure in a file */ - _asn1_create_static_structure (p_tree, - file_out_name, vector_name); + /* Save structure in a file */ + _asn1_create_static_structure (p_tree, + file_out_name, vector_name); - free (file_out_name); - free (vector_name); - } /* result == OK */ - } /* result == OK */ + free (file_out_name); + free (vector_name); - /* Delete the list and the ASN1 structure */ - _asn1_delete_list_and_nodes (e_list); - e_list = NULL; - } /* inputFile exist */ + error1: + _asn1_delete_list_and_nodes (e_list); + e_list = NULL; + error2: _asn1_create_errorDescription (result_parse, error_desc); return result_parse; @@ -3011,22 +3364,6 @@ static void _asn1_yyerror (const char *s) { /* Sends the error description to the std_out */ - - if (strcmp (last_token, "VisibleString") == 0 || - strcmp (last_token, "PrintableString") == 0 || - strcmp (last_token, "UniversalString") == 0 || - strcmp (last_token, "IA5String") == 0 || - strcmp (last_token, "UTF8String") == 0 || - strcmp (last_token, "NumericString") == 0 || - strcmp (last_token, "TeletexString") == 0 || - strcmp (last_token, "BMPString") == 0) - { - snprintf (last_error_token, sizeof(last_error_token), - "%s", last_token); - fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n", - file_name, line_number, last_token); - return; - } last_error_token[0] = 0; if (result_parse != ASN1_NAME_TOO_LONG) @@ -1,6 +1,6 @@ %{ /* - * Copyright (C) 2001-2014 Free Software Foundation, Inc. + * Copyright (C) 2001-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -31,6 +31,7 @@ #include <parser_aux.h> #include <structure.h> #include <libtasn1.h> +#include "c-ctype.h" static list_type *e_list = NULL; static FILE *file_asn1; /* Pointer to file to parse */ @@ -53,6 +54,9 @@ static const char *file_name; /* file to parse */ static void _asn1_yyerror (const char *); static int _asn1_yylex(void); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#define SAFE_COPY(dst, dst_size, fmt, ...) { snprintf(dst, dst_size, fmt, __VA_ARGS__); } +#else #define SAFE_COPY(dst, dst_size, fmt, ...) { \ int _ret = snprintf(dst, dst_size, fmt, __VA_ARGS__); \ if (_ret != (int)strlen(dst)) \ @@ -62,12 +66,13 @@ static int _asn1_yylex(void); exit(1); \ } \ } +#endif %} /* Prefix symbols and functions with _asn1_ */ /* %define parse.lac full */ -%error-verbose -%name-prefix "_asn1_yy" +%define parse.error verbose +%define api.prefix {_asn1_yy} %union { unsigned int constant; @@ -138,6 +143,7 @@ static int _asn1_yylex(void); %type <str> num_identifier %type <str> int_identifier %type <constant> class explicit_implicit +%type <str> known_string %% @@ -234,12 +240,9 @@ pos_neg_list: pos_neg_num integer_def: INTEGER {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);} | INTEGER'{'constant_list'}' {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_LIST); _asn1_set_down($$,$3);} - | integer_def'(' pos_neg_list ')' {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);} + | integer_def'(' pos_neg_list ')' {$$=$1;} | integer_def'('int_identifier'.''.'int_identifier')' - {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_MIN_MAX); - _asn1_set_down($$,_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE)); - _asn1_set_value(_asn1_get_down($$),$6,strlen($6)+1); - _asn1_set_name(_asn1_get_down($$),$3);} + {$$=$1;} ; boolean_def: BOOLEAN {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_BOOLEAN);} @@ -322,7 +325,8 @@ bit_element_list : bit_element {$$=$1;} ; bit_string_def : BIT STRING {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING);} - | BIT STRING size_def {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_SIZE);} + | BIT STRING size_def {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_SIZE); + _asn1_set_down($$,$3);} | BIT STRING'{'bit_element_list'}' {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_LIST); _asn1_set_down($$,$4);} @@ -414,9 +418,24 @@ any_def : ANY {$$=_asn1_add_static_node(&e_list, ASN1_E _asn1_set_name(_asn1_get_down($$),$4);} ; -type_def : IDENTIFIER "::=" type_assig_right_tag {$$=_asn1_set_name($3,$1);} - /* below should match: BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING etc*/ - | error "::=" type_assig_right_tag {$$=_asn1_set_name($3, last_error_token);} +known_string: UTF8String { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | VisibleString { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | PrintableString { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | UniversalString { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | IA5String { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | NumericString { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | TeletexString { SAFE_COPY($$,sizeof($$),"%s",last_token); } + | BMPString { SAFE_COPY($$,sizeof($$),"%s",last_token); } + +/* This matches build-in types which are redefined */ +type_invalid : known_string "::=" '[' class NUM ']' IMPLICIT OCTET STRING { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n", file_name, line_number, $1); +#endif +} +; + +type_def : IDENTIFIER "::=" type_assig_right_tag { $$=_asn1_set_name($3,$1);} ; constant_def : IDENTIFIER OBJECT STR_IDENTIFIER "::=" '{'obj_constant_list'}' @@ -435,12 +454,20 @@ constant_def : IDENTIFIER OBJECT STR_IDENTIFIER "::=" '{'obj_constant_list'}' ; type_constant: type_def {$$=$1;} + | type_invalid {$$=NULL;} | constant_def {$$=$1;} ; type_constant_list : type_constant {$$=$1;} - | type_constant_list type_constant {$$=$1; - _asn1_set_right(_asn1_get_last_right($1),$2);} + | type_constant_list type_constant {if (!$1) + { + $$ = $2; + } + else + { + $$=$1; + if ($2) _asn1_set_right(_asn1_get_last_right($1),$2); + }} ; definitions_id : IDENTIFIER '{' obj_constant_list '}' {$$=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID); @@ -509,7 +536,7 @@ static const int key_word_token[] = { /* Token identifier or ASCII code or 0(zero: End Of File) */ /*************************************************************/ static int -_asn1_yylex () +_asn1_yylex (void) { int c, counter = 0, k, lastc; char string[ASN1_MAX_NAME_SIZE + 1]; /* will contain the next token */ @@ -565,7 +592,7 @@ _asn1_yylex () } } } - string[counter++] = c; + string[counter++] = (char) c; /* Till the end of the token */ while (! ((c = fgetc (file_asn1)) == EOF || c == ' ' || c == '\t' @@ -577,7 +604,7 @@ _asn1_yylex () result_parse = ASN1_NAME_TOO_LONG; return 0; } - string[counter++] = c; + string[counter++] = (char) c; } ungetc (c, file_asn1); string[counter] = 0; @@ -585,7 +612,7 @@ _asn1_yylex () /* Is STRING a number? */ for (k = 0; k < counter; k++) - if (!isdigit ((int)string[k])) + if (!c_isdigit ((int)string[k])) break; if (k >= counter) { @@ -663,20 +690,18 @@ _asn1_create_errorDescription (int error, char *error_desc) * opening @file, %ASN1_SYNTAX_ERROR if the syntax is not * correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an * identifier that is not defined, %ASN1_NAME_TOO_LONG if in the - * file there is an identifier whith more than %ASN1_MAX_NAME_SIZE + * file there is an identifier with more than %ASN1_MAX_NAME_SIZE * characters. **/ int asn1_parser2tree (const char *file, asn1_node * definitions, char *error_desc) { - - p_tree = NULL; - if (*definitions != NULL) - return ASN1_ELEMENT_NOT_EMPTY; - - *definitions = NULL; + { + result_parse = ASN1_ELEMENT_NOT_EMPTY; + goto error; + } file_name = file; @@ -686,54 +711,48 @@ asn1_parser2tree (const char *file, asn1_node * definitions, if (file_asn1 == NULL) { result_parse = ASN1_FILE_NOT_FOUND; - } - else - { - result_parse = ASN1_SUCCESS; - - line_number = 1; - yyparse (); - - fclose (file_asn1); - - if (result_parse == ASN1_SUCCESS) - { /* syntax OK */ - /* set IMPLICIT or EXPLICIT property */ - _asn1_set_default_tag (p_tree); - /* set CONST_SET and CONST_NOT_USED */ - _asn1_type_set_config (p_tree); - /* check the identifier definitions */ - result_parse = _asn1_check_identifier (p_tree); - if (result_parse == ASN1_SUCCESS) - { /* all identifier defined */ - /* Delete the list and keep the ASN1 structure */ - _asn1_delete_list (e_list); - e_list = NULL; - /* Convert into DER coding the value assign to INTEGER constants */ - _asn1_change_integer_value (p_tree); - /* Expand the IDs of OBJECT IDENTIFIER constants */ - result_parse = _asn1_expand_object_id (e_list, p_tree); - if (result_parse != ASN1_SUCCESS) - goto error; - - *definitions = p_tree; - } - else /* some identifiers not defined */ - { - /* Delete the list and the ASN1 structure */ - _asn1_delete_list_and_nodes (e_list); - e_list = NULL; - } - } - else /* syntax error */ - { - /* Delete the list and the ASN1 structure */ - _asn1_delete_list_and_nodes (e_list); - e_list = NULL; - } + goto error; } - error: + result_parse = ASN1_SUCCESS; + + line_number = 1; + yyparse (); + + fclose (file_asn1); + + if (result_parse != ASN1_SUCCESS) + goto error; + + /* set IMPLICIT or EXPLICIT property */ + _asn1_set_default_tag (p_tree); + /* set CONST_SET and CONST_NOT_USED */ + _asn1_type_set_config (p_tree); + /* check the identifier definitions */ + result_parse = _asn1_check_identifier (p_tree); + if (result_parse != ASN1_SUCCESS) + goto error; + + /* Convert into DER coding the value assign to INTEGER constants */ + _asn1_change_integer_value (p_tree); + /* Expand the IDs of OBJECT IDENTIFIER constants */ + result_parse = _asn1_expand_object_id (&e_list, p_tree); + if (result_parse != ASN1_SUCCESS) + goto error; + + /* success */ + *definitions = p_tree; + _asn1_delete_list (e_list); + e_list = NULL; + p_tree = NULL; + *error_desc = 0; + return result_parse; + +error: + _asn1_delete_list_and_nodes (e_list); + e_list = NULL; + p_tree = NULL; + _asn1_create_errorDescription (result_parse, error_desc); return result_parse; @@ -761,7 +780,7 @@ asn1_parser2tree (const char *file, asn1_node * definitions, * while opening @inputFileName, %ASN1_SYNTAX_ERROR if the syntax is * not correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is * an identifier that is not defined, %ASN1_NAME_TOO_LONG if in the - * file there is an identifier whith more than %ASN1_MAX_NAME_SIZE + * file there is an identifier with more than %ASN1_MAX_NAME_SIZE * characters. **/ int @@ -780,102 +799,99 @@ asn1_parser2array (const char *inputFileName, const char *outputFileName, file_asn1 = fopen (inputFileName, "r"); if (file_asn1 == NULL) - result_parse = ASN1_FILE_NOT_FOUND; - else { - result_parse = ASN1_SUCCESS; - - line_number = 1; - yyparse (); - - fclose (file_asn1); - - if (result_parse == ASN1_SUCCESS) - { /* syntax OK */ - /* set IMPLICIT or EXPLICIT property */ - _asn1_set_default_tag (p_tree); - /* set CONST_SET and CONST_NOT_USED */ - _asn1_type_set_config (p_tree); - /* check the identifier definitions */ - result_parse = _asn1_check_identifier (p_tree); - - if (result_parse == ASN1_SUCCESS) - { /* all identifier defined */ + result_parse = ASN1_FILE_NOT_FOUND; + goto error2; + } - /* searching the last '/' and '.' in inputFileName */ - char_p = inputFileName; - slash_p = inputFileName; - while ((char_p = strchr (char_p, '/'))) - { - char_p++; - slash_p = char_p; - } + result_parse = ASN1_SUCCESS; + + line_number = 1; + yyparse (); + + fclose (file_asn1); + if (result_parse != ASN1_SUCCESS) + goto error1; + + /* set IMPLICIT or EXPLICIT property */ + _asn1_set_default_tag (p_tree); + /* set CONST_SET and CONST_NOT_USED */ + _asn1_type_set_config (p_tree); + /* check the identifier definitions */ + result_parse = _asn1_check_identifier (p_tree); + if (result_parse != ASN1_SUCCESS) + goto error2; + + /* all identifier defined */ + /* searching the last '/' and '.' in inputFileName */ + char_p = inputFileName; + slash_p = inputFileName; + while ((char_p = strchr (char_p, '/'))) + { + char_p++; + slash_p = char_p; + } - char_p = slash_p; - dot_p = inputFileName + strlen (inputFileName); + char_p = slash_p; + dot_p = inputFileName + strlen (inputFileName); - while ((char_p = strchr (char_p, '.'))) - { - dot_p = char_p; - char_p++; - } + while ((char_p = strchr (char_p, '.'))) + { + dot_p = char_p; + char_p++; + } - if (outputFileName == NULL) - { - /* file_out_name = inputFileName + _asn1_tab.c */ - file_out_name = malloc (dot_p - inputFileName + 1 + - sizeof ("_asn1_tab.c")-1); - memcpy (file_out_name, inputFileName, - dot_p - inputFileName); - file_out_name[dot_p - inputFileName] = 0; - strcat (file_out_name, "_asn1_tab.c"); - } - else - { - /* file_out_name = inputFileName */ - file_out_name = - (char *) malloc (strlen (outputFileName) + 1); - strcpy (file_out_name, outputFileName); - } + if (outputFileName == NULL) + { + /* file_out_name = inputFileName + _asn1_tab.c */ + file_out_name = malloc (dot_p - inputFileName + 1 + + sizeof ("_asn1_tab.c")-1); + memcpy (file_out_name, inputFileName, + dot_p - inputFileName); + file_out_name[dot_p - inputFileName] = 0; + strcat (file_out_name, "_asn1_tab.c"); + } + else + { + /* file_out_name = inputFileName */ + file_out_name = strdup(outputFileName); + } - if (vectorName == NULL) - { - unsigned len, i; - /* vector_name = file name + _asn1_tab */ - vector_name = malloc (dot_p - slash_p + 1 + - sizeof("_asn1_tab") - 1); - memcpy (vector_name, slash_p, dot_p - slash_p); - vector_name[dot_p - slash_p] = 0; - strcat (vector_name, "_asn1_tab"); - - len = strlen(vector_name); - for (i=0;i<len;i++) - { - if (vector_name[i] == '-') - vector_name[i] = '_'; - } - } - else - { - /* vector_name = vectorName */ - vector_name = (char *) malloc (strlen (vectorName) + 1); - strcpy (vector_name, vectorName); - } + if (vectorName == NULL) + { + unsigned len, i; + /* vector_name = file name + _asn1_tab */ + vector_name = malloc (dot_p - slash_p + 1 + + sizeof("_asn1_tab") - 1); + memcpy (vector_name, slash_p, dot_p - slash_p); + vector_name[dot_p - slash_p] = 0; + strcat (vector_name, "_asn1_tab"); + + len = strlen(vector_name); + for (i=0;i<len;i++) + { + if (vector_name[i] == '-') + vector_name[i] = '_'; + } + } + else + { + /* vector_name = vectorName */ + vector_name = strdup(vectorName); + } - /* Save structure in a file */ - _asn1_create_static_structure (p_tree, - file_out_name, vector_name); + /* Save structure in a file */ + _asn1_create_static_structure (p_tree, + file_out_name, vector_name); - free (file_out_name); - free (vector_name); - } /* result == OK */ - } /* result == OK */ + free (file_out_name); + free (vector_name); - /* Delete the list and the ASN1 structure */ - _asn1_delete_list_and_nodes (e_list); - e_list = NULL; - } /* inputFile exist */ + error1: + _asn1_delete_list_and_nodes (e_list); + e_list = NULL; + error2: _asn1_create_errorDescription (result_parse, error_desc); return result_parse; @@ -893,22 +909,6 @@ static void _asn1_yyerror (const char *s) { /* Sends the error description to the std_out */ - - if (strcmp (last_token, "VisibleString") == 0 || - strcmp (last_token, "PrintableString") == 0 || - strcmp (last_token, "UniversalString") == 0 || - strcmp (last_token, "IA5String") == 0 || - strcmp (last_token, "UTF8String") == 0 || - strcmp (last_token, "NumericString") == 0 || - strcmp (last_token, "TeletexString") == 0 || - strcmp (last_token, "BMPString") == 0) - { - snprintf (last_error_token, sizeof(last_error_token), - "%s", last_token); - fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n", - file_name, line_number, last_token); - return; - } last_error_token[0] = 0; if (result_parse != ASN1_NAME_TOO_LONG) diff --git a/lib/Makefile.am b/lib/Makefile.am index 9f11955..1fb36f0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2022 Free Software Foundation, Inc. # # This file is part of LIBTASN1. # @@ -21,6 +21,7 @@ SUBDIRS = gl AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAG_VISIBILITY) $(CODE_COVERAGE_CFLAGS) AM_CPPFLAGS = -I$(builddir)/gl -I$(srcdir)/gl -I$(builddir)/includes -I$(srcdir)/includes\ -DASN1_BUILDING $(CODE_COVERAGE_CPPFLAGS) +AM_YFLAGS = -Wno-yacc include_HEADERS = includes/libtasn1.h @@ -59,3 +60,11 @@ libtasn1_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtasn1.map else libtasn1_la_LDFLAGS += -export-symbols-regex '^(asn1|libtasn1_).*' endif + +if HAVE_LD_OUTPUT_DEF +libtasn1_la_LDFLAGS += -Wl,--output-def,libtasn1-$(DLL_VERSION).def +libtasn1-$(DLL_VERSION).def: libtasn1.la +defexecdir = $(libdir) +defexec_DATA = libtasn1-$(DLL_VERSION).def +DISTCLEANFILES = $(defexec_DATA) +endif diff --git a/lib/Makefile.in b/lib/Makefile.in index 97f95c6..8e62f15 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2022 Free Software Foundation, Inc. # # This file is part of LIBTASN1. # @@ -109,38 +109,88 @@ build_triplet = @build@ host_triplet = @host@ @HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=$(srcdir)/libtasn1.map @HAVE_LD_VERSION_SCRIPT_FALSE@am__append_2 = -export-symbols-regex '^(asn1|libtasn1_).*' +@HAVE_LD_OUTPUT_DEF_TRUE@am__append_3 = -Wl,--output-def,libtasn1-$(DLL_VERSION).def subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/src/gl/m4/alloca.m4 \ + $(top_srcdir)/src/gl/m4/clock_time.m4 \ + $(top_srcdir)/src/gl/m4/close.m4 \ + $(top_srcdir)/src/gl/m4/dup2.m4 \ + $(top_srcdir)/src/gl/m4/eealloc.m4 \ + $(top_srcdir)/src/gl/m4/errno_h.m4 \ + $(top_srcdir)/src/gl/m4/explicit_bzero.m4 \ + $(top_srcdir)/src/gl/m4/fcntl-o.m4 \ + $(top_srcdir)/src/gl/m4/fcntl.m4 \ + $(top_srcdir)/src/gl/m4/fcntl_h.m4 \ + $(top_srcdir)/src/gl/m4/fopen.m4 \ + $(top_srcdir)/src/gl/m4/free.m4 \ + $(top_srcdir)/src/gl/m4/fseeko.m4 \ + $(top_srcdir)/src/gl/m4/fstat.m4 \ + $(top_srcdir)/src/gl/m4/ftell.m4 \ + $(top_srcdir)/src/gl/m4/ftello.m4 \ + $(top_srcdir)/src/gl/m4/getdtablesize.m4 \ + $(top_srcdir)/src/gl/m4/getopt.m4 \ + $(top_srcdir)/src/gl/m4/gettime.m4 \ + $(top_srcdir)/src/gl/m4/gettimeofday.m4 \ + $(top_srcdir)/src/gl/m4/gnulib-comp.m4 \ + $(top_srcdir)/src/gl/m4/inttypes.m4 \ + $(top_srcdir)/src/gl/m4/largefile.m4 \ + $(top_srcdir)/src/gl/m4/lseek.m4 \ + $(top_srcdir)/src/gl/m4/malloc.m4 \ + $(top_srcdir)/src/gl/m4/malloca.m4 \ + $(top_srcdir)/src/gl/m4/mode_t.m4 \ + $(top_srcdir)/src/gl/m4/msvc-inval.m4 \ + $(top_srcdir)/src/gl/m4/msvc-nothrow.m4 \ + $(top_srcdir)/src/gl/m4/nocrash.m4 \ + $(top_srcdir)/src/gl/m4/open-cloexec.m4 \ + $(top_srcdir)/src/gl/m4/open-slash.m4 \ + $(top_srcdir)/src/gl/m4/open.m4 \ + $(top_srcdir)/src/gl/m4/pathmax.m4 \ + $(top_srcdir)/src/gl/m4/read-file.m4 \ + $(top_srcdir)/src/gl/m4/realloc.m4 \ + $(top_srcdir)/src/gl/m4/stat-time.m4 \ + $(top_srcdir)/src/gl/m4/stat.m4 \ + $(top_srcdir)/src/gl/m4/stdarg.m4 \ + $(top_srcdir)/src/gl/m4/stdio_h.m4 \ + $(top_srcdir)/src/gl/m4/sys_socket_h.m4 \ + $(top_srcdir)/src/gl/m4/sys_stat_h.m4 \ + $(top_srcdir)/src/gl/m4/sys_time_h.m4 \ + $(top_srcdir)/src/gl/m4/time_h.m4 \ + $(top_srcdir)/src/gl/m4/timespec.m4 \ + $(top_srcdir)/src/gl/m4/ungetc.m4 \ + $(top_srcdir)/src/gl/m4/version-etc.m4 \ + $(top_srcdir)/src/gl/m4/wchar_h.m4 \ + $(top_srcdir)/src/gl/m4/year2038.m4 \ + $(top_srcdir)/m4/00gnulib.m4 $(top_srcdir)/m4/__inline.m4 \ + $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/ax_ac_append_to_file.m4 \ $(top_srcdir)/m4/ax_ac_print_to_file.m4 \ $(top_srcdir)/m4/ax_add_am_macro_static.m4 \ $(top_srcdir)/m4/ax_am_macros_static.m4 \ $(top_srcdir)/m4/ax_check_gnu_make.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/include_next.m4 \ + $(top_srcdir)/m4/ld-output-def.m4 \ + $(top_srcdir)/m4/ld-version-script.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/limits-h.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4-gl/00gnulib.m4 \ - $(top_srcdir)/m4-gl/__inline.m4 \ - $(top_srcdir)/m4-gl/absolute-header.m4 \ - $(top_srcdir)/m4-gl/extensions.m4 \ - $(top_srcdir)/m4-gl/extern-inline.m4 \ - $(top_srcdir)/m4-gl/gnulib-common.m4 \ - $(top_srcdir)/m4-gl/gnulib-comp.m4 \ - $(top_srcdir)/m4-gl/include_next.m4 \ - $(top_srcdir)/m4-gl/ld-version-script.m4 \ - $(top_srcdir)/m4-gl/limits-h.m4 \ - $(top_srcdir)/m4-gl/longlong.m4 $(top_srcdir)/m4-gl/minmax.m4 \ - $(top_srcdir)/m4-gl/multiarch.m4 $(top_srcdir)/m4-gl/off_t.m4 \ - $(top_srcdir)/m4-gl/ssize_t.m4 $(top_srcdir)/m4-gl/stddef_h.m4 \ - $(top_srcdir)/m4-gl/stdint.m4 $(top_srcdir)/m4-gl/string_h.m4 \ - $(top_srcdir)/m4-gl/strverscmp.m4 \ - $(top_srcdir)/m4-gl/sys_types_h.m4 \ - $(top_srcdir)/m4-gl/valgrind-tests.m4 \ - $(top_srcdir)/m4-gl/visibility.m4 \ - $(top_srcdir)/m4-gl/warn-on-use.m4 \ - $(top_srcdir)/m4-gl/wchar_t.m4 $(top_srcdir)/m4-gl/wint_t.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/minmax.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/valgrind-tests.m4 \ + $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/warn-on-use.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/zzgnulib.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -177,8 +227,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(includedir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(defexecdir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libtasn1_la_DEPENDENCIES = gl/libgnu.la am_libtasn1_la_OBJECTS = ASN1.lo coding.lo decoding.lo element.lo \ @@ -255,7 +305,7 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -DATA = $(pkgconfig_DATA) +DATA = $(defexec_DATA) $(pkgconfig_DATA) HEADERS = $(include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -282,8 +332,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libtasn1.pc.in \ $(top_srcdir)/build-aux/depcomp $(top_srcdir)/build-aux/ylwrap \ @@ -315,16 +363,15 @@ am__relativize = \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_VALGRINDFLAGS = @AM_VALGRINDFLAGS@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AS = @AS@ -ASN1_VERSION_MAJOR = @ASN1_VERSION_MAJOR@ -ASN1_VERSION_MINOR = @ASN1_VERSION_MINOR@ -ASN1_VERSION_NUMBER = @ASN1_VERSION_NUMBER@ -ASN1_VERSION_PATCH = @ASN1_VERSION_PATCH@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -346,7 +393,10 @@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CONFIG_INCLUDE = @CONFIG_INCLUDE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_VALGRINDFLAGS = @DEFAULT_VALGRINDFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -356,49 +406,523 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FUZZ_LIBS = @FUZZ_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ -GNULIB_EXPLICIT_BZERO = @GNULIB_EXPLICIT_BZERO@ -GNULIB_FFSL = @GNULIB_FFSL@ -GNULIB_FFSLL = @GNULIB_FFSLL@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MEMCHR = @GNULIB_MEMCHR@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ -GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRERROR = @GNULIB_STRERROR@ -GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ -GNULIB_STRNCAT = @GNULIB_STRNCAT@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ -GNULIB_STRSTR = @GNULIB_STRSTR@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@ +GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@ +GL_CXXFLAG_ALLOW_WARNINGS = @GL_CXXFLAG_ALLOW_WARNINGS@ +GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@ +GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@ +GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@ +GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@ +GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@ +GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@ +GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@ +GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@ +GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@ +GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@ +GL_GNULIB_DUP = @GL_GNULIB_DUP@ +GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@ +GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@ +GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@ +GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@ +GL_GNULIB_EXECL = @GL_GNULIB_EXECL@ +GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@ +GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@ +GL_GNULIB_EXECV = @GL_GNULIB_EXECV@ +GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@ +GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@ +GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@ +GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@ +GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@ +GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@ +GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@ +GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@ +GL_GNULIB_FFSL = @GL_GNULIB_FFSL@ +GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@ +GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@ +GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@ +GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@ +GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@ +GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@ +GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@ +GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@ +GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@ +GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@ +GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@ +GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@ +GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@ +GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@ +GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@ +GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@ +GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@ +GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@ +GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@ +GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@ +GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@ +GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@ +GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@ +GL_GNULIB_LINK = @GL_GNULIB_LINK@ +GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@ +GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@ +GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@ +GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@ +GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@ +GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@ +GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@ +GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@ +GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@ +GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@ +GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@ +GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@ +GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@ +GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@ +GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@ +GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@ +GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@ +GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@ +GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@ +GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@ +GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@ +GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@ +GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@ +GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@ +GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@ +GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@ +GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@ +GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@ +GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@ +GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@ +GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@ +GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@ +GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@ +GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@ +GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@ +GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@ +GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@ +GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@ +GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@ +GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@ +GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@ +GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@ +GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@ +GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@ +GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@ +GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@ +GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@ +GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@ +GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@ +GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@ +GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@ +GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@ +GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@ +GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@ +GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@ +GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@ +GL_GNULIB_PIPE = @GL_GNULIB_PIPE@ +GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@ +GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@ +GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@ +GL_GNULIB_PREAD = @GL_GNULIB_PREAD@ +GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@ +GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@ +GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@ +GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@ +GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@ +GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@ +GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@ +GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@ +GL_GNULIB_READ = @GL_GNULIB_READ@ +GL_GNULIB_READLINK = @GL_GNULIB_READLINK@ +GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@ +GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@ +GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@ +GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@ +GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@ +GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@ +GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@ +GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@ +GL_GNULIB_SETENV = @GL_GNULIB_SETENV@ +GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@ +GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@ +GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@ +GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@ +GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@ +GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@ +GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@ +GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@ +GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@ +GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@ +GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@ +GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@ +GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@ +GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@ +GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@ +GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@ +GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@ +GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@ +GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@ +GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@ +GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@ +GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@ +GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@ +GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@ +GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@ +GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@ +GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@ +GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@ +GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@ +GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@ +GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@ +GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@ +GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@ +GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@ +GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@ +GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@ +GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@ +GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@ +GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@ +GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@ +GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@ +GL_GNULIB_WRITE = @GL_GNULIB_WRITE@ +GL_GNULIB__EXIT = @GL_GNULIB__EXIT@ +GL_SGL_GNULIB_ACCESS = @GL_SGL_GNULIB_ACCESS@ +GL_SGL_GNULIB_ALIGNED_ALLOC = @GL_SGL_GNULIB_ALIGNED_ALLOC@ +GL_SGL_GNULIB_ATOLL = @GL_SGL_GNULIB_ATOLL@ +GL_SGL_GNULIB_BTOWC = @GL_SGL_GNULIB_BTOWC@ +GL_SGL_GNULIB_CALLOC_GNU = @GL_SGL_GNULIB_CALLOC_GNU@ +GL_SGL_GNULIB_CALLOC_POSIX = @GL_SGL_GNULIB_CALLOC_POSIX@ +GL_SGL_GNULIB_CANONICALIZE_FILE_NAME = @GL_SGL_GNULIB_CANONICALIZE_FILE_NAME@ +GL_SGL_GNULIB_CHDIR = @GL_SGL_GNULIB_CHDIR@ +GL_SGL_GNULIB_CHMOD = @GL_SGL_GNULIB_CHMOD@ +GL_SGL_GNULIB_CHOWN = @GL_SGL_GNULIB_CHOWN@ +GL_SGL_GNULIB_CLOSE = @GL_SGL_GNULIB_CLOSE@ +GL_SGL_GNULIB_COPY_FILE_RANGE = @GL_SGL_GNULIB_COPY_FILE_RANGE@ +GL_SGL_GNULIB_CREAT = @GL_SGL_GNULIB_CREAT@ +GL_SGL_GNULIB_CTIME = @GL_SGL_GNULIB_CTIME@ +GL_SGL_GNULIB_DPRINTF = @GL_SGL_GNULIB_DPRINTF@ +GL_SGL_GNULIB_DUP = @GL_SGL_GNULIB_DUP@ +GL_SGL_GNULIB_DUP2 = @GL_SGL_GNULIB_DUP2@ +GL_SGL_GNULIB_DUP3 = @GL_SGL_GNULIB_DUP3@ +GL_SGL_GNULIB_ENVIRON = @GL_SGL_GNULIB_ENVIRON@ +GL_SGL_GNULIB_EUIDACCESS = @GL_SGL_GNULIB_EUIDACCESS@ +GL_SGL_GNULIB_EXECL = @GL_SGL_GNULIB_EXECL@ +GL_SGL_GNULIB_EXECLE = @GL_SGL_GNULIB_EXECLE@ +GL_SGL_GNULIB_EXECLP = @GL_SGL_GNULIB_EXECLP@ +GL_SGL_GNULIB_EXECV = @GL_SGL_GNULIB_EXECV@ +GL_SGL_GNULIB_EXECVE = @GL_SGL_GNULIB_EXECVE@ +GL_SGL_GNULIB_EXECVP = @GL_SGL_GNULIB_EXECVP@ +GL_SGL_GNULIB_EXECVPE = @GL_SGL_GNULIB_EXECVPE@ +GL_SGL_GNULIB_EXPLICIT_BZERO = @GL_SGL_GNULIB_EXPLICIT_BZERO@ +GL_SGL_GNULIB_FACCESSAT = @GL_SGL_GNULIB_FACCESSAT@ +GL_SGL_GNULIB_FCHDIR = @GL_SGL_GNULIB_FCHDIR@ +GL_SGL_GNULIB_FCHMODAT = @GL_SGL_GNULIB_FCHMODAT@ +GL_SGL_GNULIB_FCHOWNAT = @GL_SGL_GNULIB_FCHOWNAT@ +GL_SGL_GNULIB_FCLOSE = @GL_SGL_GNULIB_FCLOSE@ +GL_SGL_GNULIB_FCNTL = @GL_SGL_GNULIB_FCNTL@ +GL_SGL_GNULIB_FDATASYNC = @GL_SGL_GNULIB_FDATASYNC@ +GL_SGL_GNULIB_FDOPEN = @GL_SGL_GNULIB_FDOPEN@ +GL_SGL_GNULIB_FFLUSH = @GL_SGL_GNULIB_FFLUSH@ +GL_SGL_GNULIB_FFSL = @GL_SGL_GNULIB_FFSL@ +GL_SGL_GNULIB_FFSLL = @GL_SGL_GNULIB_FFSLL@ +GL_SGL_GNULIB_FGETC = @GL_SGL_GNULIB_FGETC@ +GL_SGL_GNULIB_FGETS = @GL_SGL_GNULIB_FGETS@ +GL_SGL_GNULIB_FOPEN = @GL_SGL_GNULIB_FOPEN@ +GL_SGL_GNULIB_FOPEN_GNU = @GL_SGL_GNULIB_FOPEN_GNU@ +GL_SGL_GNULIB_FPRINTF = @GL_SGL_GNULIB_FPRINTF@ +GL_SGL_GNULIB_FPRINTF_POSIX = @GL_SGL_GNULIB_FPRINTF_POSIX@ +GL_SGL_GNULIB_FPURGE = @GL_SGL_GNULIB_FPURGE@ +GL_SGL_GNULIB_FPUTC = @GL_SGL_GNULIB_FPUTC@ +GL_SGL_GNULIB_FPUTS = @GL_SGL_GNULIB_FPUTS@ +GL_SGL_GNULIB_FREAD = @GL_SGL_GNULIB_FREAD@ +GL_SGL_GNULIB_FREE_POSIX = @GL_SGL_GNULIB_FREE_POSIX@ +GL_SGL_GNULIB_FREOPEN = @GL_SGL_GNULIB_FREOPEN@ +GL_SGL_GNULIB_FSCANF = @GL_SGL_GNULIB_FSCANF@ +GL_SGL_GNULIB_FSEEK = @GL_SGL_GNULIB_FSEEK@ +GL_SGL_GNULIB_FSEEKO = @GL_SGL_GNULIB_FSEEKO@ +GL_SGL_GNULIB_FSTAT = @GL_SGL_GNULIB_FSTAT@ +GL_SGL_GNULIB_FSTATAT = @GL_SGL_GNULIB_FSTATAT@ +GL_SGL_GNULIB_FSYNC = @GL_SGL_GNULIB_FSYNC@ +GL_SGL_GNULIB_FTELL = @GL_SGL_GNULIB_FTELL@ +GL_SGL_GNULIB_FTELLO = @GL_SGL_GNULIB_FTELLO@ +GL_SGL_GNULIB_FTRUNCATE = @GL_SGL_GNULIB_FTRUNCATE@ +GL_SGL_GNULIB_FUTIMENS = @GL_SGL_GNULIB_FUTIMENS@ +GL_SGL_GNULIB_FWRITE = @GL_SGL_GNULIB_FWRITE@ +GL_SGL_GNULIB_GETC = @GL_SGL_GNULIB_GETC@ +GL_SGL_GNULIB_GETCHAR = @GL_SGL_GNULIB_GETCHAR@ +GL_SGL_GNULIB_GETCWD = @GL_SGL_GNULIB_GETCWD@ +GL_SGL_GNULIB_GETDELIM = @GL_SGL_GNULIB_GETDELIM@ +GL_SGL_GNULIB_GETDOMAINNAME = @GL_SGL_GNULIB_GETDOMAINNAME@ +GL_SGL_GNULIB_GETDTABLESIZE = @GL_SGL_GNULIB_GETDTABLESIZE@ +GL_SGL_GNULIB_GETENTROPY = @GL_SGL_GNULIB_GETENTROPY@ +GL_SGL_GNULIB_GETGROUPS = @GL_SGL_GNULIB_GETGROUPS@ +GL_SGL_GNULIB_GETHOSTNAME = @GL_SGL_GNULIB_GETHOSTNAME@ +GL_SGL_GNULIB_GETLINE = @GL_SGL_GNULIB_GETLINE@ +GL_SGL_GNULIB_GETLOADAVG = @GL_SGL_GNULIB_GETLOADAVG@ +GL_SGL_GNULIB_GETLOGIN = @GL_SGL_GNULIB_GETLOGIN@ +GL_SGL_GNULIB_GETLOGIN_R = @GL_SGL_GNULIB_GETLOGIN_R@ +GL_SGL_GNULIB_GETOPT_POSIX = @GL_SGL_GNULIB_GETOPT_POSIX@ +GL_SGL_GNULIB_GETPAGESIZE = @GL_SGL_GNULIB_GETPAGESIZE@ +GL_SGL_GNULIB_GETPASS = @GL_SGL_GNULIB_GETPASS@ +GL_SGL_GNULIB_GETPASS_GNU = @GL_SGL_GNULIB_GETPASS_GNU@ +GL_SGL_GNULIB_GETSUBOPT = @GL_SGL_GNULIB_GETSUBOPT@ +GL_SGL_GNULIB_GETTIMEOFDAY = @GL_SGL_GNULIB_GETTIMEOFDAY@ +GL_SGL_GNULIB_GETUMASK = @GL_SGL_GNULIB_GETUMASK@ +GL_SGL_GNULIB_GETUSERSHELL = @GL_SGL_GNULIB_GETUSERSHELL@ +GL_SGL_GNULIB_GRANTPT = @GL_SGL_GNULIB_GRANTPT@ +GL_SGL_GNULIB_GROUP_MEMBER = @GL_SGL_GNULIB_GROUP_MEMBER@ +GL_SGL_GNULIB_IMAXABS = @GL_SGL_GNULIB_IMAXABS@ +GL_SGL_GNULIB_IMAXDIV = @GL_SGL_GNULIB_IMAXDIV@ +GL_SGL_GNULIB_ISATTY = @GL_SGL_GNULIB_ISATTY@ +GL_SGL_GNULIB_LCHMOD = @GL_SGL_GNULIB_LCHMOD@ +GL_SGL_GNULIB_LCHOWN = @GL_SGL_GNULIB_LCHOWN@ +GL_SGL_GNULIB_LINK = @GL_SGL_GNULIB_LINK@ +GL_SGL_GNULIB_LINKAT = @GL_SGL_GNULIB_LINKAT@ +GL_SGL_GNULIB_LOCALTIME = @GL_SGL_GNULIB_LOCALTIME@ +GL_SGL_GNULIB_LSEEK = @GL_SGL_GNULIB_LSEEK@ +GL_SGL_GNULIB_LSTAT = @GL_SGL_GNULIB_LSTAT@ +GL_SGL_GNULIB_MALLOC_GNU = @GL_SGL_GNULIB_MALLOC_GNU@ +GL_SGL_GNULIB_MALLOC_POSIX = @GL_SGL_GNULIB_MALLOC_POSIX@ +GL_SGL_GNULIB_MBRLEN = @GL_SGL_GNULIB_MBRLEN@ +GL_SGL_GNULIB_MBRTOWC = @GL_SGL_GNULIB_MBRTOWC@ +GL_SGL_GNULIB_MBSCASECMP = @GL_SGL_GNULIB_MBSCASECMP@ +GL_SGL_GNULIB_MBSCASESTR = @GL_SGL_GNULIB_MBSCASESTR@ +GL_SGL_GNULIB_MBSCHR = @GL_SGL_GNULIB_MBSCHR@ +GL_SGL_GNULIB_MBSCSPN = @GL_SGL_GNULIB_MBSCSPN@ +GL_SGL_GNULIB_MBSINIT = @GL_SGL_GNULIB_MBSINIT@ +GL_SGL_GNULIB_MBSLEN = @GL_SGL_GNULIB_MBSLEN@ +GL_SGL_GNULIB_MBSNCASECMP = @GL_SGL_GNULIB_MBSNCASECMP@ +GL_SGL_GNULIB_MBSNLEN = @GL_SGL_GNULIB_MBSNLEN@ +GL_SGL_GNULIB_MBSNRTOWCS = @GL_SGL_GNULIB_MBSNRTOWCS@ +GL_SGL_GNULIB_MBSPBRK = @GL_SGL_GNULIB_MBSPBRK@ +GL_SGL_GNULIB_MBSPCASECMP = @GL_SGL_GNULIB_MBSPCASECMP@ +GL_SGL_GNULIB_MBSRCHR = @GL_SGL_GNULIB_MBSRCHR@ +GL_SGL_GNULIB_MBSRTOWCS = @GL_SGL_GNULIB_MBSRTOWCS@ +GL_SGL_GNULIB_MBSSEP = @GL_SGL_GNULIB_MBSSEP@ +GL_SGL_GNULIB_MBSSPN = @GL_SGL_GNULIB_MBSSPN@ +GL_SGL_GNULIB_MBSSTR = @GL_SGL_GNULIB_MBSSTR@ +GL_SGL_GNULIB_MBSTOK_R = @GL_SGL_GNULIB_MBSTOK_R@ +GL_SGL_GNULIB_MBTOWC = @GL_SGL_GNULIB_MBTOWC@ +GL_SGL_GNULIB_MDA_ACCESS = @GL_SGL_GNULIB_MDA_ACCESS@ +GL_SGL_GNULIB_MDA_CHDIR = @GL_SGL_GNULIB_MDA_CHDIR@ +GL_SGL_GNULIB_MDA_CHMOD = @GL_SGL_GNULIB_MDA_CHMOD@ +GL_SGL_GNULIB_MDA_CLOSE = @GL_SGL_GNULIB_MDA_CLOSE@ +GL_SGL_GNULIB_MDA_CREAT = @GL_SGL_GNULIB_MDA_CREAT@ +GL_SGL_GNULIB_MDA_DUP = @GL_SGL_GNULIB_MDA_DUP@ +GL_SGL_GNULIB_MDA_DUP2 = @GL_SGL_GNULIB_MDA_DUP2@ +GL_SGL_GNULIB_MDA_ECVT = @GL_SGL_GNULIB_MDA_ECVT@ +GL_SGL_GNULIB_MDA_EXECL = @GL_SGL_GNULIB_MDA_EXECL@ +GL_SGL_GNULIB_MDA_EXECLE = @GL_SGL_GNULIB_MDA_EXECLE@ +GL_SGL_GNULIB_MDA_EXECLP = @GL_SGL_GNULIB_MDA_EXECLP@ +GL_SGL_GNULIB_MDA_EXECV = @GL_SGL_GNULIB_MDA_EXECV@ +GL_SGL_GNULIB_MDA_EXECVE = @GL_SGL_GNULIB_MDA_EXECVE@ +GL_SGL_GNULIB_MDA_EXECVP = @GL_SGL_GNULIB_MDA_EXECVP@ +GL_SGL_GNULIB_MDA_EXECVPE = @GL_SGL_GNULIB_MDA_EXECVPE@ +GL_SGL_GNULIB_MDA_FCLOSEALL = @GL_SGL_GNULIB_MDA_FCLOSEALL@ +GL_SGL_GNULIB_MDA_FCVT = @GL_SGL_GNULIB_MDA_FCVT@ +GL_SGL_GNULIB_MDA_FDOPEN = @GL_SGL_GNULIB_MDA_FDOPEN@ +GL_SGL_GNULIB_MDA_FILENO = @GL_SGL_GNULIB_MDA_FILENO@ +GL_SGL_GNULIB_MDA_GCVT = @GL_SGL_GNULIB_MDA_GCVT@ +GL_SGL_GNULIB_MDA_GETCWD = @GL_SGL_GNULIB_MDA_GETCWD@ +GL_SGL_GNULIB_MDA_GETPID = @GL_SGL_GNULIB_MDA_GETPID@ +GL_SGL_GNULIB_MDA_GETW = @GL_SGL_GNULIB_MDA_GETW@ +GL_SGL_GNULIB_MDA_ISATTY = @GL_SGL_GNULIB_MDA_ISATTY@ +GL_SGL_GNULIB_MDA_LSEEK = @GL_SGL_GNULIB_MDA_LSEEK@ +GL_SGL_GNULIB_MDA_MEMCCPY = @GL_SGL_GNULIB_MDA_MEMCCPY@ +GL_SGL_GNULIB_MDA_MKDIR = @GL_SGL_GNULIB_MDA_MKDIR@ +GL_SGL_GNULIB_MDA_MKTEMP = @GL_SGL_GNULIB_MDA_MKTEMP@ +GL_SGL_GNULIB_MDA_OPEN = @GL_SGL_GNULIB_MDA_OPEN@ +GL_SGL_GNULIB_MDA_PUTENV = @GL_SGL_GNULIB_MDA_PUTENV@ +GL_SGL_GNULIB_MDA_PUTW = @GL_SGL_GNULIB_MDA_PUTW@ +GL_SGL_GNULIB_MDA_READ = @GL_SGL_GNULIB_MDA_READ@ +GL_SGL_GNULIB_MDA_RMDIR = @GL_SGL_GNULIB_MDA_RMDIR@ +GL_SGL_GNULIB_MDA_STRDUP = @GL_SGL_GNULIB_MDA_STRDUP@ +GL_SGL_GNULIB_MDA_SWAB = @GL_SGL_GNULIB_MDA_SWAB@ +GL_SGL_GNULIB_MDA_TEMPNAM = @GL_SGL_GNULIB_MDA_TEMPNAM@ +GL_SGL_GNULIB_MDA_TZSET = @GL_SGL_GNULIB_MDA_TZSET@ +GL_SGL_GNULIB_MDA_UMASK = @GL_SGL_GNULIB_MDA_UMASK@ +GL_SGL_GNULIB_MDA_UNLINK = @GL_SGL_GNULIB_MDA_UNLINK@ +GL_SGL_GNULIB_MDA_WCSDUP = @GL_SGL_GNULIB_MDA_WCSDUP@ +GL_SGL_GNULIB_MDA_WRITE = @GL_SGL_GNULIB_MDA_WRITE@ +GL_SGL_GNULIB_MEMCHR = @GL_SGL_GNULIB_MEMCHR@ +GL_SGL_GNULIB_MEMMEM = @GL_SGL_GNULIB_MEMMEM@ +GL_SGL_GNULIB_MEMPCPY = @GL_SGL_GNULIB_MEMPCPY@ +GL_SGL_GNULIB_MEMRCHR = @GL_SGL_GNULIB_MEMRCHR@ +GL_SGL_GNULIB_MKDIR = @GL_SGL_GNULIB_MKDIR@ +GL_SGL_GNULIB_MKDIRAT = @GL_SGL_GNULIB_MKDIRAT@ +GL_SGL_GNULIB_MKDTEMP = @GL_SGL_GNULIB_MKDTEMP@ +GL_SGL_GNULIB_MKFIFO = @GL_SGL_GNULIB_MKFIFO@ +GL_SGL_GNULIB_MKFIFOAT = @GL_SGL_GNULIB_MKFIFOAT@ +GL_SGL_GNULIB_MKNOD = @GL_SGL_GNULIB_MKNOD@ +GL_SGL_GNULIB_MKNODAT = @GL_SGL_GNULIB_MKNODAT@ +GL_SGL_GNULIB_MKOSTEMP = @GL_SGL_GNULIB_MKOSTEMP@ +GL_SGL_GNULIB_MKOSTEMPS = @GL_SGL_GNULIB_MKOSTEMPS@ +GL_SGL_GNULIB_MKSTEMP = @GL_SGL_GNULIB_MKSTEMP@ +GL_SGL_GNULIB_MKSTEMPS = @GL_SGL_GNULIB_MKSTEMPS@ +GL_SGL_GNULIB_MKTIME = @GL_SGL_GNULIB_MKTIME@ +GL_SGL_GNULIB_NANOSLEEP = @GL_SGL_GNULIB_NANOSLEEP@ +GL_SGL_GNULIB_NONBLOCKING = @GL_SGL_GNULIB_NONBLOCKING@ +GL_SGL_GNULIB_OBSTACK_PRINTF = @GL_SGL_GNULIB_OBSTACK_PRINTF@ +GL_SGL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_SGL_GNULIB_OBSTACK_PRINTF_POSIX@ +GL_SGL_GNULIB_OPEN = @GL_SGL_GNULIB_OPEN@ +GL_SGL_GNULIB_OPENAT = @GL_SGL_GNULIB_OPENAT@ +GL_SGL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_SGL_GNULIB_OVERRIDES_STRUCT_STAT@ +GL_SGL_GNULIB_PCLOSE = @GL_SGL_GNULIB_PCLOSE@ +GL_SGL_GNULIB_PERROR = @GL_SGL_GNULIB_PERROR@ +GL_SGL_GNULIB_PIPE = @GL_SGL_GNULIB_PIPE@ +GL_SGL_GNULIB_PIPE2 = @GL_SGL_GNULIB_PIPE2@ +GL_SGL_GNULIB_POPEN = @GL_SGL_GNULIB_POPEN@ +GL_SGL_GNULIB_POSIX_MEMALIGN = @GL_SGL_GNULIB_POSIX_MEMALIGN@ +GL_SGL_GNULIB_POSIX_OPENPT = @GL_SGL_GNULIB_POSIX_OPENPT@ +GL_SGL_GNULIB_PREAD = @GL_SGL_GNULIB_PREAD@ +GL_SGL_GNULIB_PRINTF = @GL_SGL_GNULIB_PRINTF@ +GL_SGL_GNULIB_PRINTF_POSIX = @GL_SGL_GNULIB_PRINTF_POSIX@ +GL_SGL_GNULIB_PTSNAME = @GL_SGL_GNULIB_PTSNAME@ +GL_SGL_GNULIB_PTSNAME_R = @GL_SGL_GNULIB_PTSNAME_R@ +GL_SGL_GNULIB_PUTC = @GL_SGL_GNULIB_PUTC@ +GL_SGL_GNULIB_PUTCHAR = @GL_SGL_GNULIB_PUTCHAR@ +GL_SGL_GNULIB_PUTENV = @GL_SGL_GNULIB_PUTENV@ +GL_SGL_GNULIB_PUTS = @GL_SGL_GNULIB_PUTS@ +GL_SGL_GNULIB_PWRITE = @GL_SGL_GNULIB_PWRITE@ +GL_SGL_GNULIB_QSORT_R = @GL_SGL_GNULIB_QSORT_R@ +GL_SGL_GNULIB_RANDOM = @GL_SGL_GNULIB_RANDOM@ +GL_SGL_GNULIB_RANDOM_R = @GL_SGL_GNULIB_RANDOM_R@ +GL_SGL_GNULIB_RAWMEMCHR = @GL_SGL_GNULIB_RAWMEMCHR@ +GL_SGL_GNULIB_READ = @GL_SGL_GNULIB_READ@ +GL_SGL_GNULIB_READLINK = @GL_SGL_GNULIB_READLINK@ +GL_SGL_GNULIB_READLINKAT = @GL_SGL_GNULIB_READLINKAT@ +GL_SGL_GNULIB_REALLOCARRAY = @GL_SGL_GNULIB_REALLOCARRAY@ +GL_SGL_GNULIB_REALLOC_GNU = @GL_SGL_GNULIB_REALLOC_GNU@ +GL_SGL_GNULIB_REALLOC_POSIX = @GL_SGL_GNULIB_REALLOC_POSIX@ +GL_SGL_GNULIB_REALPATH = @GL_SGL_GNULIB_REALPATH@ +GL_SGL_GNULIB_REMOVE = @GL_SGL_GNULIB_REMOVE@ +GL_SGL_GNULIB_RENAME = @GL_SGL_GNULIB_RENAME@ +GL_SGL_GNULIB_RENAMEAT = @GL_SGL_GNULIB_RENAMEAT@ +GL_SGL_GNULIB_RMDIR = @GL_SGL_GNULIB_RMDIR@ +GL_SGL_GNULIB_RPMATCH = @GL_SGL_GNULIB_RPMATCH@ +GL_SGL_GNULIB_SCANF = @GL_SGL_GNULIB_SCANF@ +GL_SGL_GNULIB_SECURE_GETENV = @GL_SGL_GNULIB_SECURE_GETENV@ +GL_SGL_GNULIB_SETENV = @GL_SGL_GNULIB_SETENV@ +GL_SGL_GNULIB_SETHOSTNAME = @GL_SGL_GNULIB_SETHOSTNAME@ +GL_SGL_GNULIB_SIGABBREV_NP = @GL_SGL_GNULIB_SIGABBREV_NP@ +GL_SGL_GNULIB_SIGDESCR_NP = @GL_SGL_GNULIB_SIGDESCR_NP@ +GL_SGL_GNULIB_SLEEP = @GL_SGL_GNULIB_SLEEP@ +GL_SGL_GNULIB_SNPRINTF = @GL_SGL_GNULIB_SNPRINTF@ +GL_SGL_GNULIB_SPRINTF_POSIX = @GL_SGL_GNULIB_SPRINTF_POSIX@ +GL_SGL_GNULIB_STAT = @GL_SGL_GNULIB_STAT@ +GL_SGL_GNULIB_STDIO_H_NONBLOCKING = @GL_SGL_GNULIB_STDIO_H_NONBLOCKING@ +GL_SGL_GNULIB_STDIO_H_SIGPIPE = @GL_SGL_GNULIB_STDIO_H_SIGPIPE@ +GL_SGL_GNULIB_STPCPY = @GL_SGL_GNULIB_STPCPY@ +GL_SGL_GNULIB_STPNCPY = @GL_SGL_GNULIB_STPNCPY@ +GL_SGL_GNULIB_STRCASESTR = @GL_SGL_GNULIB_STRCASESTR@ +GL_SGL_GNULIB_STRCHRNUL = @GL_SGL_GNULIB_STRCHRNUL@ +GL_SGL_GNULIB_STRDUP = @GL_SGL_GNULIB_STRDUP@ +GL_SGL_GNULIB_STRERROR = @GL_SGL_GNULIB_STRERROR@ +GL_SGL_GNULIB_STRERRORNAME_NP = @GL_SGL_GNULIB_STRERRORNAME_NP@ +GL_SGL_GNULIB_STRERROR_R = @GL_SGL_GNULIB_STRERROR_R@ +GL_SGL_GNULIB_STRFTIME = @GL_SGL_GNULIB_STRFTIME@ +GL_SGL_GNULIB_STRNCAT = @GL_SGL_GNULIB_STRNCAT@ +GL_SGL_GNULIB_STRNDUP = @GL_SGL_GNULIB_STRNDUP@ +GL_SGL_GNULIB_STRNLEN = @GL_SGL_GNULIB_STRNLEN@ +GL_SGL_GNULIB_STRPBRK = @GL_SGL_GNULIB_STRPBRK@ +GL_SGL_GNULIB_STRPTIME = @GL_SGL_GNULIB_STRPTIME@ +GL_SGL_GNULIB_STRSEP = @GL_SGL_GNULIB_STRSEP@ +GL_SGL_GNULIB_STRSIGNAL = @GL_SGL_GNULIB_STRSIGNAL@ +GL_SGL_GNULIB_STRSTR = @GL_SGL_GNULIB_STRSTR@ +GL_SGL_GNULIB_STRTOD = @GL_SGL_GNULIB_STRTOD@ +GL_SGL_GNULIB_STRTOIMAX = @GL_SGL_GNULIB_STRTOIMAX@ +GL_SGL_GNULIB_STRTOK_R = @GL_SGL_GNULIB_STRTOK_R@ +GL_SGL_GNULIB_STRTOL = @GL_SGL_GNULIB_STRTOL@ +GL_SGL_GNULIB_STRTOLD = @GL_SGL_GNULIB_STRTOLD@ +GL_SGL_GNULIB_STRTOLL = @GL_SGL_GNULIB_STRTOLL@ +GL_SGL_GNULIB_STRTOUL = @GL_SGL_GNULIB_STRTOUL@ +GL_SGL_GNULIB_STRTOULL = @GL_SGL_GNULIB_STRTOULL@ +GL_SGL_GNULIB_STRTOUMAX = @GL_SGL_GNULIB_STRTOUMAX@ +GL_SGL_GNULIB_STRVERSCMP = @GL_SGL_GNULIB_STRVERSCMP@ +GL_SGL_GNULIB_SYMLINK = @GL_SGL_GNULIB_SYMLINK@ +GL_SGL_GNULIB_SYMLINKAT = @GL_SGL_GNULIB_SYMLINKAT@ +GL_SGL_GNULIB_SYSTEM_POSIX = @GL_SGL_GNULIB_SYSTEM_POSIX@ +GL_SGL_GNULIB_TIMEGM = @GL_SGL_GNULIB_TIMEGM@ +GL_SGL_GNULIB_TIMESPEC_GET = @GL_SGL_GNULIB_TIMESPEC_GET@ +GL_SGL_GNULIB_TIMESPEC_GETRES = @GL_SGL_GNULIB_TIMESPEC_GETRES@ +GL_SGL_GNULIB_TIME_R = @GL_SGL_GNULIB_TIME_R@ +GL_SGL_GNULIB_TIME_RZ = @GL_SGL_GNULIB_TIME_RZ@ +GL_SGL_GNULIB_TMPFILE = @GL_SGL_GNULIB_TMPFILE@ +GL_SGL_GNULIB_TRUNCATE = @GL_SGL_GNULIB_TRUNCATE@ +GL_SGL_GNULIB_TTYNAME_R = @GL_SGL_GNULIB_TTYNAME_R@ +GL_SGL_GNULIB_TZSET = @GL_SGL_GNULIB_TZSET@ +GL_SGL_GNULIB_UNISTD_H_GETOPT = @GL_SGL_GNULIB_UNISTD_H_GETOPT@ +GL_SGL_GNULIB_UNISTD_H_NONBLOCKING = @GL_SGL_GNULIB_UNISTD_H_NONBLOCKING@ +GL_SGL_GNULIB_UNISTD_H_SIGPIPE = @GL_SGL_GNULIB_UNISTD_H_SIGPIPE@ +GL_SGL_GNULIB_UNLINK = @GL_SGL_GNULIB_UNLINK@ +GL_SGL_GNULIB_UNLINKAT = @GL_SGL_GNULIB_UNLINKAT@ +GL_SGL_GNULIB_UNLOCKPT = @GL_SGL_GNULIB_UNLOCKPT@ +GL_SGL_GNULIB_UNSETENV = @GL_SGL_GNULIB_UNSETENV@ +GL_SGL_GNULIB_USLEEP = @GL_SGL_GNULIB_USLEEP@ +GL_SGL_GNULIB_UTIMENSAT = @GL_SGL_GNULIB_UTIMENSAT@ +GL_SGL_GNULIB_VASPRINTF = @GL_SGL_GNULIB_VASPRINTF@ +GL_SGL_GNULIB_VDPRINTF = @GL_SGL_GNULIB_VDPRINTF@ +GL_SGL_GNULIB_VFPRINTF = @GL_SGL_GNULIB_VFPRINTF@ +GL_SGL_GNULIB_VFPRINTF_POSIX = @GL_SGL_GNULIB_VFPRINTF_POSIX@ +GL_SGL_GNULIB_VFSCANF = @GL_SGL_GNULIB_VFSCANF@ +GL_SGL_GNULIB_VPRINTF = @GL_SGL_GNULIB_VPRINTF@ +GL_SGL_GNULIB_VPRINTF_POSIX = @GL_SGL_GNULIB_VPRINTF_POSIX@ +GL_SGL_GNULIB_VSCANF = @GL_SGL_GNULIB_VSCANF@ +GL_SGL_GNULIB_VSNPRINTF = @GL_SGL_GNULIB_VSNPRINTF@ +GL_SGL_GNULIB_VSPRINTF_POSIX = @GL_SGL_GNULIB_VSPRINTF_POSIX@ +GL_SGL_GNULIB_WCPCPY = @GL_SGL_GNULIB_WCPCPY@ +GL_SGL_GNULIB_WCPNCPY = @GL_SGL_GNULIB_WCPNCPY@ +GL_SGL_GNULIB_WCRTOMB = @GL_SGL_GNULIB_WCRTOMB@ +GL_SGL_GNULIB_WCSCASECMP = @GL_SGL_GNULIB_WCSCASECMP@ +GL_SGL_GNULIB_WCSCAT = @GL_SGL_GNULIB_WCSCAT@ +GL_SGL_GNULIB_WCSCHR = @GL_SGL_GNULIB_WCSCHR@ +GL_SGL_GNULIB_WCSCMP = @GL_SGL_GNULIB_WCSCMP@ +GL_SGL_GNULIB_WCSCOLL = @GL_SGL_GNULIB_WCSCOLL@ +GL_SGL_GNULIB_WCSCPY = @GL_SGL_GNULIB_WCSCPY@ +GL_SGL_GNULIB_WCSCSPN = @GL_SGL_GNULIB_WCSCSPN@ +GL_SGL_GNULIB_WCSDUP = @GL_SGL_GNULIB_WCSDUP@ +GL_SGL_GNULIB_WCSFTIME = @GL_SGL_GNULIB_WCSFTIME@ +GL_SGL_GNULIB_WCSLEN = @GL_SGL_GNULIB_WCSLEN@ +GL_SGL_GNULIB_WCSNCASECMP = @GL_SGL_GNULIB_WCSNCASECMP@ +GL_SGL_GNULIB_WCSNCAT = @GL_SGL_GNULIB_WCSNCAT@ +GL_SGL_GNULIB_WCSNCMP = @GL_SGL_GNULIB_WCSNCMP@ +GL_SGL_GNULIB_WCSNCPY = @GL_SGL_GNULIB_WCSNCPY@ +GL_SGL_GNULIB_WCSNLEN = @GL_SGL_GNULIB_WCSNLEN@ +GL_SGL_GNULIB_WCSNRTOMBS = @GL_SGL_GNULIB_WCSNRTOMBS@ +GL_SGL_GNULIB_WCSPBRK = @GL_SGL_GNULIB_WCSPBRK@ +GL_SGL_GNULIB_WCSRCHR = @GL_SGL_GNULIB_WCSRCHR@ +GL_SGL_GNULIB_WCSRTOMBS = @GL_SGL_GNULIB_WCSRTOMBS@ +GL_SGL_GNULIB_WCSSPN = @GL_SGL_GNULIB_WCSSPN@ +GL_SGL_GNULIB_WCSSTR = @GL_SGL_GNULIB_WCSSTR@ +GL_SGL_GNULIB_WCSTOK = @GL_SGL_GNULIB_WCSTOK@ +GL_SGL_GNULIB_WCSWIDTH = @GL_SGL_GNULIB_WCSWIDTH@ +GL_SGL_GNULIB_WCSXFRM = @GL_SGL_GNULIB_WCSXFRM@ +GL_SGL_GNULIB_WCTOB = @GL_SGL_GNULIB_WCTOB@ +GL_SGL_GNULIB_WCTOMB = @GL_SGL_GNULIB_WCTOMB@ +GL_SGL_GNULIB_WCWIDTH = @GL_SGL_GNULIB_WCWIDTH@ +GL_SGL_GNULIB_WMEMCHR = @GL_SGL_GNULIB_WMEMCHR@ +GL_SGL_GNULIB_WMEMCMP = @GL_SGL_GNULIB_WMEMCMP@ +GL_SGL_GNULIB_WMEMCPY = @GL_SGL_GNULIB_WMEMCPY@ +GL_SGL_GNULIB_WMEMMOVE = @GL_SGL_GNULIB_WMEMMOVE@ +GL_SGL_GNULIB_WMEMPCPY = @GL_SGL_GNULIB_WMEMPCPY@ +GL_SGL_GNULIB_WMEMSET = @GL_SGL_GNULIB_WMEMSET@ +GL_SGL_GNULIB_WRITE = @GL_SGL_GNULIB_WRITE@ +GL_SGL_GNULIB__EXIT = @GL_SGL_GNULIB__EXIT@ +GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ @@ -406,43 +930,233 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ECVT = @HAVE_DECL_ECVT@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@ +HAVE_DECL_FCVT = @HAVE_DECL_FCVT@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GCVT = @HAVE_DECL_GCVT@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXECVPE = @HAVE_EXECVPE@ HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETENTROPY = @HAVE_GETENTROPY@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GETUMASK = @HAVE_GETUMASK@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ +HAVE_INITSTATE = @HAVE_INITSTATE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ -HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MBTOWC = @HAVE_MBTOWC@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SETSTATE = @HAVE_SETSTATE@ +HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ +HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOL = @HAVE_STRTOL@ +HAVE_STRTOLD = @HAVE_STRTOLD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOUL = @HAVE_STRTOUL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ +HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMPCPY = @HAVE_WMEMPCPY@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ HELP2MAN = @HELP2MAN@ HTML_DIR = @HTML_DIR@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -452,36 +1166,70 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTOOL = @LIBTOOL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ +LOG_VALGRIND = @LOG_VALGRIND@ +LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +MINOR_VERSION = @MINOR_VERSION@ MKDIR_P = @MKDIR_P@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ NM = @NM@ NMEDIT = @NMEDIT@ +NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ @@ -493,42 +1241,216 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PATCH_VERSION = @PATCH_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_ACCESS = @REPLACE_ACCESS@ +REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ +REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHMOD = @REPLACE_CHMOD@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@ +REPLACE_CREAT = @REPLACE_CREAT@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_EXECL = @REPLACE_EXECL@ +REPLACE_EXECLE = @REPLACE_EXECLE@ +REPLACE_EXECLP = @REPLACE_EXECLP@ +REPLACE_EXECV = @REPLACE_EXECV@ +REPLACE_EXECVE = @REPLACE_EXECVE@ +REPLACE_EXECVP = @REPLACE_EXECVP@ +REPLACE_EXECVPE = @REPLACE_EXECVPE@ +REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ +REPLACE_FCHMODAT = @REPLACE_FCHMODAT@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FFSLL = @REPLACE_FFSLL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREE = @REPLACE_FREE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ +REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_INITSTATE = @REPLACE_INITSTATE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@ +REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKNODAT = @REPLACE_MKNODAT@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RANDOM = @REPLACE_RANDOM@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@ +REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@ +REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETSTATE = @REPLACE_SETSTATE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOL = @REPLACE_STRTOL@ +REPLACE_STRTOLD = @REPLACE_STRTOLD@ +REPLACE_STRTOLL = @REPLACE_STRTOLL@ +REPLACE_STRTOUL = @REPLACE_STRTOUL@ +REPLACE_STRTOULL = @REPLACE_STRTOULL@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSTOK = @REPLACE_WCSTOK@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDCKDINT_H = @STDCKDINT_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ +VALGRINDFLAGS = @VALGRINDFLAGS@ +VALGRIND_PROGRAM = @VALGRIND_PROGRAM@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ @@ -556,8 +1478,10 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gl_LIBOBJDEPS = @gl_LIBOBJDEPS@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ @@ -585,6 +1509,13 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ +sgl_LIBOBJDEPS = @sgl_LIBOBJDEPS@ +sgl_LIBOBJS = @sgl_LIBOBJS@ +sgl_LTLIBOBJS = @sgl_LTLIBOBJS@ +sgltests_LIBOBJDEPS = @sgltests_LIBOBJDEPS@ +sgltests_LIBOBJS = @sgltests_LIBOBJS@ +sgltests_LTLIBOBJS = @sgltests_LTLIBOBJS@ +sgltests_WITNESS = @sgltests_WITNESS@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ @@ -597,6 +1528,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAG_VISIBILITY) $(CODE_COVERAGE_ AM_CPPFLAGS = -I$(builddir)/gl -I$(srcdir)/gl -I$(builddir)/includes -I$(srcdir)/includes\ -DASN1_BUILDING $(CODE_COVERAGE_CPPFLAGS) +AM_YFLAGS = -Wno-yacc include_HEADERS = includes/libtasn1.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libtasn1.pc @@ -622,7 +1554,11 @@ libtasn1_la_SOURCES = \ libtasn1_la_LIBADD = gl/libgnu.la libtasn1_la_LDFLAGS = -no-undefined -version-info \ $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - $(CODE_COVERAGE_LDFLAGS) $(am__append_1) $(am__append_2) + $(CODE_COVERAGE_LDFLAGS) $(am__append_1) $(am__append_2) \ + $(am__append_3) +@HAVE_LD_OUTPUT_DEF_TRUE@defexecdir = $(libdir) +@HAVE_LD_OUTPUT_DEF_TRUE@defexec_DATA = libtasn1-$(DLL_VERSION).def +@HAVE_LD_OUTPUT_DEF_TRUE@DISTCLEANFILES = $(defexec_DATA) all: all-recursive .SUFFIXES: @@ -636,9 +1572,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign lib/Makefile + $(AUTOMAKE) --gnu lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -748,6 +1684,27 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-defexecDATA: $(defexec_DATA) + @$(NORMAL_INSTALL) + @list='$(defexec_DATA)'; test -n "$(defexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(defexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(defexecdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(defexecdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(defexecdir)" || exit $$?; \ + done + +uninstall-defexecDATA: + @$(NORMAL_UNINSTALL) + @list='$(defexec_DATA)'; test -n "$(defexecdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(defexecdir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ @@ -889,7 +1846,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -953,7 +1909,7 @@ check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(defexecdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -982,6 +1938,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1024,7 +1981,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-libLTLIBRARIES +install-exec-am: install-defexecDATA install-libLTLIBRARIES install-html: install-html-recursive @@ -1072,8 +2029,8 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ - uninstall-pkgconfigDATA +uninstall-am: uninstall-defexecDATA uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip @@ -1083,8 +2040,8 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am \ + install-data-am install-defexecDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ @@ -1092,11 +2049,12 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-includeHEADERS uninstall-libLTLIBRARIES \ - uninstall-pkgconfigDATA + uninstall-defexecDATA uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA .PRECIOUS: Makefile +@HAVE_LD_OUTPUT_DEF_TRUE@libtasn1-$(DLL_VERSION).def: libtasn1.la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/lib/coding.c b/lib/coding.c index 46e67ff..ea5bc37 100644 --- a/lib/coding.c +++ b/lib/coding.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -121,7 +121,7 @@ asn1_length_der (unsigned long int len, unsigned char *der, int *der_len) /******************************************************/ static void _asn1_tag_der (unsigned char class, unsigned int tag_value, - unsigned char *ans, int *ans_len) + unsigned char ans[ASN1_MAX_TAG_SIZE], int *ans_len) { int k; unsigned char temp[ASN1_MAX_TAG_SIZE]; @@ -265,9 +265,6 @@ _asn1_time_der (unsigned char *str, int str_len, unsigned char *der, int len_len; int max_len; - if (der == NULL) - return ASN1_VALUE_NOT_VALID; - max_len = *der_len; asn1_length_der (str_len, (max_len > 0) ? der : NULL, &len_len); @@ -295,7 +292,8 @@ _asn1_get_utctime_der(unsigned char *der,int *der_len,unsigned char *str) if (str_len<0) return; memcpy(temp,der+len_len,str_len); *der_len=str_len+len_len; - switch(str_len){ + switch(str_len) + { case 11: temp[10]=0; strcat(temp,"00+0000"); @@ -319,8 +317,30 @@ _asn1_get_utctime_der(unsigned char *der,int *der_len,unsigned char *str) } */ +static void +encode_val (uint64_t val, unsigned char *der, int max_len, int *der_len) +{ + int first, k; + unsigned char bit7; + + first = 0; + for (k = sizeof (val); k >= 0; k--) + { + bit7 = (val >> (k * 7)) & 0x7F; + if (bit7 || first || !k) + { + if (k) + bit7 |= 0x80; + if (max_len > (*der_len)) + der[*der_len] = bit7; + (*der_len)++; + first = 1; + } + } +} + /******************************************************/ -/* Function : _asn1_objectid_der */ +/* Function : _asn1_object_id_der */ /* Description: creates the DER coding for an */ /* OBJECT IDENTIFIER type (length included). */ /* Parameters: */ @@ -335,15 +355,15 @@ _asn1_get_utctime_der(unsigned char *der,int *der_len,unsigned char *str) /* or an error value. */ /******************************************************/ static int -_asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len) +_asn1_object_id_der (const char *str, unsigned char *der, int *der_len) { - int len_len, counter, k, first, max_len; + int len_len, counter, max_len; char *temp, *n_end, *n_start; - unsigned char bit7; uint64_t val, val1 = 0; int str_len = _asn1_strlen (str); max_len = *der_len; + *der_len = 0; if (der == NULL && max_len > 0) return ASN1_VALUE_NOT_VALID; @@ -365,30 +385,30 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len) counter++; if (counter == 1) - val1 = val; - else if (counter == 2) { - if (max_len > 0) - der[0] = 40 * val1 + val; - *der_len = 1; + val1 = val; } - else + else if (counter == 2) { - first = 0; - for (k = sizeof(val); k >= 0; k--) + uint64_t val0; + + if (val1 > 2) { - bit7 = (val >> (k * 7)) & 0x7F; - if (bit7 || first || !k) - { - if (k) - bit7 |= 0x80; - if (max_len > (*der_len)) - der[*der_len] = bit7; - (*der_len)++; - first = 1; - } + free (temp); + return ASN1_VALUE_NOT_VALID; + } + else if ((val1 == 0 || val1 == 1) && val > 39) + { + free (temp); + return ASN1_VALUE_NOT_VALID; } + val0 = 40 * val1 + val; + encode_val (val0, der, max_len, der_len); + } + else + { + encode_val (val, der, max_len, der_len); } n_start = n_end + 1; } @@ -409,6 +429,48 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len) return ASN1_SUCCESS; } +/** + * asn1_object_id_der: + * @str: An object identifier in numeric, dot format. + * @der: buffer to hold the returned encoding (may be %NULL). + * @der_len: initially the size of @der; will hold the final size. + * @flags: must be zero + * + * Creates the DER encoding of the provided object identifier. + * + * Returns: %ASN1_SUCCESS if DER encoding was OK, %ASN1_VALUE_NOT_VALID + * if @str is not a valid OID, %ASN1_MEM_ERROR if the @der + * vector isn't big enough and in this case @der_len will contain the + * length needed. + **/ +int +asn1_object_id_der (const char *str, unsigned char *der, int *der_len, + unsigned flags) +{ + unsigned char tag_der[MAX_TAG_LEN]; + int tag_len = 0, r; + int max_len = *der_len; + + *der_len = 0; + + _asn1_tag_der (ETYPE_CLASS (ASN1_ETYPE_OBJECT_ID), + ETYPE_TAG (ASN1_ETYPE_OBJECT_ID), tag_der, &tag_len); + + if (max_len > tag_len) + { + memcpy (der, tag_der, tag_len); + } + max_len -= tag_len; + der += tag_len; + + r = _asn1_object_id_der (str, der, &max_len); + if (r == ASN1_MEM_ERROR || r == ASN1_SUCCESS) + { + *der_len = max_len + tag_len; + } + + return r; +} static const unsigned char bit_mask[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80 }; @@ -479,9 +541,8 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der, int is_tag_implicit, len2, len3; unsigned char temp[SIZEOF_UNSIGNED_INT]; - if (der == NULL && *max_len > 0) { + if (der == NULL && *max_len > 0) return ASN1_VALUE_NOT_VALID; - } is_tag_implicit = 0; @@ -489,7 +550,7 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der, { p = node->down; if (p == NULL) - return ASN1_DER_ERROR; + return ASN1_DER_ERROR; /* When there are nested tags we must complete them reverse to the order they were created. This is because completing a tag modifies all data within it, including the incomplete tags @@ -607,7 +668,8 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter, { asn1_node p; int tag_len, is_tag_implicit; - unsigned char class, class_implicit = 0, temp[MAX(SIZEOF_UNSIGNED_INT * 3 + 1, LTOSTR_MAX_SIZE)]; + unsigned char class, class_implicit = + 0, temp[MAX (SIZEOF_UNSIGNED_INT * 3 + 1, LTOSTR_MAX_SIZE)]; unsigned long tag_implicit = 0; unsigned char tag_der[MAX_TAG_LEN]; @@ -737,7 +799,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, asn1_node node) p = node->down; while (p && ((type_field (p->type) == ASN1_ETYPE_TAG) || - (type_field (p->type) == ASN1_ETYPE_SIZE))) + (type_field (p->type) == ASN1_ETYPE_SIZE))) p = p->right; if ((p == NULL) || (p->right == NULL)) @@ -748,7 +810,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, asn1_node node) { p_vet = malloc (sizeof (struct vet)); if (p_vet == NULL) - { + { err = ASN1_MEM_ALLOC_ERROR; goto error; } @@ -767,7 +829,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, asn1_node node) if (err != ASN1_SUCCESS) goto error; - t = ((unsigned int)class) << 24; + t = ((unsigned int) class) << 24; p_vet->value = t | tag; counter += len2; @@ -835,7 +897,7 @@ error: { p_vet = first; first = first->next; - free(p_vet); + free (p_vet); } return err; } @@ -846,7 +908,8 @@ struct vet int size; }; -static int setof_compar(const void *_e1, const void *_e2) +static int +setof_compar (const void *_e1, const void *_e2) { unsigned length; const struct vet *e1 = _e1, *e2 = _e2; @@ -859,15 +922,15 @@ static int setof_compar(const void *_e1, const void *_e2) * The padding octets are for comparison purposes and * do not appear in the encodings. */ - length = MIN(e1->size, e2->size); + length = MIN (e1->size, e2->size); - rval = memcmp(e1->ptr, e2->ptr, length); + rval = memcmp (e1->ptr, e2->ptr, length); if (rval == 0 && e1->size != e2->size) { if (e1->size > e2->size) - rval = 1; + rval = 1; else if (e2->size > e1->size) - rval = -1; + rval = -1; } return rval; @@ -897,9 +960,6 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node) unsigned char *out = NULL; int err; - if (der == NULL) - return ASN1_VALUE_NOT_VALID; - counter = 0; if (type_field (node->type) != ASN1_ETYPE_SET_OF) @@ -907,7 +967,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node) p = node->down; while (p && ((type_field (p->type) == ASN1_ETYPE_TAG) || - (type_field (p->type) == ASN1_ETYPE_SIZE))) + (type_field (p->type) == ASN1_ETYPE_SIZE))) p = p->right; if (p == NULL) return ASN1_VALUE_NOT_VALID; @@ -919,27 +979,27 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node) while (p) { list_size++; - tlist = realloc (list, list_size*sizeof(struct vet)); + tlist = realloc (list, list_size * sizeof (struct vet)); if (tlist == NULL) { err = ASN1_MEM_ALLOC_ERROR; goto error; } list = tlist; - p_vet = &list[list_size-1]; + p_vet = &list[list_size - 1]; - p_vet->ptr = der+counter; + p_vet->ptr = der + counter; p_vet->size = 0; /* extraction of tag and length */ if (der_len - counter > 0) { err = asn1_get_tag_der (der + counter, der_len - counter, &class, - &len, NULL); + &len, NULL); if (err != ASN1_SUCCESS) goto error; counter += len; - p_vet->size += len; + p_vet->size += len; len2 = asn1_get_length_der (der + counter, der_len - counter, &len); if (len2 < 0) @@ -948,7 +1008,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node) goto error; } counter += len + len2; - p_vet->size += len + len2; + p_vet->size += len + len2; } else @@ -965,9 +1025,9 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node) goto error; } - qsort(list, list_size, sizeof(struct vet), setof_compar); + qsort (list, list_size, sizeof (struct vet), setof_compar); - out = malloc(der_len); + out = malloc (der_len); if (out == NULL) { err = ASN1_MEM_ERROR; @@ -976,18 +1036,19 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node) /* the sum of p_vet->size == der_len */ counter = 0; - for (i=0;i<list_size;i++) { - p_vet = &list[i]; - memcpy(out+counter, p_vet->ptr, p_vet->size); - counter += p_vet->size; - } - memcpy(der, out, der_len); - free(out); + for (i = 0; i < list_size; i++) + { + p_vet = &list[i]; + memcpy (out + counter, p_vet->ptr, p_vet->size); + counter += p_vet->size; + } + memcpy (der, out, der_len); + free (out); err = ASN1_SUCCESS; error: - free(list); + free (list); return err; } @@ -1013,14 +1074,15 @@ error: * length needed. **/ int -asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len, - char *ErrorDescription) +asn1_der_coding (asn1_node_const element, const char *name, void *ider, + int *len, char *ErrorDescription) { asn1_node node, p, p2; - unsigned char temp[MAX(LTOSTR_MAX_SIZE, SIZEOF_UNSIGNED_LONG_INT * 3 + 1)]; + unsigned char temp[MAX (LTOSTR_MAX_SIZE, SIZEOF_UNSIGNED_LONG_INT * 3 + 1)]; int counter, counter_old, len2, len3, move, max_len, max_len_old; int err; unsigned char *der = ider; + unsigned char dummy; if (ErrorDescription) ErrorDescription[0] = 0; @@ -1040,7 +1102,10 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len max_len = *len; if (der == NULL && max_len > 0) - return ASN1_VALUE_NOT_VALID; + { + err = ASN1_VALUE_NOT_VALID; + goto error; + } counter = 0; move = DOWN; @@ -1053,7 +1118,7 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len max_len_old = max_len; if (move != UP) { - p->start = counter; + p->start = counter; err = _asn1_insert_tag_der (p, der, &counter, &max_len); if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR) goto error; @@ -1141,7 +1206,9 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len goto error; } len2 = max_len; - err = _asn1_objectid_der (p->value, der + counter, &len2); + err = + _asn1_object_id_der ((char *) p->value, + der ? der + counter : &dummy, &len2); if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR) goto error; @@ -1159,7 +1226,9 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len goto error; } len2 = max_len; - err = _asn1_time_der (p->value, p->value_len, der + counter, &len2); + err = + _asn1_time_der (p->value, p->value_len, + der ? der + counter : &dummy, &len2); if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR) goto error; @@ -1227,7 +1296,9 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len p->tmp_ival = 0; if ((type_field (p->type) == ASN1_ETYPE_SET) && (max_len >= 0)) { - err = _asn1_ordering_set (der + len2, counter - len2, p); + err = + _asn1_ordering_set (der ? der + len2 : &dummy, + counter - len2, p); if (err != ASN1_SUCCESS) goto error; } @@ -1268,7 +1339,9 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len if ((type_field (p->type) == ASN1_ETYPE_SET_OF) && (counter - len2 > 0) && (max_len >= 0)) { - err = _asn1_ordering_set_of (der + len2, counter - len2, p); + err = + _asn1_ordering_set_of (der ? der + len2 : &dummy, + counter - len2, p); if (err != ASN1_SUCCESS) goto error; } @@ -1309,7 +1382,7 @@ asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len if ((move != DOWN) && (counter != counter_old)) { - p->end = counter - 1; + p->end = counter - 1; err = _asn1_complete_explicit_tag (p, der, &counter, &max_len); if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR) goto error; diff --git a/lib/decoding.c b/lib/decoding.c index 56f9582..b9245c4 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2016 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -32,6 +32,7 @@ #include <element.h> #include <limits.h> #include <intprops.h> +#include "c-ctype.h" #ifdef DEBUG # define warn() fprintf(stderr, "%s: %d\n", __func__, __LINE__) @@ -45,8 +46,8 @@ /* Decoding flags (dflags) used in several decoding functions. * DECODE_FLAG_HAVE_TAG: The provided buffer includes a tag - * DECODE_FLAG_INDEFINITE: The provided buffer is of indefinite encoding (useful - * when no tags are present). + * DECODE_FLAG_CONSTRUCTED: The provided buffer is of indefinite encoding (useful + * when no tags are present). * DECODE_FLAG_LEVEL1: Internal flag to indicate a level of recursion for BER strings. * DECODE_FLAG_LEVEL2: Internal flag to indicate two levels of recursion for BER strings. * DECODE_FLAG_LEVEL3: Internal flag to indicate three levels of recursion for BER strings. @@ -55,7 +56,7 @@ */ #define DECODE_FLAG_HAVE_TAG 1 -#define DECODE_FLAG_INDEFINITE (1<<1) +#define DECODE_FLAG_CONSTRUCTED (1<<1) #define DECODE_FLAG_LEVEL1 (1<<2) #define DECODE_FLAG_LEVEL2 (1<<3) #define DECODE_FLAG_LEVEL3 (1<<4) @@ -70,18 +71,19 @@ } while (0) static int -_asn1_get_indefinite_length_string (const unsigned char *der, int der_len, int *len); +_asn1_get_indefinite_length_string (const unsigned char *der, int der_len, + int *len); static int _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, - unsigned int _der_len, unsigned char **str, - unsigned int *str_len, unsigned int *ber_len, - unsigned dflags); + unsigned int _der_len, unsigned char **str, + unsigned int *str_len, unsigned int *ber_len, + unsigned dflags); static int _asn1_decode_simple_der (unsigned int etype, const unsigned char *der, - unsigned int _der_len, const unsigned char **str, - unsigned int *str_len, unsigned dflags); + unsigned int _der_len, const unsigned char **str, + unsigned int *str_len, unsigned dflags); static void _asn1_error_description_tag_error (asn1_node node, char *ErrorDescription) @@ -128,7 +130,7 @@ asn1_get_length_der (const unsigned char *der, int der_len, int *len) k = der[0] & 0x7F; punt = 1; if (k) - { /* definite length method */ + { /* definite length method */ ans = 0; while (punt <= k && punt < der_len) { @@ -251,9 +253,10 @@ asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len) long err; ret = asn1_get_length_der (ber, ber_len, len); + if (ret == -1 && ber_len > 1) { /* indefinite length method */ - err = _asn1_get_indefinite_length_string (ber + 1, ber_len-1, &ret); + err = _asn1_get_indefinite_length_string (ber + 1, ber_len - 1, &ret); if (err != ASN1_SUCCESS) return -3; } @@ -295,7 +298,7 @@ asn1_get_octet_der (const unsigned char *der, int der_len, if (str_size >= *str_len) { if (*str_len > 0 && str != NULL) - memcpy (str, der + len_len, *str_len); + memcpy (str, der + len_len, *str_len); } else { @@ -323,8 +326,8 @@ asn1_get_octet_der (const unsigned char *der, int der_len, * Returns: %ASN1_SUCCESS on success, or an error. -*/ static int -_asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *ret_len, - char *str, int str_size, unsigned flags) +_asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, + int *ret_len, char *str, int str_size, unsigned flags) { int len_len, str_len; unsigned i; @@ -342,46 +345,47 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r /* perform some sanity checks on the data */ if (str_len < 8) { - warn(); + warn (); return ASN1_TIME_ENCODING_ERROR; } - if ((flags & ASN1_DECODE_FLAG_STRICT_DER) && !(flags & ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME)) + if ((flags & ASN1_DECODE_FLAG_STRICT_DER) + && !(flags & ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME)) { p = &der[len_len]; - for (i=0;i<(unsigned)(str_len-1);i++) - { - if (isdigit(p[i]) == 0) - { - if (type == ASN1_ETYPE_GENERALIZED_TIME) - { - /* tolerate lax encodings */ - if (p[i] == '.' && dot_count == 0) - { - dot_count++; - continue; - } - - /* This is not really valid DER, but there are - * structures using that */ - if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) && - (p[i] == '+' || p[i] == '-') && sign_count == 0) - { - sign_count++; - continue; - } - } - - warn(); - return ASN1_TIME_ENCODING_ERROR; - } - } - - if (sign_count == 0 && p[str_len-1] != 'Z') - { - warn(); - return ASN1_TIME_ENCODING_ERROR; - } + for (i = 0; i < (unsigned) (str_len - 1); i++) + { + if (c_isdigit (p[i]) == 0) + { + if (type == ASN1_ETYPE_GENERALIZED_TIME) + { + /* tolerate lax encodings */ + if (p[i] == '.' && dot_count == 0) + { + dot_count++; + continue; + } + + /* This is not really valid DER, but there are + * structures using that */ + if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) && + (p[i] == '+' || p[i] == '-') && sign_count == 0) + { + sign_count++; + continue; + } + } + + warn (); + return ASN1_TIME_ENCODING_ERROR; + } + } + + if (sign_count == 0 && p[str_len - 1] != 'Z') + { + warn (); + return ASN1_TIME_ENCODING_ERROR; + } } memcpy (str, der + len_len, str_len); str[str_len] = 0; @@ -408,9 +412,9 @@ asn1_get_object_id_der (const unsigned char *der, int der_len, int *ret_len, char *str, int str_size) { int len_len, len, k; - int leading; + int leading, parsed; char temp[LTOSTR_MAX_SIZE]; - uint64_t val, val1; + uint64_t val, val1, val0; *ret_len = 0; if (str && str_size > 0) @@ -424,16 +428,48 @@ asn1_get_object_id_der (const unsigned char *der, int der_len, int *ret_len, if (len <= 0 || len + len_len > der_len) return ASN1_DER_ERROR; - val1 = der[len_len] / 40; - val = der[len_len] - val1 * 40; + /* leading octet can never be 0x80 */ + if (der[len_len] == 0x80) + return ASN1_DER_ERROR; + + val0 = 0; + + for (k = 0; k < len; k++) + { + if (INT_LEFT_SHIFT_OVERFLOW (val0, 7)) + return ASN1_DER_ERROR; - _asn1_str_cpy (str, str_size, _asn1_ltostr (val1, temp)); + val0 <<= 7; + val0 |= der[len_len + k] & 0x7F; + if (!(der[len_len + k] & 0x80)) + break; + } + parsed = ++k; + + /* val0 = (X*40) + Y, X={0,1,2}, Y<=39 when X={0,1} */ + /* X = val, Y = val1 */ + + /* check if X == 0 */ + val = 0; + val1 = val0; + if (val1 > 39) + { + val = 1; + val1 = val0 - 40; + if (val1 > 39) + { + val = 2; + val1 = val0 - 80; + } + } + + _asn1_str_cpy (str, str_size, _asn1_ltostr (val, temp)); _asn1_str_cat (str, str_size, "."); - _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp)); + _asn1_str_cat (str, str_size, _asn1_ltostr (val1, temp)); val = 0; leading = 1; - for (k = 1; k < len; k++) + for (k = parsed; k < len; k++) { /* X.690 mandates that the leading byte must never be 0x80 */ @@ -501,7 +537,7 @@ asn1_get_bit_der (const unsigned char *der, int der_len, if (str_size >= len_byte) { if (len_byte > 0 && str) - memcpy (str, der + len_len + 1, len_byte); + memcpy (str, der + len_len + 1, len_byte); } else { @@ -552,21 +588,19 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len, &tag) != ASN1_SUCCESS) return ASN1_DER_ERROR; - DECR_LEN(der_len, len2); + DECR_LEN (der_len, len2); counter += len2; if (flags & ASN1_DECODE_FLAG_STRICT_DER) len3 = - asn1_get_length_der (der + counter, der_len, - &len2); + asn1_get_length_der (der + counter, der_len, &len2); else len3 = - asn1_get_length_ber (der + counter, der_len, - &len2); + asn1_get_length_ber (der + counter, der_len, &len2); if (len3 < 0) return ASN1_DER_ERROR; - DECR_LEN(der_len, len2); + DECR_LEN (der_len, len2); counter += len2; if (!is_tag_implicit) @@ -604,11 +638,10 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len, if (is_tag_implicit) { if (asn1_get_tag_der - (der + counter, der_len, &class, &len2, - &tag) != ASN1_SUCCESS) + (der + counter, der_len, &class, &len2, &tag) != ASN1_SUCCESS) return ASN1_DER_ERROR; - DECR_LEN(der_len, len2); + DECR_LEN (der_len, len2); if ((class != class_implicit) || (tag != tag_implicit)) { @@ -634,11 +667,10 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len, } if (asn1_get_tag_der - (der + counter, der_len, &class, &len2, - &tag) != ASN1_SUCCESS) + (der + counter, der_len, &class, &len2, &tag) != ASN1_SUCCESS) return ASN1_DER_ERROR; - DECR_LEN(der_len, len2); + DECR_LEN (der_len, len2); switch (type) { @@ -699,28 +731,32 @@ cleanup: } static int -extract_tag_der_recursive(asn1_node node, const unsigned char *der, int der_len, - int *ret_len, int *inner_len, unsigned flags) +extract_tag_der_recursive (asn1_node node, const unsigned char *der, + int der_len, int *ret_len, int *inner_len, + unsigned flags) { -asn1_node p; -int ris = ASN1_DER_ERROR; + asn1_node p; + int ris = ASN1_DER_ERROR; if (type_field (node->type) == ASN1_ETYPE_CHOICE) { p = node->down; while (p) - { - ris = _asn1_extract_tag_der (p, der, der_len, ret_len, inner_len, flags); - if (ris == ASN1_SUCCESS) - break; - p = p->right; + { + ris = + _asn1_extract_tag_der (p, der, der_len, ret_len, inner_len, + flags); + if (ris == ASN1_SUCCESS) + break; + p = p->right; } *ret_len = 0; return ris; } else - return _asn1_extract_tag_der (node, der, der_len, ret_len, inner_len, flags); + return _asn1_extract_tag_der (node, der, der_len, ret_len, inner_len, + flags); } static int @@ -795,10 +831,11 @@ _asn1_get_indefinite_length_string (const unsigned char *der, while (1) { - if (HAVE_TWO(der_len) && (der[counter] == 0) && (der[counter + 1] == 0)) + if (HAVE_TWO (der_len) && (der[counter] == 0) + && (der[counter + 1] == 0)) { counter += 2; - DECR_LEN(der_len, 2); + DECR_LEN (der_len, 2); indefinite--; if (indefinite <= 0) @@ -808,11 +845,10 @@ _asn1_get_indefinite_length_string (const unsigned char *der, } if (asn1_get_tag_der - (der + counter, der_len, &class, &len2, - &tag) != ASN1_SUCCESS) + (der + counter, der_len, &class, &len2, &tag) != ASN1_SUCCESS) return ASN1_DER_ERROR; - DECR_LEN(der_len, len2); + DECR_LEN (der_len, len2); counter += len2; len2 = asn1_get_length_der (der + counter, der_len, &len3); @@ -823,12 +859,12 @@ _asn1_get_indefinite_length_string (const unsigned char *der, { indefinite++; counter += 1; - DECR_LEN(der_len, 1); + DECR_LEN (der_len, 1); } else { counter += len2 + len3; - DECR_LEN(der_len, len2+len3); + DECR_LEN (der_len, len2 + len3); } } @@ -839,7 +875,8 @@ cleanup: return result; } -static void delete_unneeded_choice_fields(asn1_node p) +static void +delete_unneeded_choice_fields (asn1_node p) { asn1_node p2; @@ -878,13 +915,13 @@ static void delete_unneeded_choice_fields(asn1_node p) * name (*@ELEMENT deleted). **/ int -asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, +asn1_der_decoding2 (asn1_node * element, const void *ider, int *max_ider_len, unsigned int flags, char *errorDescription) { asn1_node node, p, p2, p3; char temp[128]; int counter, len2, len3, len4, move, ris, tlen; - struct node_tail_cache_st tcache = {NULL, NULL}; + struct node_tail_cache_st tcache = { NULL, NULL }; unsigned char class; unsigned long tag; int tag_len; @@ -905,7 +942,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (node->type & CONST_OPTION) { result = ASN1_GENERIC_ERROR; - warn(); + warn (); goto cleanup; } @@ -925,12 +962,13 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, len2 = p2->tmp_ival; if (len2 == -1) { - if (HAVE_TWO(ider_len) && !der[counter] && !der[counter + 1]) + if (HAVE_TWO (ider_len) && !der[counter] + && !der[counter + 1]) { p = p2; move = UP; counter += 2; - DECR_LEN(ider_len, 2); + DECR_LEN (ider_len, 2); continue; } } @@ -943,7 +981,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, else if (counter > len2) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } p2 = p2->down; @@ -952,8 +990,9 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED)) { ris = - extract_tag_der_recursive (p2, der + counter, - ider_len, &len2, NULL, flags); + extract_tag_der_recursive (p2, der + counter, + ider_len, &len2, NULL, + flags); if (ris == ASN1_SUCCESS) { p2->type &= ~CONST_NOT_USED; @@ -966,7 +1005,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (p2 == NULL) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } } @@ -1002,18 +1041,18 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, while (p->down) { ris = - extract_tag_der_recursive (p->down, der + counter, - ider_len, &len2, NULL, flags); + extract_tag_der_recursive (p->down, der + counter, + ider_len, &len2, NULL, flags); if (ris == ASN1_SUCCESS) { - delete_unneeded_choice_fields(p->down); + delete_unneeded_choice_fields (p->down); break; } else if (ris == ASN1_ERROR_TYPE_ANY) { result = ASN1_ERROR_TYPE_ANY; - warn(); + warn (); goto cleanup; } else @@ -1028,7 +1067,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (!(p->type & CONST_OPTION)) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } } @@ -1050,7 +1089,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (ris == ASN1_SUCCESS) ris = extract_tag_der_recursive (p, der + counter, ider_len, - &tag_len, &inner_tag_len, flags); + &tag_len, &inner_tag_len, flags); if (ris != ASN1_SUCCESS) { @@ -1070,13 +1109,13 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, _asn1_error_description_tag_error (p, errorDescription); result = ASN1_TAG_ERROR; - warn(); + warn (); goto cleanup; } } else { - DECR_LEN(ider_len, tag_len); + DECR_LEN (ider_len, tag_len); counter += tag_len; } } @@ -1086,23 +1125,23 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, switch (type_field (p->type)) { case ASN1_ETYPE_NULL: - DECR_LEN(ider_len, 1); + DECR_LEN (ider_len, 1); if (der[counter]) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } counter++; move = RIGHT; break; case ASN1_ETYPE_BOOLEAN: - DECR_LEN(ider_len, 2); + DECR_LEN (ider_len, 2); if (der[counter++] != 1) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } if (der[counter++] == 0) @@ -1113,16 +1152,15 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, break; case ASN1_ETYPE_INTEGER: case ASN1_ETYPE_ENUMERATED: - len2 = - asn1_get_length_der (der + counter, ider_len, &len3); + len2 = asn1_get_length_der (der + counter, ider_len, &len3); if (len2 < 0) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - DECR_LEN(ider_len, len3+len2); + DECR_LEN (ider_len, len3 + len2); _asn1_set_value (p, der + counter, len3 + len2); counter += len3 + len2; @@ -1133,12 +1171,12 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, asn1_get_object_id_der (der + counter, ider_len, &len2, temp, sizeof (temp)); if (result != ASN1_SUCCESS) - { - warn(); + { + warn (); goto cleanup; } - DECR_LEN(ider_len, len2); + DECR_LEN (ider_len, len2); tlen = strlen (temp); if (tlen > 0) @@ -1150,15 +1188,16 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, case ASN1_ETYPE_GENERALIZED_TIME: case ASN1_ETYPE_UTC_TIME: result = - _asn1_get_time_der (type_field (p->type), der + counter, ider_len, &len2, temp, - sizeof (temp) - 1, flags); + _asn1_get_time_der (type_field (p->type), der + counter, + ider_len, &len2, temp, sizeof (temp) - 1, + flags); if (result != ASN1_SUCCESS) - { - warn(); - goto cleanup; - } + { + warn (); + goto cleanup; + } - DECR_LEN(ider_len, len2); + DECR_LEN (ider_len, len2); tlen = strlen (temp); if (tlen > 0) @@ -1169,50 +1208,60 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, break; case ASN1_ETYPE_OCTET_STRING: if (counter < inner_tag_len) - { + { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; - } - - ptag = der + counter - inner_tag_len; - if (flags & ASN1_DECODE_FLAG_STRICT_DER || !(ptag[0] & ASN1_CLASS_STRUCTURED)) - { - len2 = - asn1_get_length_der (der + counter, ider_len, &len3); - if (len2 < 0) + } + + ptag = der + counter - inner_tag_len; + if ((flags & ASN1_DECODE_FLAG_STRICT_DER) + || !(ptag[0] & ASN1_CLASS_STRUCTURED)) + { + if (ptag[0] & ASN1_CLASS_STRUCTURED) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - DECR_LEN(ider_len, len3+len2); + len2 = asn1_get_length_der (der + counter, ider_len, &len3); + if (len2 < 0) + { + result = ASN1_DER_ERROR; + warn (); + goto cleanup; + } + + DECR_LEN (ider_len, len3 + len2); - _asn1_set_value (p, der + counter, len3 + len2); - counter += len3 + len2; - } - else - { - unsigned dflags = 0, vlen, ber_len; + _asn1_set_value (p, der + counter, len3 + len2); + counter += len3 + len2; + } + else + { + unsigned dflags = 0, vlen, ber_len; - if (ptag[0] & ASN1_CLASS_STRUCTURED) - dflags |= DECODE_FLAG_INDEFINITE; + if (ptag[0] & ASN1_CLASS_STRUCTURED) + dflags |= DECODE_FLAG_CONSTRUCTED; - result = _asn1_decode_simple_ber(type_field (p->type), der+counter, ider_len, &ptmp, &vlen, &ber_len, dflags); - if (result != ASN1_SUCCESS) - { - warn(); + result = + _asn1_decode_simple_ber (type_field (p->type), + der + counter, ider_len, &ptmp, + &vlen, &ber_len, dflags); + if (result != ASN1_SUCCESS) + { + warn (); goto cleanup; } - DECR_LEN(ider_len, ber_len); + DECR_LEN (ider_len, ber_len); _asn1_set_value_lv (p, ptmp, vlen); - counter += ber_len; - free(ptmp); - } + counter += ber_len; + free (ptmp); + } move = RIGHT; break; case ASN1_ETYPE_GENERALSTRING: @@ -1225,16 +1274,15 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, case ASN1_ETYPE_UTF8_STRING: case ASN1_ETYPE_VISIBLE_STRING: case ASN1_ETYPE_BIT_STRING: - len2 = - asn1_get_length_der (der + counter, ider_len, &len3); + len2 = asn1_get_length_der (der + counter, ider_len, &len3); if (len2 < 0) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - DECR_LEN(ider_len, len3+len2); + DECR_LEN (ider_len, len3 + len2); _asn1_set_value (p, der + counter, len3 + len2); counter += len3 + len2; @@ -1248,12 +1296,12 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, p->tmp_ival = 0; if (len2 == -1) { /* indefinite length method */ - DECR_LEN(ider_len, 2); + DECR_LEN (ider_len, 2); if ((der[counter]) || der[counter + 1]) - { - result = ASN1_DER_ERROR; - warn(); - goto cleanup; + { + result = ASN1_DER_ERROR; + warn (); + goto cleanup; } counter += 2; } @@ -1262,7 +1310,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if (len2 != counter) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } } @@ -1270,16 +1318,15 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, } else { /* move==DOWN || move==RIGHT */ - len3 = - asn1_get_length_der (der + counter, ider_len, &len2); - if (IS_ERR(len3, flags)) + len3 = asn1_get_length_der (der + counter, ider_len, &len2); + if (IS_ERR (len3, flags)) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - DECR_LEN(ider_len, len2); + DECR_LEN (ider_len, len2); counter += len2; if (len3 > 0) @@ -1317,23 +1364,24 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, len2 = p->tmp_ival; if (len2 == -1) { /* indefinite length method */ - if (!HAVE_TWO(ider_len) || ((der[counter]) || der[counter + 1])) + if (!HAVE_TWO (ider_len) + || ((der[counter]) || der[counter + 1])) { result = _asn1_append_sequence_set (p, &tcache); if (result != 0) { - warn(); - goto cleanup; - } + warn (); + goto cleanup; + } p = tcache.tail; move = RIGHT; continue; } p->tmp_ival = 0; - tcache.tail = NULL; /* finished decoding this structure */ + tcache.tail = NULL; /* finished decoding this structure */ tcache.head = NULL; - DECR_LEN(ider_len, 2); + DECR_LEN (ider_len, 2); counter += 2; } else @@ -1343,69 +1391,68 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, result = _asn1_append_sequence_set (p, &tcache); if (result != 0) { - warn(); - goto cleanup; - } + warn (); + goto cleanup; + } p = tcache.tail; move = RIGHT; continue; } p->tmp_ival = 0; - tcache.tail = NULL; /* finished decoding this structure */ + tcache.tail = NULL; /* finished decoding this structure */ tcache.head = NULL; if (len2 != counter) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } } } else { /* move==DOWN || move==RIGHT */ - len3 = - asn1_get_length_der (der + counter, ider_len, &len2); - if (IS_ERR(len3, flags)) + len3 = asn1_get_length_der (der + counter, ider_len, &len2); + if (IS_ERR (len3, flags)) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - DECR_LEN(ider_len, len2); + DECR_LEN (ider_len, len2); counter += len2; if (len3) { if (len3 > 0) { /* definite length method */ - p->tmp_ival = counter + len3; + p->tmp_ival = counter + len3; } else { /* indefinite length method */ - p->tmp_ival = -1; + p->tmp_ival = -1; } p2 = p->down; - if (p2 == NULL) - { - result = ASN1_DER_ERROR; - warn(); - goto cleanup; - } + if (p2 == NULL) + { + result = ASN1_DER_ERROR; + warn (); + goto cleanup; + } while ((type_field (p2->type) == ASN1_ETYPE_TAG) || (type_field (p2->type) == ASN1_ETYPE_SIZE)) p2 = p2->right; if (p2->right == NULL) - { + { result = _asn1_append_sequence_set (p, &tcache); if (result != 0) { - warn(); - goto cleanup; - } + warn (); + goto cleanup; + } } p = p2; } @@ -1415,81 +1462,82 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, case ASN1_ETYPE_ANY: /* Check indefinite lenth method in an EXPLICIT TAG */ - if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) && (p->type & CONST_TAG) && - tag_len == 2 && (der[counter - 1] == 0x80)) + if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) + && (p->type & CONST_TAG) && tag_len == 2 + && (der[counter - 1] == 0x80)) indefinite = 1; else - indefinite = 0; + indefinite = 0; if (asn1_get_tag_der (der + counter, ider_len, &class, &len2, &tag) != ASN1_SUCCESS) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - DECR_LEN(ider_len, len2); + DECR_LEN (ider_len, len2); len4 = - asn1_get_length_der (der + counter + len2, - ider_len, &len3); - if (IS_ERR(len4, flags)) + asn1_get_length_der (der + counter + len2, ider_len, &len3); + if (IS_ERR (len4, flags)) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } - if (len4 != -1) /* definite */ + if (len4 != -1) /* definite */ { len2 += len4; - DECR_LEN(ider_len, len4+len3); + DECR_LEN (ider_len, len4 + len3); _asn1_set_value_lv (p, der + counter, len2 + len3); counter += len2 + len3; } - else /* == -1 */ + else /* == -1 */ { /* indefinite length */ - ider_len += len2; /* undo DECR_LEN */ + ider_len += len2; /* undo DECR_LEN */ if (counter == 0) { result = ASN1_DER_ERROR; - warn(); + warn (); goto cleanup; } result = - _asn1_get_indefinite_length_string (der + counter, ider_len, &len2); + _asn1_get_indefinite_length_string (der + counter, + ider_len, &len2); if (result != ASN1_SUCCESS) { - warn(); - goto cleanup; - } + warn (); + goto cleanup; + } - DECR_LEN(ider_len, len2); + DECR_LEN (ider_len, len2); _asn1_set_value_lv (p, der + counter, len2); counter += len2; } - /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with - an indefinite length method. */ - if (indefinite) - { - DECR_LEN(ider_len, 2); - if (!der[counter] && !der[counter + 1]) - { - counter += 2; - } - else - { - result = ASN1_DER_ERROR; - warn(); - goto cleanup; - } - } + /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with + an indefinite length method. */ + if (indefinite) + { + DECR_LEN (ider_len, 2); + if (!der[counter] && !der[counter + 1]) + { + counter += 2; + } + else + { + result = ASN1_DER_ERROR; + warn (); + goto cleanup; + } + } move = RIGHT; break; @@ -1500,9 +1548,9 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, } if (p) - { - p->end = counter - 1; - } + { + p->end = counter - 1; + } if (p == node && move != DOWN) break; @@ -1530,7 +1578,7 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, if ((ider_len < 0) || (!(flags & ASN1_DECODE_FLAG_ALLOW_PADDING) && (ider_len != 0))) { - warn(); + warn (); result = ASN1_DER_ERROR; goto cleanup; } @@ -1600,7 +1648,7 @@ int asn1_der_decoding_element (asn1_node * structure, const char *elementName, const void *ider, int len, char *errorDescription) { - return asn1_der_decoding(structure, ider, len, errorDescription); + return asn1_der_decoding (structure, ider, len, errorDescription); } /** @@ -1654,19 +1702,19 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len, if (*start == 0 && *end == 0) { if (ider == NULL || ider_len == 0) - return ASN1_GENERIC_ERROR; + return ASN1_GENERIC_ERROR; /* it seems asn1_der_decoding() wasn't called before. Do it now */ result = asn1_der_decoding (&node, ider, ider_len, NULL); if (result != ASN1_SUCCESS) - { - warn(); - return result; - } + { + warn (); + return result; + } node_to_find = asn1_find_node (node, name_element); if (node_to_find == NULL) - return ASN1_ELEMENT_NOT_FOUND; + return ASN1_ELEMENT_NOT_FOUND; *start = node_to_find->start; *end = node_to_find->end; @@ -1697,8 +1745,7 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len, int asn1_expand_any_defined_by (asn1_node_const definitions, asn1_node * element) { - char name[2 * ASN1_MAX_NAME_SIZE + 2], - value[ASN1_MAX_NAME_SIZE]; + char name[2 * ASN1_MAX_NAME_SIZE + 2], value[ASN1_MAX_NAME_SIZE]; int retCode = ASN1_SUCCESS, result; int len, len2, len3; asn1_node_const p2; @@ -1784,7 +1831,8 @@ asn1_expand_any_defined_by (asn1_node_const definitions, asn1_node * element) if ((type_field (p2->type) == ASN1_ETYPE_OBJECT_ID) && (p2->type & CONST_ASSIGN)) { - snprintf(name, sizeof(name), "%s.%s", definitionsName, p2->name); + snprintf (name, sizeof (name), "%s.%s", definitionsName, + p2->name); len = ASN1_MAX_NAME_SIZE; result = @@ -1800,7 +1848,8 @@ asn1_expand_any_defined_by (asn1_node_const definitions, asn1_node * element) if (p2) { - snprintf(name, sizeof(name), "%s.%s", definitionsName, p2->name); + snprintf (name, sizeof (name), "%s.%s", + definitionsName, p2->name); result = asn1_create_element (definitions, name, &aux); @@ -2064,8 +2113,8 @@ asn1_expand_octet_string (asn1_node_const definitions, asn1_node * element, -*/ static int _asn1_decode_simple_der (unsigned int etype, const unsigned char *der, - unsigned int _der_len, const unsigned char **str, - unsigned int *str_len, unsigned dflags) + unsigned int _der_len, const unsigned char **str, + unsigned int *str_len, unsigned dflags) { int tag_len, len_len; const unsigned char *p; @@ -2077,11 +2126,11 @@ _asn1_decode_simple_der (unsigned int etype, const unsigned char *der, if (der == NULL || der_len == 0) return ASN1_VALUE_NOT_VALID; - if (ETYPE_OK (etype) == 0 || ETYPE_IS_STRING(etype) == 0) + if (ETYPE_OK (etype) == 0 || ETYPE_IS_STRING (etype) == 0) return ASN1_VALUE_NOT_VALID; /* doesn't handle constructed classes */ - class = ETYPE_CLASS(etype); + class = ETYPE_CLASS (etype); if (class != ASN1_CLASS_UNIVERSAL) return ASN1_VALUE_NOT_VALID; @@ -2091,18 +2140,18 @@ _asn1_decode_simple_der (unsigned int etype, const unsigned char *der, { ret = asn1_get_tag_der (p, der_len, &class, &tag_len, &tag); if (ret != ASN1_SUCCESS) - return ret; + return ret; if (class != ETYPE_CLASS (etype) || tag != ETYPE_TAG (etype)) - { - warn(); - return ASN1_DER_ERROR; - } + { + warn (); + return ASN1_DER_ERROR; + } p += tag_len; der_len -= tag_len; if (der_len <= 0) - return ASN1_DER_ERROR; + return ASN1_DER_ERROR; } ret = asn1_get_length_der (p, der_len, &len_len); @@ -2138,15 +2187,21 @@ asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned int _der_len, const unsigned char **str, unsigned int *str_len) { - return _asn1_decode_simple_der(etype, der, _der_len, str, str_len, DECODE_FLAG_HAVE_TAG); + return _asn1_decode_simple_der (etype, der, _der_len, str, str_len, + DECODE_FLAG_HAVE_TAG); } -static int append(uint8_t **dst, unsigned *dst_size, const unsigned char *src, unsigned src_size) +static int +append (uint8_t ** dst, unsigned *dst_size, const unsigned char *src, + unsigned src_size) { - *dst = _asn1_realloc(*dst, *dst_size+src_size); + if (src_size == 0) + return ASN1_SUCCESS; + + *dst = _asn1_realloc (*dst, *dst_size + src_size); if (*dst == NULL) - return ASN1_MEM_ERROR; - memcpy(*dst + *dst_size, src, src_size); + return ASN1_MEM_ALLOC_ERROR; + memcpy (*dst + *dst_size, src, src_size); *dst_size += src_size; return ASN1_SUCCESS; } @@ -2169,9 +2224,9 @@ static int append(uint8_t **dst, unsigned *dst_size, const unsigned char *src, u -*/ static int _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, - unsigned int _der_len, unsigned char **str, - unsigned int *str_len, unsigned int *ber_len, - unsigned dflags) + unsigned int _der_len, unsigned char **str, + unsigned int *str_len, unsigned int *ber_len, + unsigned dflags) { int tag_len, len_len; const unsigned char *p; @@ -2185,17 +2240,18 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, unsigned out_len; long result; - if (ber_len) *ber_len = 0; + if (ber_len) + *ber_len = 0; if (der == NULL || der_len == 0) { - warn(); + warn (); return ASN1_VALUE_NOT_VALID; } if (ETYPE_OK (etype) == 0) { - warn(); + warn (); return ASN1_VALUE_NOT_VALID; } @@ -2203,7 +2259,7 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, class = ETYPE_CLASS (etype); if (class != ASN1_CLASS_UNIVERSAL) { - warn(); + warn (); return ASN1_VALUE_NOT_VALID; } @@ -2212,134 +2268,200 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, if (dflags & DECODE_FLAG_HAVE_TAG) { result = asn1_get_tag_der (p, der_len, &class, &tag_len, &tag); - if (result != ASN1_SUCCESS) - { - warn(); - return result; - } + if (result != ASN1_SUCCESS) + { + warn (); + return result; + } - if (tag != ETYPE_TAG (etype)) - { - warn(); - return ASN1_DER_ERROR; - } + if (tag != ETYPE_TAG (etype)) + { + warn (); + return ASN1_DER_ERROR; + } - p += tag_len; + p += tag_len; - DECR_LEN(der_len, tag_len); + DECR_LEN (der_len, tag_len); - if (ber_len) *ber_len += tag_len; + if (ber_len) + *ber_len += tag_len; } /* indefinite constructed */ - if ((((dflags & DECODE_FLAG_INDEFINITE) || class == ASN1_CLASS_STRUCTURED) && ETYPE_IS_STRING(etype)) && - !(dflags & DECODE_FLAG_LEVEL3)) + if ((((dflags & DECODE_FLAG_CONSTRUCTED) || class == ASN1_CLASS_STRUCTURED) + && ETYPE_IS_STRING (etype)) && !(dflags & DECODE_FLAG_LEVEL3)) { - len_len = 1; - - DECR_LEN(der_len, len_len); - if (p[0] != 0x80) - { - warn(); - result = ASN1_DER_ERROR; - goto cleanup; - } + if (der_len == 0) + { + warn (); + result = ASN1_DER_ERROR; + goto cleanup; + } - p += len_len; + if (der_len > 0 && p[0] == 0x80) /* indefinite */ + { + len_len = 1; + DECR_LEN (der_len, len_len); + p += len_len; - if (ber_len) *ber_len += len_len; + if (ber_len) + *ber_len += len_len; - /* decode the available octet strings */ - do - { - unsigned tmp_len; - unsigned flags = DECODE_FLAG_HAVE_TAG; + /* decode the available octet strings */ + do + { + unsigned tmp_len; + unsigned flags = DECODE_FLAG_HAVE_TAG; - if (dflags & DECODE_FLAG_LEVEL1) - flags |= DECODE_FLAG_LEVEL2; - else if (dflags & DECODE_FLAG_LEVEL2) + if (dflags & DECODE_FLAG_LEVEL1) + flags |= DECODE_FLAG_LEVEL2; + else if (dflags & DECODE_FLAG_LEVEL2) flags |= DECODE_FLAG_LEVEL3; - else + else flags |= DECODE_FLAG_LEVEL1; - result = _asn1_decode_simple_ber(etype, p, der_len, &out, &out_len, &tmp_len, - flags); - if (result != ASN1_SUCCESS) - { - warn(); - goto cleanup; - } + result = + _asn1_decode_simple_ber (etype, p, der_len, &out, &out_len, + &tmp_len, flags); + if (result != ASN1_SUCCESS) + { + warn (); + goto cleanup; + } + + p += tmp_len; + DECR_LEN (der_len, tmp_len); - p += tmp_len; - DECR_LEN(der_len, tmp_len); + if (ber_len) + *ber_len += tmp_len; - if (ber_len) *ber_len += tmp_len; + DECR_LEN (der_len, 2); /* we need the EOC */ + + result = append (&total, &total_size, out, out_len); + if (result != ASN1_SUCCESS) + { + warn (); + goto cleanup; + } - DECR_LEN(der_len, 2); /* we need the EOC */ + free (out); + out = NULL; - if (out_len > 0) + if (p[0] == 0 && p[1] == 0) /* EOC */ + { + if (ber_len) + *ber_len += 2; + break; + } + + /* no EOC */ + der_len += 2; + + if (der_len == 2) + { + warn (); + result = ASN1_DER_ERROR; + goto cleanup; + } + } + while (1); + } + else /* constructed */ + { + long const_len; + + result = asn1_get_length_ber (p, der_len, &len_len); + if (result < 0) { - result = append(&total, &total_size, out, out_len); - if (result != ASN1_SUCCESS) - { - warn(); - goto cleanup; - } + warn (); + result = ASN1_DER_ERROR; + goto cleanup; } - free(out); - out = NULL; + DECR_LEN (der_len, len_len); + p += len_len; - if (p[0] == 0 && p[1] == 0) /* EOC */ + const_len = result; + + if (ber_len) + *ber_len += len_len; + + /* decode the available octet strings */ + while (const_len > 0) { - if (ber_len) *ber_len += 2; - break; - } - - /* no EOC */ - der_len += 2; - - if (der_len == 2) - { - warn(); - result = ASN1_DER_ERROR; - goto cleanup; - } - } - while(1); + unsigned tmp_len; + unsigned flags = DECODE_FLAG_HAVE_TAG; + + if (dflags & DECODE_FLAG_LEVEL1) + flags |= DECODE_FLAG_LEVEL2; + else if (dflags & DECODE_FLAG_LEVEL2) + flags |= DECODE_FLAG_LEVEL3; + else + flags |= DECODE_FLAG_LEVEL1; + + result = + _asn1_decode_simple_ber (etype, p, der_len, &out, &out_len, + &tmp_len, flags); + if (result != ASN1_SUCCESS) + { + warn (); + goto cleanup; + } + + p += tmp_len; + DECR_LEN (der_len, tmp_len); + DECR_LEN (const_len, tmp_len); + + if (ber_len) + *ber_len += tmp_len; + + result = append (&total, &total_size, out, out_len); + if (result != ASN1_SUCCESS) + { + warn (); + goto cleanup; + } + + free (out); + out = NULL; + } + } } - else if (class == ETYPE_CLASS(etype)) + else if (class == ETYPE_CLASS (etype)) { if (ber_len) - { - result = asn1_get_length_der (p, der_len, &len_len); - if (result < 0) - { - warn(); - result = ASN1_DER_ERROR; - goto cleanup; - } - *ber_len += result + len_len; - } + { + result = asn1_get_length_der (p, der_len, &len_len); + if (result < 0) + { + warn (); + result = ASN1_DER_ERROR; + goto cleanup; + } + *ber_len += result + len_len; + } /* non-string values are decoded as DER */ - result = _asn1_decode_simple_der(etype, der, _der_len, &cout, &out_len, dflags); + result = + _asn1_decode_simple_der (etype, der, _der_len, &cout, &out_len, + dflags); if (result != ASN1_SUCCESS) - { - warn(); - goto cleanup; - } + { + warn (); + goto cleanup; + } - result = append(&total, &total_size, cout, out_len); + result = append (&total, &total_size, cout, out_len); if (result != ASN1_SUCCESS) - { - warn(); - goto cleanup; - } + { + warn (); + goto cleanup; + } } else { - warn(); + warn (); result = ASN1_DER_ERROR; goto cleanup; } @@ -2349,8 +2471,8 @@ _asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, return ASN1_SUCCESS; cleanup: - free(out); - free(total); + free (out); + free (total); return result; } @@ -2374,5 +2496,6 @@ asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, unsigned int _der_len, unsigned char **str, unsigned int *str_len, unsigned int *ber_len) { - return _asn1_decode_simple_ber(etype, der, _der_len, str, str_len, ber_len, DECODE_FLAG_HAVE_TAG); + return _asn1_decode_simple_ber (etype, der, _der_len, str, str_len, ber_len, + DECODE_FLAG_HAVE_TAG); } diff --git a/lib/element.c b/lib/element.c index a4c61bb..d4c558e 100644 --- a/lib/element.c +++ b/lib/element.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2014 Free Software Foundation, Inc. + * Copyright (C) 2000-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -30,7 +30,7 @@ #include "parser_aux.h" #include <gstr.h> #include "structure.h" - +#include "c-ctype.h" #include "element.h" void @@ -115,7 +115,7 @@ _asn1_convert_integer (const unsigned char *value, unsigned char *value_out, if (value_out != NULL) { for (k2 = k; k2 < SIZEOF_UNSIGNED_LONG_INT; k2++) - value_out[k2 - k] = val[k2]; + value_out[k2 - k] = val[k2]; } #if 0 @@ -142,7 +142,7 @@ int _asn1_append_sequence_set (asn1_node node, struct node_tail_cache_st *pcache) { asn1_node p, p2; - char temp[LTOSTR_MAX_SIZE]; + char temp[LTOSTR_MAX_SIZE + 1]; long n; if (!node || !(node->down)) @@ -160,9 +160,9 @@ _asn1_append_sequence_set (asn1_node node, struct node_tail_cache_st *pcache) if (pcache == NULL || pcache->tail == NULL || pcache->head != node) { while (p->right) - { - p = p->right; - } + { + p = p->right; + } } else { @@ -321,7 +321,8 @@ asn1_write_value (asn1_node node_root, const char *name, type = type_field (node->type); - if ((type == ASN1_ETYPE_SEQUENCE_OF || type == ASN1_ETYPE_SET_OF) && (value == NULL) && (len == 0)) + if ((type == ASN1_ETYPE_SEQUENCE_OF || type == ASN1_ETYPE_SET_OF) + && (value == NULL) && (len == 0)) { p = node->down; while ((type_field (p->type) == ASN1_ETYPE_TAG) @@ -380,7 +381,7 @@ asn1_write_value (asn1_node node_root, const char *name, case ASN1_ETYPE_ENUMERATED: if (len == 0) { - if ((isdigit (value[0])) || (value[0] == '-')) + if ((c_isdigit (value[0])) || (value[0] == '-')) { value_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); if (value_temp == NULL) @@ -453,7 +454,7 @@ asn1_write_value (asn1_node node_root, const char *name, p = node->down; while (type_field (p->type) != ASN1_ETYPE_DEFAULT) p = p->right; - if ((isdigit (p->value[0])) || (p->value[0] == '-')) + if ((c_isdigit (p->value[0])) || (p->value[0] == '-')) { default_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); if (default_temp == NULL) @@ -519,7 +520,7 @@ asn1_write_value (asn1_node node_root, const char *name, break; case ASN1_ETYPE_OBJECT_ID: for (i = 0; i < _asn1_strlen (value); i++) - if ((!isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) + if ((!c_isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) return ASN1_VALUE_NOT_VALID; if (node->type & CONST_DEFAULT) { @@ -540,7 +541,7 @@ asn1_write_value (asn1_node node_root, const char *name, if (len < 11) return ASN1_VALUE_NOT_VALID; for (k = 0; k < 10; k++) - if (!isdigit (value[k])) + if (!c_isdigit (value[k])) return ASN1_VALUE_NOT_VALID; switch (len) { @@ -549,7 +550,7 @@ asn1_write_value (asn1_node node_root, const char *name, return ASN1_VALUE_NOT_VALID; break; case 13: - if ((!isdigit (value[10])) || (!isdigit (value[11])) || + if ((!c_isdigit (value[10])) || (!c_isdigit (value[11])) || (value[12] != 'Z')) return ASN1_VALUE_NOT_VALID; break; @@ -557,16 +558,16 @@ asn1_write_value (asn1_node node_root, const char *name, if ((value[10] != '+') && (value[10] != '-')) return ASN1_VALUE_NOT_VALID; for (k = 11; k < 15; k++) - if (!isdigit (value[k])) + if (!c_isdigit (value[k])) return ASN1_VALUE_NOT_VALID; break; case 17: - if ((!isdigit (value[10])) || (!isdigit (value[11]))) + if ((!c_isdigit (value[10])) || (!c_isdigit (value[11]))) return ASN1_VALUE_NOT_VALID; if ((value[12] != '+') && (value[12] != '-')) return ASN1_VALUE_NOT_VALID; for (k = 13; k < 17; k++) - if (!isdigit (value[k])) + if (!c_isdigit (value[k])) return ASN1_VALUE_NOT_VALID; break; default: @@ -757,7 +758,8 @@ asn1_write_value (asn1_node node_root, const char *name, * this function may return %ASN1_SUCCESS even if the provided @len is zero. **/ int -asn1_read_value (asn1_node_const root, const char *name, void *ivalue, int *len) +asn1_read_value (asn1_node_const root, const char *name, void *ivalue, + int *len) { return asn1_read_value_type (root, name, ivalue, len, NULL); } @@ -890,12 +892,12 @@ asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, p = node->down; while (type_field (p->type) != ASN1_ETYPE_DEFAULT) p = p->right; - if ((isdigit (p->value[0])) || (p->value[0] == '-') + if ((c_isdigit (p->value[0])) || (p->value[0] == '-') || (p->value[0] == '+')) { result = _asn1_convert_integer - (p->value, value, value_size, len); - if (result != ASN1_SUCCESS) + (p->value, value, value_size, len); + if (result != ASN1_SUCCESS) return result; } else @@ -908,8 +910,7 @@ asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, if (!_asn1_strcmp (p2->name, p->value)) { result = _asn1_convert_integer - (p2->value, value, value_size, - len); + (p2->value, value, value_size, len); if (result != ASN1_SUCCESS) return result; break; @@ -923,9 +924,8 @@ asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, { len2 = -1; result = asn1_get_octet_der - (node->value, node->value_len, &len2, value, value_size, - len); - if (result != ASN1_SUCCESS) + (node->value, node->value_len, &len2, value, value_size, len); + if (result != ASN1_SUCCESS) return result; } break; @@ -978,16 +978,14 @@ asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, case ASN1_ETYPE_VISIBLE_STRING: len2 = -1; result = asn1_get_octet_der - (node->value, node->value_len, &len2, value, value_size, - len); + (node->value, node->value_len, &len2, value, value_size, len); if (result != ASN1_SUCCESS) return result; break; case ASN1_ETYPE_BIT_STRING: len2 = -1; result = asn1_get_bit_der - (node->value, node->value_len, &len2, value, value_size, - len); + (node->value, node->value_len, &len2, value, value_size, len); if (result != ASN1_SUCCESS) return result; break; diff --git a/lib/element.h b/lib/element.h index 440a33f..8dd0ceb 100644 --- a/lib/element.h +++ b/lib/element.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2014 Free Software Foundation, Inc. + * Copyright (C) 2000-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -20,21 +20,23 @@ */ #ifndef _ELEMENT_H -#define _ELEMENT_H +# define _ELEMENT_H struct node_tail_cache_st { - asn1_node head; /* the first element of the sequence */ - asn1_node tail; + asn1_node head; /* the first element of the sequence */ + asn1_node tail; }; -int _asn1_append_sequence_set (asn1_node node, struct node_tail_cache_st *pcached); +int _asn1_append_sequence_set (asn1_node node, + struct node_tail_cache_st *pcached); int _asn1_convert_integer (const unsigned char *value, unsigned char *value_out, int value_out_size, int *len); -void _asn1_hierarchical_name (asn1_node_const node, char *name, int name_size); +void _asn1_hierarchical_name (asn1_node_const node, char *name, + int name_size); #endif diff --git a/lib/errors.c b/lib/errors.c index cee74da..aef5dfe 100644 --- a/lib/errors.c +++ b/lib/errors.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -21,7 +21,7 @@ #include <int.h> #ifdef STDC_HEADERS -#include <stdarg.h> +# include <stdarg.h> #endif #define LIBTASN1_ERROR_ENTRY(name) { #name, name } diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am index 10491ce..2735841 100644 --- a/lib/gl/Makefile.am +++ b/lib/gl/Makefile.am @@ -1,10 +1,10 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2019 Free Software Foundation, Inc. +# Copyright (C) 2002-2022 Free Software Foundation, Inc. # # This file 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 +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, @@ -22,29 +22,34 @@ # # Generated by gnulib-tool. # Reproduce by: -# gnulib-tool --import --local-dir=lib/gl/override \ +# gnulib-tool --import --local-dir=lib/gl \ # --lib=libgnu \ # --source-base=lib/gl \ -# --m4-base=m4-gl \ +# --m4-base=m4 \ # --doc-base=doc \ -# --tests-base=tests-gl \ +# --tests-base=lib/gl/tests \ # --aux-dir=build-aux \ # --lgpl=2 \ # --no-conditional-dependencies \ # --libtool \ # --macro-prefix=gl \ # --no-vc-files \ -# hash-pjw-bare \ +# c-ctype \ +# git-version-gen \ +# gitlog-to-changelog \ # intprops \ +# lib-msvc-compat \ # lib-symbol-versions \ # lib-symbol-visibility \ -# maintainer-makefile \ +# manywarnings \ # minmax \ +# readme-release \ # stdint \ # strverscmp \ +# update-copyright \ # valgrind-tests -AUTOMAKE_OPTIONS = 1.11 gnits +AUTOMAKE_OPTIONS = 1.14 gnits SUBDIRS = noinst_HEADERS = @@ -66,6 +71,7 @@ AM_CFLAGS = noinst_LTLIBRARIES += libgnu.la libgnu_la_SOURCES = +libgnu_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS) libgnu_la_LIBADD = $(gl_LTLIBOBJS) libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) EXTRA_libgnu_la_SOURCES = @@ -77,10 +83,77 @@ libgnu_la_LDFLAGS += -no-undefined # Use this preprocessor expression to decide whether #include_next works. # Do not rely on a 'configure'-time test for this, since the expression # might appear in an installed header, which is used by some other compiler. -HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) +HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER) ## end gnulib module absolute-header +## begin gnulib module announce-gen + + +EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen + +## end gnulib module announce-gen + +## begin gnulib module c-ctype + +libgnu_la_SOURCES += c-ctype.h c-ctype.c + +## end gnulib module c-ctype + +## begin gnulib module do-release-commit-and-tag + + +EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag + +## end gnulib module do-release-commit-and-tag + +## begin gnulib module gen-header + +# In 'sed', replace the pattern space with a "DO NOT EDIT" comment. +SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */, + +# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT". +SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G + +# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading +# "DO_NOT_EDIT". Although this could be done more simply via: +# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t +# the -n and 'w' avoid a fork+exec, at least when GNU Make is used. +SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t' + +# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that +gl_V_at = $(AM_V_GEN) + +## end gnulib module gen-header + +## begin gnulib module gendocs + + +EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh + +## end gnulib module gendocs + +## begin gnulib module git-version-gen + + +EXTRA_DIST += $(top_srcdir)/build-aux/git-version-gen + +## end gnulib module git-version-gen + +## begin gnulib module gitlog-to-changelog + + +EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog + +## end gnulib module gitlog-to-changelog + +## begin gnulib module gnu-web-doc-update + + +EXTRA_DIST += $(top_srcdir)/build-aux/gnu-web-doc-update + +## end gnulib module gnu-web-doc-update + ## begin gnulib module gnumakefile EXTRA_DIST += $(top_srcdir)/GNUmakefile @@ -90,16 +163,17 @@ clean-GNUmakefile: ## end gnulib module gnumakefile -## begin gnulib module hash-pjw-bare +## begin gnulib module gnupload -libgnu_la_SOURCES += hash-pjw-bare.h hash-pjw-bare.c -## end gnulib module hash-pjw-bare +EXTRA_DIST += $(top_srcdir)/build-aux/gnupload + +## end gnulib module gnupload ## begin gnulib module intprops -EXTRA_DIST += intprops.h +EXTRA_DIST += intprops-internal.h intprops.h ## end gnulib module intprops @@ -128,16 +202,14 @@ BUILT_SOURCES += $(LIMITS_H) # doesn't have one that is compatible with GNU. if GL_GENERATE_LIMITS_H limits.h: limits.in.h $(top_builddir)/config.status - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ - < $(srcdir)/limits.in.h; \ - } > $@-t && \ - mv $@-t $@ + $(srcdir)/limits.in.h > $@-t + $(AM_V_at)mv $@-t $@ else limits.h: $(top_builddir)/config.status rm -f $@ @@ -160,6 +232,18 @@ libgnu_la_SOURCES += minmax.h ## end gnulib module minmax +## begin gnulib module snippet/_Noreturn + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. + +_NORETURN_H=$(srcdir)/_Noreturn.h + +EXTRA_DIST += _Noreturn.h + +## end gnulib module snippet/_Noreturn + ## begin gnulib module snippet/arg-nonnull # Because this Makefile snippet defines a variable used by other @@ -196,6 +280,28 @@ EXTRA_DIST += warn-on-use.h ## end gnulib module snippet/warn-on-use +## begin gnulib module stdbool + +BUILT_SOURCES += $(STDBOOL_H) + +# We need the following in order to create <stdbool.h> when the system +# doesn't have one that works. +if GL_GENERATE_STDBOOL_H +stdbool.h: stdbool.in.h $(top_builddir)/config.status + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \ + $(srcdir)/stdbool.in.h > $@-t + $(AM_V_at)mv $@-t $@ +else +stdbool.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdbool.h stdbool.h-t + +EXTRA_DIST += stdbool.in.h + +## end gnulib module stdbool + ## begin gnulib module stddef BUILT_SOURCES += $(STDDEF_H) @@ -204,9 +310,8 @@ BUILT_SOURCES += $(STDDEF_H) # doesn't have one that works with the given compiler. if GL_GENERATE_STDDEF_H stddef.h: stddef.in.h $(top_builddir)/config.status - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @@ -214,9 +319,8 @@ stddef.h: stddef.in.h $(top_builddir)/config.status -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ - < $(srcdir)/stddef.in.h; \ - } > $@-t && \ - mv $@-t $@ + $(srcdir)/stddef.in.h > $@-t + $(AM_V_at)mv $@-t $@ else stddef.h: $(top_builddir)/config.status rm -f $@ @@ -235,9 +339,8 @@ BUILT_SOURCES += $(STDINT_H) # doesn't have one that works with the given compiler. if GL_GENERATE_STDINT_H stdint.h: stdint.in.h $(top_builddir)/config.status - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @@ -249,8 +352,6 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ - -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ - -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ @@ -265,10 +366,9 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ - < $(srcdir)/stdint.in.h; \ - } > $@-t && \ - mv $@-t $@ + -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \ + $(srcdir)/stdint.in.h > $@-t + $(AM_V_at)mv $@-t $@ else stdint.h: $(top_builddir)/config.status rm -f $@ @@ -279,6 +379,155 @@ EXTRA_DIST += stdint.in.h ## end gnulib module stdint +## begin gnulib module stdlib + +BUILT_SOURCES += stdlib.h + +# We need the following in order to create <stdlib.h> when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GL_GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GL_GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_GNULIB_POSIX_MEMALIGN)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GL_GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_GNULIB_REALLOCARRAY)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GL_GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \ + -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOUL''@/$(GL_GNULIB_STRTOUL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GL_GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GL_GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GL_GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GL_GNULIB_WCTOMB)/g' \ + -e 's/@''GNULIB_MDA_ECVT''@/$(GL_GNULIB_MDA_ECVT)/g' \ + -e 's/@''GNULIB_MDA_FCVT''@/$(GL_GNULIB_MDA_FCVT)/g' \ + -e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \ + -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \ + -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \ + -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \ + -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \ + -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \ + -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ + -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \ + -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \ + -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \ + -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ + -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ + -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \ + -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \ + -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \ + -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|$(REPLACE_REALLOC_FOR_REALLOC_POSIX)|g' \ + -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \ + -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ + -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \ + -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \ + -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += stdlib.h stdlib.h-t + +EXTRA_DIST += stdlib.in.h + +## end gnulib module stdlib + ## begin gnulib module string BUILT_SOURCES += string.h @@ -286,57 +535,61 @@ BUILT_SOURCES += string.h # We need the following in order to create <string.h> when the system # doesn't have one that works with the given compiler. string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ - -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GNULIB_EXPLICIT_BZERO)/g' \ - -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ - -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ - -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ - -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ - -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ - -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ - -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ - -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ - -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ - -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ - -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ - -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ - -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ - -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ - -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ - -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ - -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ - -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ - -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ - -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ - -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ - -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ - -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ - -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ - -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ - -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ - -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ - -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ - -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ - -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ - -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ - -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ - -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ - -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ - -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ - -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ - -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_GNULIB_EXPLICIT_BZERO)/g' \ + -e 's/@''GNULIB_FFSL''@/$(GL_GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GL_GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GL_GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GL_GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GL_GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GL_GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GL_GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GL_GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GL_GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GL_GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GL_GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GL_GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GL_GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GL_GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \ + -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_GNULIB_SIGABBREV_NP)/g' \ + -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_GNULIB_SIGDESCR_NP)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GL_GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GL_GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \ + -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \ < $(srcdir)/string.in.h | \ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ - -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -352,10 +605,15 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ + -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ + -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ @@ -367,14 +625,14 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ - < $(srcdir)/string.in.h; \ - } > $@-t && \ - mv $@-t $@ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + > $@-t + $(AM_V_at)mv $@-t $@ MOSTLYCLEANFILES += string.h string.h-t EXTRA_DIST += string.in.h @@ -383,10 +641,9 @@ EXTRA_DIST += string.in.h ## begin gnulib module strverscmp - -EXTRA_DIST += strverscmp.c - -EXTRA_libgnu_la_SOURCES += strverscmp.c +if GL_COND_OBJ_STRVERSCMP +libgnu_la_SOURCES += strverscmp.c +endif ## end gnulib module strverscmp @@ -397,25 +654,237 @@ BUILT_SOURCES += sys/types.h # We need the following in order to create <sys/types.h> when the system # doesn't have one that works with the given compiler. sys/types.h: sys_types.in.h $(top_builddir)/config.status - $(AM_V_at)$(MKDIR_P) sys - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ - < $(srcdir)/sys_types.in.h; \ - } > $@-t && \ - mv $@-t $@ + $(srcdir)/sys_types.in.h > $@-t + $(AM_V_at)mv $@-t $@ MOSTLYCLEANFILES += sys/types.h sys/types.h-t EXTRA_DIST += sys_types.in.h ## end gnulib module sys_types +## begin gnulib module unistd + +BUILT_SOURCES += unistd.h +libgnu_la_SOURCES += unistd.c + +# We need the following in order to create an empty placeholder for +# <unistd.h> when the system doesn't have one. +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_ACCESS''@/$(GL_GNULIB_ACCESS)/g' \ + -e 's/@''GNULIB_CHDIR''@/$(GL_GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GL_GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_GNULIB_COPY_FILE_RANGE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GL_GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GL_GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GL_GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GL_GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GL_GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_EXECL''@/$(GL_GNULIB_EXECL)/g' \ + -e 's/@''GNULIB_EXECLE''@/$(GL_GNULIB_EXECLE)/g' \ + -e 's/@''GNULIB_EXECLP''@/$(GL_GNULIB_EXECLP)/g' \ + -e 's/@''GNULIB_EXECV''@/$(GL_GNULIB_EXECV)/g' \ + -e 's/@''GNULIB_EXECVE''@/$(GL_GNULIB_EXECVE)/g' \ + -e 's/@''GNULIB_EXECVP''@/$(GL_GNULIB_EXECVP)/g' \ + -e 's/@''GNULIB_EXECVPE''@/$(GL_GNULIB_EXECVPE)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GL_GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GL_GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GL_GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETENTROPY''@/$(GL_GNULIB_GETENTROPY)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GL_GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GL_GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_GNULIB_GETOPT_POSIX)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETPASS''@/$(GL_GNULIB_GETPASS)/g' \ + -e 's/@''GNULIB_GETPASS_GNU''@/$(GL_GNULIB_GETPASS_GNU)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GL_GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GL_GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GL_GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GL_GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GL_GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GL_GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GL_GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GL_GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GL_GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GL_GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GL_GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GL_GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GL_GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GL_GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GL_GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GL_GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TRUNCATE''@/$(GL_GNULIB_TRUNCATE)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GL_GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GL_GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GL_GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GL_GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GL_GNULIB_WRITE)/g' \ + -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_GNULIB_MDA_ACCESS)/g' \ + -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_GNULIB_MDA_CHDIR)/g' \ + -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_GNULIB_MDA_CLOSE)/g' \ + -e 's/@''GNULIB_MDA_DUP''@/$(GL_GNULIB_MDA_DUP)/g' \ + -e 's/@''GNULIB_MDA_DUP2''@/$(GL_GNULIB_MDA_DUP2)/g' \ + -e 's/@''GNULIB_MDA_EXECL''@/$(GL_GNULIB_MDA_EXECL)/g' \ + -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_GNULIB_MDA_EXECLE)/g' \ + -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_GNULIB_MDA_EXECLP)/g' \ + -e 's/@''GNULIB_MDA_EXECV''@/$(GL_GNULIB_MDA_EXECV)/g' \ + -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_GNULIB_MDA_EXECVE)/g' \ + -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_GNULIB_MDA_EXECVP)/g' \ + -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_GNULIB_MDA_EXECVPE)/g' \ + -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_GNULIB_MDA_GETCWD)/g' \ + -e 's/@''GNULIB_MDA_GETPID''@/$(GL_GNULIB_MDA_GETPID)/g' \ + -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_GNULIB_MDA_ISATTY)/g' \ + -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_GNULIB_MDA_LSEEK)/g' \ + -e 's/@''GNULIB_MDA_READ''@/$(GL_GNULIB_MDA_READ)/g' \ + -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_GNULIB_MDA_RMDIR)/g' \ + -e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \ + -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \ + -e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \ + < $(srcdir)/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \ + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ + -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \ + -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \ + -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \ + -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \ + -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \ + -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \ + -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \ + -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ + -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += unistd.h unistd.h-t + +EXTRA_DIST += unistd.in.h + +## end gnulib module unistd + +## begin gnulib module update-copyright + + +EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright + +## end gnulib module update-copyright + ## begin gnulib module useless-if-before-free @@ -438,3 +907,7 @@ mostlyclean-local: mostlyclean-generic fi; \ done; \ : +distclean-local: distclean-gnulib-libobjs +distclean-gnulib-libobjs: + -rm -f @gl_LIBOBJDEPS@ +maintainer-clean-local: distclean-gnulib-libobjs diff --git a/lib/gl/Makefile.in b/lib/gl/Makefile.in index 98b473e..4897fde 100644 --- a/lib/gl/Makefile.in +++ b/lib/gl/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,11 +14,11 @@ @SET_MAKE@ -# Copyright (C) 2002-2019 Free Software Foundation, Inc. +# Copyright (C) 2002-2022 Free Software Foundation, Inc. # # This file 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 +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, @@ -36,26 +36,31 @@ # # Generated by gnulib-tool. # Reproduce by: -# gnulib-tool --import --local-dir=lib/gl/override \ +# gnulib-tool --import --local-dir=lib/gl \ # --lib=libgnu \ # --source-base=lib/gl \ -# --m4-base=m4-gl \ +# --m4-base=m4 \ # --doc-base=doc \ -# --tests-base=tests-gl \ +# --tests-base=lib/gl/tests \ # --aux-dir=build-aux \ # --lgpl=2 \ # --no-conditional-dependencies \ # --libtool \ # --macro-prefix=gl \ # --no-vc-files \ -# hash-pjw-bare \ +# c-ctype \ +# git-version-gen \ +# gitlog-to-changelog \ # intprops \ +# lib-msvc-compat \ # lib-symbol-versions \ # lib-symbol-visibility \ -# maintainer-makefile \ +# manywarnings \ # minmax \ +# readme-release \ # stdint \ # strverscmp \ +# update-copyright \ # valgrind-tests @@ -134,38 +139,88 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@GL_COND_OBJ_STRVERSCMP_TRUE@am__append_1 = strverscmp.c subdir = lib/gl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/src/gl/m4/alloca.m4 \ + $(top_srcdir)/src/gl/m4/clock_time.m4 \ + $(top_srcdir)/src/gl/m4/close.m4 \ + $(top_srcdir)/src/gl/m4/dup2.m4 \ + $(top_srcdir)/src/gl/m4/eealloc.m4 \ + $(top_srcdir)/src/gl/m4/errno_h.m4 \ + $(top_srcdir)/src/gl/m4/explicit_bzero.m4 \ + $(top_srcdir)/src/gl/m4/fcntl-o.m4 \ + $(top_srcdir)/src/gl/m4/fcntl.m4 \ + $(top_srcdir)/src/gl/m4/fcntl_h.m4 \ + $(top_srcdir)/src/gl/m4/fopen.m4 \ + $(top_srcdir)/src/gl/m4/free.m4 \ + $(top_srcdir)/src/gl/m4/fseeko.m4 \ + $(top_srcdir)/src/gl/m4/fstat.m4 \ + $(top_srcdir)/src/gl/m4/ftell.m4 \ + $(top_srcdir)/src/gl/m4/ftello.m4 \ + $(top_srcdir)/src/gl/m4/getdtablesize.m4 \ + $(top_srcdir)/src/gl/m4/getopt.m4 \ + $(top_srcdir)/src/gl/m4/gettime.m4 \ + $(top_srcdir)/src/gl/m4/gettimeofday.m4 \ + $(top_srcdir)/src/gl/m4/gnulib-comp.m4 \ + $(top_srcdir)/src/gl/m4/inttypes.m4 \ + $(top_srcdir)/src/gl/m4/largefile.m4 \ + $(top_srcdir)/src/gl/m4/lseek.m4 \ + $(top_srcdir)/src/gl/m4/malloc.m4 \ + $(top_srcdir)/src/gl/m4/malloca.m4 \ + $(top_srcdir)/src/gl/m4/mode_t.m4 \ + $(top_srcdir)/src/gl/m4/msvc-inval.m4 \ + $(top_srcdir)/src/gl/m4/msvc-nothrow.m4 \ + $(top_srcdir)/src/gl/m4/nocrash.m4 \ + $(top_srcdir)/src/gl/m4/open-cloexec.m4 \ + $(top_srcdir)/src/gl/m4/open-slash.m4 \ + $(top_srcdir)/src/gl/m4/open.m4 \ + $(top_srcdir)/src/gl/m4/pathmax.m4 \ + $(top_srcdir)/src/gl/m4/read-file.m4 \ + $(top_srcdir)/src/gl/m4/realloc.m4 \ + $(top_srcdir)/src/gl/m4/stat-time.m4 \ + $(top_srcdir)/src/gl/m4/stat.m4 \ + $(top_srcdir)/src/gl/m4/stdarg.m4 \ + $(top_srcdir)/src/gl/m4/stdio_h.m4 \ + $(top_srcdir)/src/gl/m4/sys_socket_h.m4 \ + $(top_srcdir)/src/gl/m4/sys_stat_h.m4 \ + $(top_srcdir)/src/gl/m4/sys_time_h.m4 \ + $(top_srcdir)/src/gl/m4/time_h.m4 \ + $(top_srcdir)/src/gl/m4/timespec.m4 \ + $(top_srcdir)/src/gl/m4/ungetc.m4 \ + $(top_srcdir)/src/gl/m4/version-etc.m4 \ + $(top_srcdir)/src/gl/m4/wchar_h.m4 \ + $(top_srcdir)/src/gl/m4/year2038.m4 \ + $(top_srcdir)/m4/00gnulib.m4 $(top_srcdir)/m4/__inline.m4 \ + $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/ax_ac_append_to_file.m4 \ $(top_srcdir)/m4/ax_ac_print_to_file.m4 \ $(top_srcdir)/m4/ax_add_am_macro_static.m4 \ $(top_srcdir)/m4/ax_am_macros_static.m4 \ $(top_srcdir)/m4/ax_check_gnu_make.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/extern-inline.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/gtk-doc.m4 \ + $(top_srcdir)/m4/include_next.m4 \ + $(top_srcdir)/m4/ld-output-def.m4 \ + $(top_srcdir)/m4/ld-version-script.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/limits-h.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4-gl/00gnulib.m4 \ - $(top_srcdir)/m4-gl/__inline.m4 \ - $(top_srcdir)/m4-gl/absolute-header.m4 \ - $(top_srcdir)/m4-gl/extensions.m4 \ - $(top_srcdir)/m4-gl/extern-inline.m4 \ - $(top_srcdir)/m4-gl/gnulib-common.m4 \ - $(top_srcdir)/m4-gl/gnulib-comp.m4 \ - $(top_srcdir)/m4-gl/include_next.m4 \ - $(top_srcdir)/m4-gl/ld-version-script.m4 \ - $(top_srcdir)/m4-gl/limits-h.m4 \ - $(top_srcdir)/m4-gl/longlong.m4 $(top_srcdir)/m4-gl/minmax.m4 \ - $(top_srcdir)/m4-gl/multiarch.m4 $(top_srcdir)/m4-gl/off_t.m4 \ - $(top_srcdir)/m4-gl/ssize_t.m4 $(top_srcdir)/m4-gl/stddef_h.m4 \ - $(top_srcdir)/m4-gl/stdint.m4 $(top_srcdir)/m4-gl/string_h.m4 \ - $(top_srcdir)/m4-gl/strverscmp.m4 \ - $(top_srcdir)/m4-gl/sys_types_h.m4 \ - $(top_srcdir)/m4-gl/valgrind-tests.m4 \ - $(top_srcdir)/m4-gl/visibility.m4 \ - $(top_srcdir)/m4-gl/warn-on-use.m4 \ - $(top_srcdir)/m4-gl/wchar_t.m4 $(top_srcdir)/m4-gl/wint_t.m4 \ + $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/minmax.m4 \ + $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/ssize_t.m4 \ + $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ + $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdlib_h.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/valgrind-tests.m4 \ + $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/warn-on-use.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_t.m4 \ + $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/zzgnulib.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -178,15 +233,19 @@ CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = -am_libgnu_la_OBJECTS = hash-pjw-bare.lo +am__libgnu_la_SOURCES_DIST = c-ctype.h c-ctype.c minmax.h strverscmp.c \ + unistd.c +@GL_COND_OBJ_STRVERSCMP_TRUE@am__objects_1 = libgnu_la-strverscmp.lo +am_libgnu_la_OBJECTS = libgnu_la-c-ctype.lo $(am__objects_1) \ + libgnu_la-unistd.lo libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libgnu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libgnu_la_CFLAGS) \ + $(CFLAGS) $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -202,8 +261,9 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/hash-pjw-bare.Plo \ - ./$(DEPDIR)/strverscmp.Plo +am__depfiles_remade = ./$(DEPDIR)/libgnu_la-c-ctype.Plo \ + ./$(DEPDIR)/libgnu_la-strverscmp.Plo \ + ./$(DEPDIR)/libgnu_la-unistd.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -224,7 +284,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES) -DIST_SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES) +DIST_SOURCES = $(am__libgnu_la_SOURCES_DIST) \ + $(EXTRA_libgnu_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -264,8 +325,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp @@ -296,16 +355,15 @@ am__relativize = \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_VALGRINDFLAGS = @AM_VALGRINDFLAGS@ APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ AR = @AR@ ARFLAGS = @ARFLAGS@ AS = @AS@ -ASN1_VERSION_MAJOR = @ASN1_VERSION_MAJOR@ -ASN1_VERSION_MINOR = @ASN1_VERSION_MINOR@ -ASN1_VERSION_NUMBER = @ASN1_VERSION_NUMBER@ -ASN1_VERSION_PATCH = @ASN1_VERSION_PATCH@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -327,7 +385,10 @@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CONFIG_INCLUDE = @CONFIG_INCLUDE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_VALGRINDFLAGS = @DEFAULT_VALGRINDFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -337,49 +398,523 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FUZZ_LIBS = @FUZZ_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ -GNULIB_EXPLICIT_BZERO = @GNULIB_EXPLICIT_BZERO@ -GNULIB_FFSL = @GNULIB_FFSL@ -GNULIB_FFSLL = @GNULIB_FFSLL@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MEMCHR = @GNULIB_MEMCHR@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ -GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRERROR = @GNULIB_STRERROR@ -GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ -GNULIB_STRNCAT = @GNULIB_STRNCAT@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ -GNULIB_STRSTR = @GNULIB_STRSTR@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@ +GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@ +GL_CXXFLAG_ALLOW_WARNINGS = @GL_CXXFLAG_ALLOW_WARNINGS@ +GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@ +GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@ +GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@ +GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@ +GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@ +GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@ +GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@ +GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@ +GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@ +GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@ +GL_GNULIB_DUP = @GL_GNULIB_DUP@ +GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@ +GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@ +GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@ +GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@ +GL_GNULIB_EXECL = @GL_GNULIB_EXECL@ +GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@ +GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@ +GL_GNULIB_EXECV = @GL_GNULIB_EXECV@ +GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@ +GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@ +GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@ +GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@ +GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@ +GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@ +GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@ +GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@ +GL_GNULIB_FFSL = @GL_GNULIB_FFSL@ +GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@ +GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@ +GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@ +GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@ +GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@ +GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@ +GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@ +GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@ +GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@ +GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@ +GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@ +GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@ +GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@ +GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@ +GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@ +GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@ +GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@ +GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@ +GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@ +GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@ +GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@ +GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@ +GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@ +GL_GNULIB_LINK = @GL_GNULIB_LINK@ +GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@ +GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@ +GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@ +GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@ +GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@ +GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@ +GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@ +GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@ +GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@ +GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@ +GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@ +GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@ +GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@ +GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@ +GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@ +GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@ +GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@ +GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@ +GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@ +GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@ +GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@ +GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@ +GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@ +GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@ +GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@ +GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@ +GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@ +GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@ +GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@ +GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@ +GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@ +GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@ +GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@ +GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@ +GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@ +GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@ +GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@ +GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@ +GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@ +GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@ +GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@ +GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@ +GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@ +GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@ +GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@ +GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@ +GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@ +GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@ +GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@ +GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@ +GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@ +GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@ +GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@ +GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@ +GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@ +GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@ +GL_GNULIB_PIPE = @GL_GNULIB_PIPE@ +GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@ +GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@ +GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@ +GL_GNULIB_PREAD = @GL_GNULIB_PREAD@ +GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@ +GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@ +GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@ +GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@ +GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@ +GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@ +GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@ +GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@ +GL_GNULIB_READ = @GL_GNULIB_READ@ +GL_GNULIB_READLINK = @GL_GNULIB_READLINK@ +GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@ +GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@ +GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@ +GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@ +GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@ +GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@ +GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@ +GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@ +GL_GNULIB_SETENV = @GL_GNULIB_SETENV@ +GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@ +GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@ +GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@ +GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@ +GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@ +GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@ +GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@ +GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@ +GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@ +GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@ +GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@ +GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@ +GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@ +GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@ +GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@ +GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@ +GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@ +GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@ +GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@ +GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@ +GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@ +GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@ +GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@ +GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@ +GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@ +GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@ +GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@ +GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@ +GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@ +GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@ +GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@ +GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@ +GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@ +GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@ +GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@ +GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@ +GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@ +GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@ +GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@ +GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@ +GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@ +GL_GNULIB_WRITE = @GL_GNULIB_WRITE@ +GL_GNULIB__EXIT = @GL_GNULIB__EXIT@ +GL_SGL_GNULIB_ACCESS = @GL_SGL_GNULIB_ACCESS@ +GL_SGL_GNULIB_ALIGNED_ALLOC = @GL_SGL_GNULIB_ALIGNED_ALLOC@ +GL_SGL_GNULIB_ATOLL = @GL_SGL_GNULIB_ATOLL@ +GL_SGL_GNULIB_BTOWC = @GL_SGL_GNULIB_BTOWC@ +GL_SGL_GNULIB_CALLOC_GNU = @GL_SGL_GNULIB_CALLOC_GNU@ +GL_SGL_GNULIB_CALLOC_POSIX = @GL_SGL_GNULIB_CALLOC_POSIX@ +GL_SGL_GNULIB_CANONICALIZE_FILE_NAME = @GL_SGL_GNULIB_CANONICALIZE_FILE_NAME@ +GL_SGL_GNULIB_CHDIR = @GL_SGL_GNULIB_CHDIR@ +GL_SGL_GNULIB_CHMOD = @GL_SGL_GNULIB_CHMOD@ +GL_SGL_GNULIB_CHOWN = @GL_SGL_GNULIB_CHOWN@ +GL_SGL_GNULIB_CLOSE = @GL_SGL_GNULIB_CLOSE@ +GL_SGL_GNULIB_COPY_FILE_RANGE = @GL_SGL_GNULIB_COPY_FILE_RANGE@ +GL_SGL_GNULIB_CREAT = @GL_SGL_GNULIB_CREAT@ +GL_SGL_GNULIB_CTIME = @GL_SGL_GNULIB_CTIME@ +GL_SGL_GNULIB_DPRINTF = @GL_SGL_GNULIB_DPRINTF@ +GL_SGL_GNULIB_DUP = @GL_SGL_GNULIB_DUP@ +GL_SGL_GNULIB_DUP2 = @GL_SGL_GNULIB_DUP2@ +GL_SGL_GNULIB_DUP3 = @GL_SGL_GNULIB_DUP3@ +GL_SGL_GNULIB_ENVIRON = @GL_SGL_GNULIB_ENVIRON@ +GL_SGL_GNULIB_EUIDACCESS = @GL_SGL_GNULIB_EUIDACCESS@ +GL_SGL_GNULIB_EXECL = @GL_SGL_GNULIB_EXECL@ +GL_SGL_GNULIB_EXECLE = @GL_SGL_GNULIB_EXECLE@ +GL_SGL_GNULIB_EXECLP = @GL_SGL_GNULIB_EXECLP@ +GL_SGL_GNULIB_EXECV = @GL_SGL_GNULIB_EXECV@ +GL_SGL_GNULIB_EXECVE = @GL_SGL_GNULIB_EXECVE@ +GL_SGL_GNULIB_EXECVP = @GL_SGL_GNULIB_EXECVP@ +GL_SGL_GNULIB_EXECVPE = @GL_SGL_GNULIB_EXECVPE@ +GL_SGL_GNULIB_EXPLICIT_BZERO = @GL_SGL_GNULIB_EXPLICIT_BZERO@ +GL_SGL_GNULIB_FACCESSAT = @GL_SGL_GNULIB_FACCESSAT@ +GL_SGL_GNULIB_FCHDIR = @GL_SGL_GNULIB_FCHDIR@ +GL_SGL_GNULIB_FCHMODAT = @GL_SGL_GNULIB_FCHMODAT@ +GL_SGL_GNULIB_FCHOWNAT = @GL_SGL_GNULIB_FCHOWNAT@ +GL_SGL_GNULIB_FCLOSE = @GL_SGL_GNULIB_FCLOSE@ +GL_SGL_GNULIB_FCNTL = @GL_SGL_GNULIB_FCNTL@ +GL_SGL_GNULIB_FDATASYNC = @GL_SGL_GNULIB_FDATASYNC@ +GL_SGL_GNULIB_FDOPEN = @GL_SGL_GNULIB_FDOPEN@ +GL_SGL_GNULIB_FFLUSH = @GL_SGL_GNULIB_FFLUSH@ +GL_SGL_GNULIB_FFSL = @GL_SGL_GNULIB_FFSL@ +GL_SGL_GNULIB_FFSLL = @GL_SGL_GNULIB_FFSLL@ +GL_SGL_GNULIB_FGETC = @GL_SGL_GNULIB_FGETC@ +GL_SGL_GNULIB_FGETS = @GL_SGL_GNULIB_FGETS@ +GL_SGL_GNULIB_FOPEN = @GL_SGL_GNULIB_FOPEN@ +GL_SGL_GNULIB_FOPEN_GNU = @GL_SGL_GNULIB_FOPEN_GNU@ +GL_SGL_GNULIB_FPRINTF = @GL_SGL_GNULIB_FPRINTF@ +GL_SGL_GNULIB_FPRINTF_POSIX = @GL_SGL_GNULIB_FPRINTF_POSIX@ +GL_SGL_GNULIB_FPURGE = @GL_SGL_GNULIB_FPURGE@ +GL_SGL_GNULIB_FPUTC = @GL_SGL_GNULIB_FPUTC@ +GL_SGL_GNULIB_FPUTS = @GL_SGL_GNULIB_FPUTS@ +GL_SGL_GNULIB_FREAD = @GL_SGL_GNULIB_FREAD@ +GL_SGL_GNULIB_FREE_POSIX = @GL_SGL_GNULIB_FREE_POSIX@ +GL_SGL_GNULIB_FREOPEN = @GL_SGL_GNULIB_FREOPEN@ +GL_SGL_GNULIB_FSCANF = @GL_SGL_GNULIB_FSCANF@ +GL_SGL_GNULIB_FSEEK = @GL_SGL_GNULIB_FSEEK@ +GL_SGL_GNULIB_FSEEKO = @GL_SGL_GNULIB_FSEEKO@ +GL_SGL_GNULIB_FSTAT = @GL_SGL_GNULIB_FSTAT@ +GL_SGL_GNULIB_FSTATAT = @GL_SGL_GNULIB_FSTATAT@ +GL_SGL_GNULIB_FSYNC = @GL_SGL_GNULIB_FSYNC@ +GL_SGL_GNULIB_FTELL = @GL_SGL_GNULIB_FTELL@ +GL_SGL_GNULIB_FTELLO = @GL_SGL_GNULIB_FTELLO@ +GL_SGL_GNULIB_FTRUNCATE = @GL_SGL_GNULIB_FTRUNCATE@ +GL_SGL_GNULIB_FUTIMENS = @GL_SGL_GNULIB_FUTIMENS@ +GL_SGL_GNULIB_FWRITE = @GL_SGL_GNULIB_FWRITE@ +GL_SGL_GNULIB_GETC = @GL_SGL_GNULIB_GETC@ +GL_SGL_GNULIB_GETCHAR = @GL_SGL_GNULIB_GETCHAR@ +GL_SGL_GNULIB_GETCWD = @GL_SGL_GNULIB_GETCWD@ +GL_SGL_GNULIB_GETDELIM = @GL_SGL_GNULIB_GETDELIM@ +GL_SGL_GNULIB_GETDOMAINNAME = @GL_SGL_GNULIB_GETDOMAINNAME@ +GL_SGL_GNULIB_GETDTABLESIZE = @GL_SGL_GNULIB_GETDTABLESIZE@ +GL_SGL_GNULIB_GETENTROPY = @GL_SGL_GNULIB_GETENTROPY@ +GL_SGL_GNULIB_GETGROUPS = @GL_SGL_GNULIB_GETGROUPS@ +GL_SGL_GNULIB_GETHOSTNAME = @GL_SGL_GNULIB_GETHOSTNAME@ +GL_SGL_GNULIB_GETLINE = @GL_SGL_GNULIB_GETLINE@ +GL_SGL_GNULIB_GETLOADAVG = @GL_SGL_GNULIB_GETLOADAVG@ +GL_SGL_GNULIB_GETLOGIN = @GL_SGL_GNULIB_GETLOGIN@ +GL_SGL_GNULIB_GETLOGIN_R = @GL_SGL_GNULIB_GETLOGIN_R@ +GL_SGL_GNULIB_GETOPT_POSIX = @GL_SGL_GNULIB_GETOPT_POSIX@ +GL_SGL_GNULIB_GETPAGESIZE = @GL_SGL_GNULIB_GETPAGESIZE@ +GL_SGL_GNULIB_GETPASS = @GL_SGL_GNULIB_GETPASS@ +GL_SGL_GNULIB_GETPASS_GNU = @GL_SGL_GNULIB_GETPASS_GNU@ +GL_SGL_GNULIB_GETSUBOPT = @GL_SGL_GNULIB_GETSUBOPT@ +GL_SGL_GNULIB_GETTIMEOFDAY = @GL_SGL_GNULIB_GETTIMEOFDAY@ +GL_SGL_GNULIB_GETUMASK = @GL_SGL_GNULIB_GETUMASK@ +GL_SGL_GNULIB_GETUSERSHELL = @GL_SGL_GNULIB_GETUSERSHELL@ +GL_SGL_GNULIB_GRANTPT = @GL_SGL_GNULIB_GRANTPT@ +GL_SGL_GNULIB_GROUP_MEMBER = @GL_SGL_GNULIB_GROUP_MEMBER@ +GL_SGL_GNULIB_IMAXABS = @GL_SGL_GNULIB_IMAXABS@ +GL_SGL_GNULIB_IMAXDIV = @GL_SGL_GNULIB_IMAXDIV@ +GL_SGL_GNULIB_ISATTY = @GL_SGL_GNULIB_ISATTY@ +GL_SGL_GNULIB_LCHMOD = @GL_SGL_GNULIB_LCHMOD@ +GL_SGL_GNULIB_LCHOWN = @GL_SGL_GNULIB_LCHOWN@ +GL_SGL_GNULIB_LINK = @GL_SGL_GNULIB_LINK@ +GL_SGL_GNULIB_LINKAT = @GL_SGL_GNULIB_LINKAT@ +GL_SGL_GNULIB_LOCALTIME = @GL_SGL_GNULIB_LOCALTIME@ +GL_SGL_GNULIB_LSEEK = @GL_SGL_GNULIB_LSEEK@ +GL_SGL_GNULIB_LSTAT = @GL_SGL_GNULIB_LSTAT@ +GL_SGL_GNULIB_MALLOC_GNU = @GL_SGL_GNULIB_MALLOC_GNU@ +GL_SGL_GNULIB_MALLOC_POSIX = @GL_SGL_GNULIB_MALLOC_POSIX@ +GL_SGL_GNULIB_MBRLEN = @GL_SGL_GNULIB_MBRLEN@ +GL_SGL_GNULIB_MBRTOWC = @GL_SGL_GNULIB_MBRTOWC@ +GL_SGL_GNULIB_MBSCASECMP = @GL_SGL_GNULIB_MBSCASECMP@ +GL_SGL_GNULIB_MBSCASESTR = @GL_SGL_GNULIB_MBSCASESTR@ +GL_SGL_GNULIB_MBSCHR = @GL_SGL_GNULIB_MBSCHR@ +GL_SGL_GNULIB_MBSCSPN = @GL_SGL_GNULIB_MBSCSPN@ +GL_SGL_GNULIB_MBSINIT = @GL_SGL_GNULIB_MBSINIT@ +GL_SGL_GNULIB_MBSLEN = @GL_SGL_GNULIB_MBSLEN@ +GL_SGL_GNULIB_MBSNCASECMP = @GL_SGL_GNULIB_MBSNCASECMP@ +GL_SGL_GNULIB_MBSNLEN = @GL_SGL_GNULIB_MBSNLEN@ +GL_SGL_GNULIB_MBSNRTOWCS = @GL_SGL_GNULIB_MBSNRTOWCS@ +GL_SGL_GNULIB_MBSPBRK = @GL_SGL_GNULIB_MBSPBRK@ +GL_SGL_GNULIB_MBSPCASECMP = @GL_SGL_GNULIB_MBSPCASECMP@ +GL_SGL_GNULIB_MBSRCHR = @GL_SGL_GNULIB_MBSRCHR@ +GL_SGL_GNULIB_MBSRTOWCS = @GL_SGL_GNULIB_MBSRTOWCS@ +GL_SGL_GNULIB_MBSSEP = @GL_SGL_GNULIB_MBSSEP@ +GL_SGL_GNULIB_MBSSPN = @GL_SGL_GNULIB_MBSSPN@ +GL_SGL_GNULIB_MBSSTR = @GL_SGL_GNULIB_MBSSTR@ +GL_SGL_GNULIB_MBSTOK_R = @GL_SGL_GNULIB_MBSTOK_R@ +GL_SGL_GNULIB_MBTOWC = @GL_SGL_GNULIB_MBTOWC@ +GL_SGL_GNULIB_MDA_ACCESS = @GL_SGL_GNULIB_MDA_ACCESS@ +GL_SGL_GNULIB_MDA_CHDIR = @GL_SGL_GNULIB_MDA_CHDIR@ +GL_SGL_GNULIB_MDA_CHMOD = @GL_SGL_GNULIB_MDA_CHMOD@ +GL_SGL_GNULIB_MDA_CLOSE = @GL_SGL_GNULIB_MDA_CLOSE@ +GL_SGL_GNULIB_MDA_CREAT = @GL_SGL_GNULIB_MDA_CREAT@ +GL_SGL_GNULIB_MDA_DUP = @GL_SGL_GNULIB_MDA_DUP@ +GL_SGL_GNULIB_MDA_DUP2 = @GL_SGL_GNULIB_MDA_DUP2@ +GL_SGL_GNULIB_MDA_ECVT = @GL_SGL_GNULIB_MDA_ECVT@ +GL_SGL_GNULIB_MDA_EXECL = @GL_SGL_GNULIB_MDA_EXECL@ +GL_SGL_GNULIB_MDA_EXECLE = @GL_SGL_GNULIB_MDA_EXECLE@ +GL_SGL_GNULIB_MDA_EXECLP = @GL_SGL_GNULIB_MDA_EXECLP@ +GL_SGL_GNULIB_MDA_EXECV = @GL_SGL_GNULIB_MDA_EXECV@ +GL_SGL_GNULIB_MDA_EXECVE = @GL_SGL_GNULIB_MDA_EXECVE@ +GL_SGL_GNULIB_MDA_EXECVP = @GL_SGL_GNULIB_MDA_EXECVP@ +GL_SGL_GNULIB_MDA_EXECVPE = @GL_SGL_GNULIB_MDA_EXECVPE@ +GL_SGL_GNULIB_MDA_FCLOSEALL = @GL_SGL_GNULIB_MDA_FCLOSEALL@ +GL_SGL_GNULIB_MDA_FCVT = @GL_SGL_GNULIB_MDA_FCVT@ +GL_SGL_GNULIB_MDA_FDOPEN = @GL_SGL_GNULIB_MDA_FDOPEN@ +GL_SGL_GNULIB_MDA_FILENO = @GL_SGL_GNULIB_MDA_FILENO@ +GL_SGL_GNULIB_MDA_GCVT = @GL_SGL_GNULIB_MDA_GCVT@ +GL_SGL_GNULIB_MDA_GETCWD = @GL_SGL_GNULIB_MDA_GETCWD@ +GL_SGL_GNULIB_MDA_GETPID = @GL_SGL_GNULIB_MDA_GETPID@ +GL_SGL_GNULIB_MDA_GETW = @GL_SGL_GNULIB_MDA_GETW@ +GL_SGL_GNULIB_MDA_ISATTY = @GL_SGL_GNULIB_MDA_ISATTY@ +GL_SGL_GNULIB_MDA_LSEEK = @GL_SGL_GNULIB_MDA_LSEEK@ +GL_SGL_GNULIB_MDA_MEMCCPY = @GL_SGL_GNULIB_MDA_MEMCCPY@ +GL_SGL_GNULIB_MDA_MKDIR = @GL_SGL_GNULIB_MDA_MKDIR@ +GL_SGL_GNULIB_MDA_MKTEMP = @GL_SGL_GNULIB_MDA_MKTEMP@ +GL_SGL_GNULIB_MDA_OPEN = @GL_SGL_GNULIB_MDA_OPEN@ +GL_SGL_GNULIB_MDA_PUTENV = @GL_SGL_GNULIB_MDA_PUTENV@ +GL_SGL_GNULIB_MDA_PUTW = @GL_SGL_GNULIB_MDA_PUTW@ +GL_SGL_GNULIB_MDA_READ = @GL_SGL_GNULIB_MDA_READ@ +GL_SGL_GNULIB_MDA_RMDIR = @GL_SGL_GNULIB_MDA_RMDIR@ +GL_SGL_GNULIB_MDA_STRDUP = @GL_SGL_GNULIB_MDA_STRDUP@ +GL_SGL_GNULIB_MDA_SWAB = @GL_SGL_GNULIB_MDA_SWAB@ +GL_SGL_GNULIB_MDA_TEMPNAM = @GL_SGL_GNULIB_MDA_TEMPNAM@ +GL_SGL_GNULIB_MDA_TZSET = @GL_SGL_GNULIB_MDA_TZSET@ +GL_SGL_GNULIB_MDA_UMASK = @GL_SGL_GNULIB_MDA_UMASK@ +GL_SGL_GNULIB_MDA_UNLINK = @GL_SGL_GNULIB_MDA_UNLINK@ +GL_SGL_GNULIB_MDA_WCSDUP = @GL_SGL_GNULIB_MDA_WCSDUP@ +GL_SGL_GNULIB_MDA_WRITE = @GL_SGL_GNULIB_MDA_WRITE@ +GL_SGL_GNULIB_MEMCHR = @GL_SGL_GNULIB_MEMCHR@ +GL_SGL_GNULIB_MEMMEM = @GL_SGL_GNULIB_MEMMEM@ +GL_SGL_GNULIB_MEMPCPY = @GL_SGL_GNULIB_MEMPCPY@ +GL_SGL_GNULIB_MEMRCHR = @GL_SGL_GNULIB_MEMRCHR@ +GL_SGL_GNULIB_MKDIR = @GL_SGL_GNULIB_MKDIR@ +GL_SGL_GNULIB_MKDIRAT = @GL_SGL_GNULIB_MKDIRAT@ +GL_SGL_GNULIB_MKDTEMP = @GL_SGL_GNULIB_MKDTEMP@ +GL_SGL_GNULIB_MKFIFO = @GL_SGL_GNULIB_MKFIFO@ +GL_SGL_GNULIB_MKFIFOAT = @GL_SGL_GNULIB_MKFIFOAT@ +GL_SGL_GNULIB_MKNOD = @GL_SGL_GNULIB_MKNOD@ +GL_SGL_GNULIB_MKNODAT = @GL_SGL_GNULIB_MKNODAT@ +GL_SGL_GNULIB_MKOSTEMP = @GL_SGL_GNULIB_MKOSTEMP@ +GL_SGL_GNULIB_MKOSTEMPS = @GL_SGL_GNULIB_MKOSTEMPS@ +GL_SGL_GNULIB_MKSTEMP = @GL_SGL_GNULIB_MKSTEMP@ +GL_SGL_GNULIB_MKSTEMPS = @GL_SGL_GNULIB_MKSTEMPS@ +GL_SGL_GNULIB_MKTIME = @GL_SGL_GNULIB_MKTIME@ +GL_SGL_GNULIB_NANOSLEEP = @GL_SGL_GNULIB_NANOSLEEP@ +GL_SGL_GNULIB_NONBLOCKING = @GL_SGL_GNULIB_NONBLOCKING@ +GL_SGL_GNULIB_OBSTACK_PRINTF = @GL_SGL_GNULIB_OBSTACK_PRINTF@ +GL_SGL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_SGL_GNULIB_OBSTACK_PRINTF_POSIX@ +GL_SGL_GNULIB_OPEN = @GL_SGL_GNULIB_OPEN@ +GL_SGL_GNULIB_OPENAT = @GL_SGL_GNULIB_OPENAT@ +GL_SGL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_SGL_GNULIB_OVERRIDES_STRUCT_STAT@ +GL_SGL_GNULIB_PCLOSE = @GL_SGL_GNULIB_PCLOSE@ +GL_SGL_GNULIB_PERROR = @GL_SGL_GNULIB_PERROR@ +GL_SGL_GNULIB_PIPE = @GL_SGL_GNULIB_PIPE@ +GL_SGL_GNULIB_PIPE2 = @GL_SGL_GNULIB_PIPE2@ +GL_SGL_GNULIB_POPEN = @GL_SGL_GNULIB_POPEN@ +GL_SGL_GNULIB_POSIX_MEMALIGN = @GL_SGL_GNULIB_POSIX_MEMALIGN@ +GL_SGL_GNULIB_POSIX_OPENPT = @GL_SGL_GNULIB_POSIX_OPENPT@ +GL_SGL_GNULIB_PREAD = @GL_SGL_GNULIB_PREAD@ +GL_SGL_GNULIB_PRINTF = @GL_SGL_GNULIB_PRINTF@ +GL_SGL_GNULIB_PRINTF_POSIX = @GL_SGL_GNULIB_PRINTF_POSIX@ +GL_SGL_GNULIB_PTSNAME = @GL_SGL_GNULIB_PTSNAME@ +GL_SGL_GNULIB_PTSNAME_R = @GL_SGL_GNULIB_PTSNAME_R@ +GL_SGL_GNULIB_PUTC = @GL_SGL_GNULIB_PUTC@ +GL_SGL_GNULIB_PUTCHAR = @GL_SGL_GNULIB_PUTCHAR@ +GL_SGL_GNULIB_PUTENV = @GL_SGL_GNULIB_PUTENV@ +GL_SGL_GNULIB_PUTS = @GL_SGL_GNULIB_PUTS@ +GL_SGL_GNULIB_PWRITE = @GL_SGL_GNULIB_PWRITE@ +GL_SGL_GNULIB_QSORT_R = @GL_SGL_GNULIB_QSORT_R@ +GL_SGL_GNULIB_RANDOM = @GL_SGL_GNULIB_RANDOM@ +GL_SGL_GNULIB_RANDOM_R = @GL_SGL_GNULIB_RANDOM_R@ +GL_SGL_GNULIB_RAWMEMCHR = @GL_SGL_GNULIB_RAWMEMCHR@ +GL_SGL_GNULIB_READ = @GL_SGL_GNULIB_READ@ +GL_SGL_GNULIB_READLINK = @GL_SGL_GNULIB_READLINK@ +GL_SGL_GNULIB_READLINKAT = @GL_SGL_GNULIB_READLINKAT@ +GL_SGL_GNULIB_REALLOCARRAY = @GL_SGL_GNULIB_REALLOCARRAY@ +GL_SGL_GNULIB_REALLOC_GNU = @GL_SGL_GNULIB_REALLOC_GNU@ +GL_SGL_GNULIB_REALLOC_POSIX = @GL_SGL_GNULIB_REALLOC_POSIX@ +GL_SGL_GNULIB_REALPATH = @GL_SGL_GNULIB_REALPATH@ +GL_SGL_GNULIB_REMOVE = @GL_SGL_GNULIB_REMOVE@ +GL_SGL_GNULIB_RENAME = @GL_SGL_GNULIB_RENAME@ +GL_SGL_GNULIB_RENAMEAT = @GL_SGL_GNULIB_RENAMEAT@ +GL_SGL_GNULIB_RMDIR = @GL_SGL_GNULIB_RMDIR@ +GL_SGL_GNULIB_RPMATCH = @GL_SGL_GNULIB_RPMATCH@ +GL_SGL_GNULIB_SCANF = @GL_SGL_GNULIB_SCANF@ +GL_SGL_GNULIB_SECURE_GETENV = @GL_SGL_GNULIB_SECURE_GETENV@ +GL_SGL_GNULIB_SETENV = @GL_SGL_GNULIB_SETENV@ +GL_SGL_GNULIB_SETHOSTNAME = @GL_SGL_GNULIB_SETHOSTNAME@ +GL_SGL_GNULIB_SIGABBREV_NP = @GL_SGL_GNULIB_SIGABBREV_NP@ +GL_SGL_GNULIB_SIGDESCR_NP = @GL_SGL_GNULIB_SIGDESCR_NP@ +GL_SGL_GNULIB_SLEEP = @GL_SGL_GNULIB_SLEEP@ +GL_SGL_GNULIB_SNPRINTF = @GL_SGL_GNULIB_SNPRINTF@ +GL_SGL_GNULIB_SPRINTF_POSIX = @GL_SGL_GNULIB_SPRINTF_POSIX@ +GL_SGL_GNULIB_STAT = @GL_SGL_GNULIB_STAT@ +GL_SGL_GNULIB_STDIO_H_NONBLOCKING = @GL_SGL_GNULIB_STDIO_H_NONBLOCKING@ +GL_SGL_GNULIB_STDIO_H_SIGPIPE = @GL_SGL_GNULIB_STDIO_H_SIGPIPE@ +GL_SGL_GNULIB_STPCPY = @GL_SGL_GNULIB_STPCPY@ +GL_SGL_GNULIB_STPNCPY = @GL_SGL_GNULIB_STPNCPY@ +GL_SGL_GNULIB_STRCASESTR = @GL_SGL_GNULIB_STRCASESTR@ +GL_SGL_GNULIB_STRCHRNUL = @GL_SGL_GNULIB_STRCHRNUL@ +GL_SGL_GNULIB_STRDUP = @GL_SGL_GNULIB_STRDUP@ +GL_SGL_GNULIB_STRERROR = @GL_SGL_GNULIB_STRERROR@ +GL_SGL_GNULIB_STRERRORNAME_NP = @GL_SGL_GNULIB_STRERRORNAME_NP@ +GL_SGL_GNULIB_STRERROR_R = @GL_SGL_GNULIB_STRERROR_R@ +GL_SGL_GNULIB_STRFTIME = @GL_SGL_GNULIB_STRFTIME@ +GL_SGL_GNULIB_STRNCAT = @GL_SGL_GNULIB_STRNCAT@ +GL_SGL_GNULIB_STRNDUP = @GL_SGL_GNULIB_STRNDUP@ +GL_SGL_GNULIB_STRNLEN = @GL_SGL_GNULIB_STRNLEN@ +GL_SGL_GNULIB_STRPBRK = @GL_SGL_GNULIB_STRPBRK@ +GL_SGL_GNULIB_STRPTIME = @GL_SGL_GNULIB_STRPTIME@ +GL_SGL_GNULIB_STRSEP = @GL_SGL_GNULIB_STRSEP@ +GL_SGL_GNULIB_STRSIGNAL = @GL_SGL_GNULIB_STRSIGNAL@ +GL_SGL_GNULIB_STRSTR = @GL_SGL_GNULIB_STRSTR@ +GL_SGL_GNULIB_STRTOD = @GL_SGL_GNULIB_STRTOD@ +GL_SGL_GNULIB_STRTOIMAX = @GL_SGL_GNULIB_STRTOIMAX@ +GL_SGL_GNULIB_STRTOK_R = @GL_SGL_GNULIB_STRTOK_R@ +GL_SGL_GNULIB_STRTOL = @GL_SGL_GNULIB_STRTOL@ +GL_SGL_GNULIB_STRTOLD = @GL_SGL_GNULIB_STRTOLD@ +GL_SGL_GNULIB_STRTOLL = @GL_SGL_GNULIB_STRTOLL@ +GL_SGL_GNULIB_STRTOUL = @GL_SGL_GNULIB_STRTOUL@ +GL_SGL_GNULIB_STRTOULL = @GL_SGL_GNULIB_STRTOULL@ +GL_SGL_GNULIB_STRTOUMAX = @GL_SGL_GNULIB_STRTOUMAX@ +GL_SGL_GNULIB_STRVERSCMP = @GL_SGL_GNULIB_STRVERSCMP@ +GL_SGL_GNULIB_SYMLINK = @GL_SGL_GNULIB_SYMLINK@ +GL_SGL_GNULIB_SYMLINKAT = @GL_SGL_GNULIB_SYMLINKAT@ +GL_SGL_GNULIB_SYSTEM_POSIX = @GL_SGL_GNULIB_SYSTEM_POSIX@ +GL_SGL_GNULIB_TIMEGM = @GL_SGL_GNULIB_TIMEGM@ +GL_SGL_GNULIB_TIMESPEC_GET = @GL_SGL_GNULIB_TIMESPEC_GET@ +GL_SGL_GNULIB_TIMESPEC_GETRES = @GL_SGL_GNULIB_TIMESPEC_GETRES@ +GL_SGL_GNULIB_TIME_R = @GL_SGL_GNULIB_TIME_R@ +GL_SGL_GNULIB_TIME_RZ = @GL_SGL_GNULIB_TIME_RZ@ +GL_SGL_GNULIB_TMPFILE = @GL_SGL_GNULIB_TMPFILE@ +GL_SGL_GNULIB_TRUNCATE = @GL_SGL_GNULIB_TRUNCATE@ +GL_SGL_GNULIB_TTYNAME_R = @GL_SGL_GNULIB_TTYNAME_R@ +GL_SGL_GNULIB_TZSET = @GL_SGL_GNULIB_TZSET@ +GL_SGL_GNULIB_UNISTD_H_GETOPT = @GL_SGL_GNULIB_UNISTD_H_GETOPT@ +GL_SGL_GNULIB_UNISTD_H_NONBLOCKING = @GL_SGL_GNULIB_UNISTD_H_NONBLOCKING@ +GL_SGL_GNULIB_UNISTD_H_SIGPIPE = @GL_SGL_GNULIB_UNISTD_H_SIGPIPE@ +GL_SGL_GNULIB_UNLINK = @GL_SGL_GNULIB_UNLINK@ +GL_SGL_GNULIB_UNLINKAT = @GL_SGL_GNULIB_UNLINKAT@ +GL_SGL_GNULIB_UNLOCKPT = @GL_SGL_GNULIB_UNLOCKPT@ +GL_SGL_GNULIB_UNSETENV = @GL_SGL_GNULIB_UNSETENV@ +GL_SGL_GNULIB_USLEEP = @GL_SGL_GNULIB_USLEEP@ +GL_SGL_GNULIB_UTIMENSAT = @GL_SGL_GNULIB_UTIMENSAT@ +GL_SGL_GNULIB_VASPRINTF = @GL_SGL_GNULIB_VASPRINTF@ +GL_SGL_GNULIB_VDPRINTF = @GL_SGL_GNULIB_VDPRINTF@ +GL_SGL_GNULIB_VFPRINTF = @GL_SGL_GNULIB_VFPRINTF@ +GL_SGL_GNULIB_VFPRINTF_POSIX = @GL_SGL_GNULIB_VFPRINTF_POSIX@ +GL_SGL_GNULIB_VFSCANF = @GL_SGL_GNULIB_VFSCANF@ +GL_SGL_GNULIB_VPRINTF = @GL_SGL_GNULIB_VPRINTF@ +GL_SGL_GNULIB_VPRINTF_POSIX = @GL_SGL_GNULIB_VPRINTF_POSIX@ +GL_SGL_GNULIB_VSCANF = @GL_SGL_GNULIB_VSCANF@ +GL_SGL_GNULIB_VSNPRINTF = @GL_SGL_GNULIB_VSNPRINTF@ +GL_SGL_GNULIB_VSPRINTF_POSIX = @GL_SGL_GNULIB_VSPRINTF_POSIX@ +GL_SGL_GNULIB_WCPCPY = @GL_SGL_GNULIB_WCPCPY@ +GL_SGL_GNULIB_WCPNCPY = @GL_SGL_GNULIB_WCPNCPY@ +GL_SGL_GNULIB_WCRTOMB = @GL_SGL_GNULIB_WCRTOMB@ +GL_SGL_GNULIB_WCSCASECMP = @GL_SGL_GNULIB_WCSCASECMP@ +GL_SGL_GNULIB_WCSCAT = @GL_SGL_GNULIB_WCSCAT@ +GL_SGL_GNULIB_WCSCHR = @GL_SGL_GNULIB_WCSCHR@ +GL_SGL_GNULIB_WCSCMP = @GL_SGL_GNULIB_WCSCMP@ +GL_SGL_GNULIB_WCSCOLL = @GL_SGL_GNULIB_WCSCOLL@ +GL_SGL_GNULIB_WCSCPY = @GL_SGL_GNULIB_WCSCPY@ +GL_SGL_GNULIB_WCSCSPN = @GL_SGL_GNULIB_WCSCSPN@ +GL_SGL_GNULIB_WCSDUP = @GL_SGL_GNULIB_WCSDUP@ +GL_SGL_GNULIB_WCSFTIME = @GL_SGL_GNULIB_WCSFTIME@ +GL_SGL_GNULIB_WCSLEN = @GL_SGL_GNULIB_WCSLEN@ +GL_SGL_GNULIB_WCSNCASECMP = @GL_SGL_GNULIB_WCSNCASECMP@ +GL_SGL_GNULIB_WCSNCAT = @GL_SGL_GNULIB_WCSNCAT@ +GL_SGL_GNULIB_WCSNCMP = @GL_SGL_GNULIB_WCSNCMP@ +GL_SGL_GNULIB_WCSNCPY = @GL_SGL_GNULIB_WCSNCPY@ +GL_SGL_GNULIB_WCSNLEN = @GL_SGL_GNULIB_WCSNLEN@ +GL_SGL_GNULIB_WCSNRTOMBS = @GL_SGL_GNULIB_WCSNRTOMBS@ +GL_SGL_GNULIB_WCSPBRK = @GL_SGL_GNULIB_WCSPBRK@ +GL_SGL_GNULIB_WCSRCHR = @GL_SGL_GNULIB_WCSRCHR@ +GL_SGL_GNULIB_WCSRTOMBS = @GL_SGL_GNULIB_WCSRTOMBS@ +GL_SGL_GNULIB_WCSSPN = @GL_SGL_GNULIB_WCSSPN@ +GL_SGL_GNULIB_WCSSTR = @GL_SGL_GNULIB_WCSSTR@ +GL_SGL_GNULIB_WCSTOK = @GL_SGL_GNULIB_WCSTOK@ +GL_SGL_GNULIB_WCSWIDTH = @GL_SGL_GNULIB_WCSWIDTH@ +GL_SGL_GNULIB_WCSXFRM = @GL_SGL_GNULIB_WCSXFRM@ +GL_SGL_GNULIB_WCTOB = @GL_SGL_GNULIB_WCTOB@ +GL_SGL_GNULIB_WCTOMB = @GL_SGL_GNULIB_WCTOMB@ +GL_SGL_GNULIB_WCWIDTH = @GL_SGL_GNULIB_WCWIDTH@ +GL_SGL_GNULIB_WMEMCHR = @GL_SGL_GNULIB_WMEMCHR@ +GL_SGL_GNULIB_WMEMCMP = @GL_SGL_GNULIB_WMEMCMP@ +GL_SGL_GNULIB_WMEMCPY = @GL_SGL_GNULIB_WMEMCPY@ +GL_SGL_GNULIB_WMEMMOVE = @GL_SGL_GNULIB_WMEMMOVE@ +GL_SGL_GNULIB_WMEMPCPY = @GL_SGL_GNULIB_WMEMPCPY@ +GL_SGL_GNULIB_WMEMSET = @GL_SGL_GNULIB_WMEMSET@ +GL_SGL_GNULIB_WRITE = @GL_SGL_GNULIB_WRITE@ +GL_SGL_GNULIB__EXIT = @GL_SGL_GNULIB__EXIT@ +GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ @@ -387,43 +922,233 @@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ +HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ECVT = @HAVE_DECL_ECVT@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@ +HAVE_DECL_FCVT = @HAVE_DECL_FCVT@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GCVT = @HAVE_DECL_GCVT@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXECVPE = @HAVE_EXECVPE@ HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETENTROPY = @HAVE_GETENTROPY@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ +HAVE_GETUMASK = @HAVE_GETUMASK@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ +HAVE_INITSTATE = @HAVE_INITSTATE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ -HAVE_MEMCHR = @HAVE_MEMCHR@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MBTOWC = @HAVE_MBTOWC@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SETSTATE = @HAVE_SETSTATE@ +HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ +HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOL = @HAVE_STRTOL@ +HAVE_STRTOLD = @HAVE_STRTOLD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOUL = @HAVE_STRTOUL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ +HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMPCPY = @HAVE_WMEMPCPY@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE__BOOL = @HAVE__BOOL@ +HAVE__EXIT = @HAVE__EXIT@ HELP2MAN = @HELP2MAN@ HTML_DIR = @HTML_DIR@ INCLUDE_NEXT = @INCLUDE_NEXT@ @@ -433,36 +1158,70 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@ LIBTOOL = @LIBTOOL@ +LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIMITS_H = @LIMITS_H@ LIPO = @LIPO@ LN_S = @LN_S@ +LOG_VALGRIND = @LOG_VALGRIND@ +LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ +MINOR_VERSION = @MINOR_VERSION@ MKDIR_P = @MKDIR_P@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ NM = @NM@ NMEDIT = @NMEDIT@ +NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ @@ -474,42 +1233,216 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PATCH_VERSION = @PATCH_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_ACCESS = @REPLACE_ACCESS@ +REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ +REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHMOD = @REPLACE_CHMOD@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@ +REPLACE_CREAT = @REPLACE_CREAT@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_EXECL = @REPLACE_EXECL@ +REPLACE_EXECLE = @REPLACE_EXECLE@ +REPLACE_EXECLP = @REPLACE_EXECLP@ +REPLACE_EXECV = @REPLACE_EXECV@ +REPLACE_EXECVE = @REPLACE_EXECVE@ +REPLACE_EXECVP = @REPLACE_EXECVP@ +REPLACE_EXECVPE = @REPLACE_EXECVPE@ +REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ +REPLACE_FCHMODAT = @REPLACE_FCHMODAT@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FFSLL = @REPLACE_FFSLL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREE = @REPLACE_FREE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ +REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_INITSTATE = @REPLACE_INITSTATE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@ +REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKNODAT = @REPLACE_MKNODAT@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RANDOM = @REPLACE_RANDOM@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@ +REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@ +REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETSTATE = @REPLACE_SETSTATE@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ REPLACE_STPNCPY = @REPLACE_STPNCPY@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOL = @REPLACE_STRTOL@ +REPLACE_STRTOLD = @REPLACE_STRTOLD@ +REPLACE_STRTOLL = @REPLACE_STRTOLL@ +REPLACE_STRTOUL = @REPLACE_STRTOUL@ +REPLACE_STRTOULL = @REPLACE_STRTOULL@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSTOK = @REPLACE_WCSTOK@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +STDARG_H = @STDARG_H@ +STDBOOL_H = @STDBOOL_H@ +STDCKDINT_H = @STDCKDINT_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VALGRIND = @VALGRIND@ +VALGRINDFLAGS = @VALGRINDFLAGS@ +VALGRIND_PROGRAM = @VALGRIND_PROGRAM@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ YFLAGS = @YFLAGS@ @@ -537,8 +1470,10 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gl_LIBOBJDEPS = @gl_LIBOBJDEPS@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ @@ -566,6 +1501,13 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ +sgl_LIBOBJDEPS = @sgl_LIBOBJDEPS@ +sgl_LIBOBJS = @sgl_LIBOBJS@ +sgl_LTLIBOBJS = @sgl_LTLIBOBJS@ +sgltests_LIBOBJDEPS = @sgltests_LIBOBJDEPS@ +sgltests_LIBOBJS = @sgltests_LIBOBJS@ +sgltests_LTLIBOBJS = @sgltests_LTLIBOBJS@ +sgltests_WITNESS = @sgltests_WITNESS@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ @@ -573,23 +1515,32 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = 1.11 gnits +AUTOMAKE_OPTIONS = 1.14 gnits SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = noinst_LTLIBRARIES = libgnu.la -EXTRA_DIST = $(top_srcdir)/GNUmakefile intprops.h cdefs.h \ - libc-config.h limits.in.h $(top_srcdir)/maint.mk arg-nonnull.h \ - c++defs.h warn-on-use.h stddef.in.h stdint.in.h string.in.h \ - strverscmp.c sys_types.in.h \ +EXTRA_DIST = $(top_srcdir)/build-aux/announce-gen \ + $(top_srcdir)/build-aux/do-release-commit-and-tag \ + $(top_srcdir)/build-aux/gendocs.sh \ + $(top_srcdir)/build-aux/git-version-gen \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $(top_srcdir)/build-aux/gnu-web-doc-update \ + $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ + intprops-internal.h intprops.h cdefs.h libc-config.h \ + limits.in.h $(top_srcdir)/maint.mk _Noreturn.h arg-nonnull.h \ + c++defs.h warn-on-use.h stdbool.in.h stddef.in.h stdint.in.h \ + stdlib.in.h string.in.h sys_types.in.h unistd.in.h \ + $(top_srcdir)/build-aux/update-copyright \ $(top_srcdir)/build-aux/useless-if-before-free \ $(top_srcdir)/build-aux/vc-list-files -BUILT_SOURCES = $(LIMITS_H) $(STDDEF_H) $(STDINT_H) string.h \ - sys/types.h +BUILT_SOURCES = $(LIMITS_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \ + stdlib.h string.h sys/types.h unistd.h SUFFIXES = -MOSTLYCLEANFILES = core *.stackdump limits.h limits.h-t stddef.h \ - stddef.h-t stdint.h stdint.h-t string.h string.h-t sys/types.h \ - sys/types.h-t +MOSTLYCLEANFILES = core *.stackdump limits.h limits.h-t stdbool.h \ + stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdlib.h \ + stdlib.h-t string.h string.h-t sys/types.h sys/types.h-t \ + unistd.h unistd.h-t MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = @@ -602,16 +1553,38 @@ AM_CPPFLAGS = # only for the gnulib part of it. The developer is responsible for adding # $(CFLAG_VISIBILITY) to the Makefile.ams of the other portions of the library. AM_CFLAGS = $(CFLAG_VISIBILITY) -libgnu_la_SOURCES = hash-pjw-bare.h hash-pjw-bare.c minmax.h +libgnu_la_SOURCES = c-ctype.h c-ctype.c minmax.h $(am__append_1) \ + unistd.c +libgnu_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS) libgnu_la_LIBADD = $(gl_LTLIBOBJS) libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) -EXTRA_libgnu_la_SOURCES = strverscmp.c +EXTRA_libgnu_la_SOURCES = libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined # Use this preprocessor expression to decide whether #include_next works. # Do not rely on a 'configure'-time test for this, since the expression # might appear in an installed header, which is used by some other compiler. -HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) +HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER) + +# In 'sed', replace the pattern space with a "DO NOT EDIT" comment. +SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */, + +# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT". +SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G + +# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading +# "DO_NOT_EDIT". Although this could be done more simply via: +# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t +# the -n and 'w' avoid a fork+exec, at least when GNU Make is used. +SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t' + +# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that +gl_V_at = $(AM_V_GEN) + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +_NORETURN_H = $(srcdir)/_Noreturn.h # Because this Makefile snippet defines a variable used by other # gnulib Makefile snippets, it must be present in all makefiles that @@ -685,8 +1658,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-pjw-bare.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-c-ctype.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strverscmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-unistd.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -715,6 +1689,27 @@ am--depfiles: $(am__depfiles_remade) @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +libgnu_la-c-ctype.lo: c-ctype.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-c-ctype.lo -MD -MP -MF $(DEPDIR)/libgnu_la-c-ctype.Tpo -c -o libgnu_la-c-ctype.lo `test -f 'c-ctype.c' || echo '$(srcdir)/'`c-ctype.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-c-ctype.Tpo $(DEPDIR)/libgnu_la-c-ctype.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c-ctype.c' object='libgnu_la-c-ctype.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-c-ctype.lo `test -f 'c-ctype.c' || echo '$(srcdir)/'`c-ctype.c + +libgnu_la-strverscmp.lo: strverscmp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strverscmp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strverscmp.Tpo -c -o libgnu_la-strverscmp.lo `test -f 'strverscmp.c' || echo '$(srcdir)/'`strverscmp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strverscmp.Tpo $(DEPDIR)/libgnu_la-strverscmp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strverscmp.c' object='libgnu_la-strverscmp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-strverscmp.lo `test -f 'strverscmp.c' || echo '$(srcdir)/'`strverscmp.c + +libgnu_la-unistd.lo: unistd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-unistd.lo -MD -MP -MF $(DEPDIR)/libgnu_la-unistd.Tpo -c -o libgnu_la-unistd.lo `test -f 'unistd.c' || echo '$(srcdir)/'`unistd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-unistd.Tpo $(DEPDIR)/libgnu_la-unistd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unistd.c' object='libgnu_la-unistd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-unistd.lo `test -f 'unistd.c' || echo '$(srcdir)/'`unistd.c + mostlyclean-libtool: -rm -f *.lo @@ -819,7 +1814,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -886,7 +1880,8 @@ installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -926,8 +1921,9 @@ clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive - -rm -f ./$(DEPDIR)/hash-pjw-bare.Plo - -rm -f ./$(DEPDIR)/strverscmp.Plo + -rm -f ./$(DEPDIR)/libgnu_la-c-ctype.Plo + -rm -f ./$(DEPDIR)/libgnu_la-strverscmp.Plo + -rm -f ./$(DEPDIR)/libgnu_la-unistd.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-local distclean-tags @@ -973,10 +1969,12 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f ./$(DEPDIR)/hash-pjw-bare.Plo - -rm -f ./$(DEPDIR)/strverscmp.Plo + -rm -f ./$(DEPDIR)/libgnu_la-c-ctype.Plo + -rm -f ./$(DEPDIR)/libgnu_la-strverscmp.Plo + -rm -f ./$(DEPDIR)/libgnu_la-unistd.Plo -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local mostlyclean: mostlyclean-recursive @@ -994,7 +1992,7 @@ ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all check install install-am \ - install-strip + install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ @@ -1007,10 +2005,10 @@ uninstall-am: install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - mostlyclean-local pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am + maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile @@ -1021,25 +2019,32 @@ clean-GNUmakefile: # We need the following in order to create <limits.h> when the system # doesn't have one that is compatible with GNU. @GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status -@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ -@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ -@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \ @GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ -@GL_GENERATE_LIMITS_H_TRUE@ < $(srcdir)/limits.in.h; \ -@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \ -@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@ +@GL_GENERATE_LIMITS_H_TRUE@ $(srcdir)/limits.in.h > $@-t +@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_at)mv $@-t $@ @GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status @GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ +# We need the following in order to create <stdbool.h> when the system +# doesn't have one that works. +@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \ +@GL_GENERATE_STDBOOL_H_TRUE@ -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \ +@GL_GENERATE_STDBOOL_H_TRUE@ $(srcdir)/stdbool.in.h > $@-t +@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_at)mv $@-t $@ +@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@ + # We need the following in order to create <stddef.h> when the system # doesn't have one that works with the given compiler. @GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status -@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ -@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ -@GL_GENERATE_STDDEF_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @@ -1047,18 +2052,16 @@ clean-GNUmakefile: @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ @GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ -@GL_GENERATE_STDDEF_H_TRUE@ < $(srcdir)/stddef.in.h; \ -@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \ -@GL_GENERATE_STDDEF_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDDEF_H_TRUE@ $(srcdir)/stddef.in.h > $@-t +@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_at)mv $@-t $@ @GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status @GL_GENERATE_STDDEF_H_FALSE@ rm -f $@ # We need the following in order to create <stdint.h> when the system # doesn't have one that works with the given compiler. @GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status -@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ -@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDINT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @@ -1070,8 +2073,6 @@ clean-GNUmakefile: @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ @@ -1086,67 +2087,210 @@ clean-GNUmakefile: @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ -@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ -@GL_GENERATE_STDINT_H_TRUE@ < $(srcdir)/stdint.in.h; \ -@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ -@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ $(srcdir)/stdint.in.h > $@-t +@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_at)mv $@-t $@ @GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status @GL_GENERATE_STDINT_H_FALSE@ rm -f $@ +# We need the following in order to create <stdlib.h> when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GL_GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GL_GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_GNULIB_POSIX_MEMALIGN)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GL_GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_GNULIB_REALLOCARRAY)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GL_GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \ + -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOUL''@/$(GL_GNULIB_STRTOUL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GL_GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GL_GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GL_GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GL_GNULIB_WCTOMB)/g' \ + -e 's/@''GNULIB_MDA_ECVT''@/$(GL_GNULIB_MDA_ECVT)/g' \ + -e 's/@''GNULIB_MDA_FCVT''@/$(GL_GNULIB_MDA_FCVT)/g' \ + -e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \ + -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \ + -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \ + -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \ + -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \ + -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \ + -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ + -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \ + -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \ + -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \ + -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ + -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ + -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \ + -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \ + -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \ + -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|$(REPLACE_REALLOC_FOR_REALLOC_POSIX)|g' \ + -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \ + -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ + -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \ + -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \ + -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + > $@-t + $(AM_V_at)mv $@-t $@ + # We need the following in order to create <string.h> when the system # doesn't have one that works with the given compiler. string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ - -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GNULIB_EXPLICIT_BZERO)/g' \ - -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ - -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ - -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ - -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ - -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ - -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ - -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ - -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ - -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ - -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ - -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ - -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ - -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ - -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ - -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ - -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ - -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ - -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ - -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ - -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ - -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ - -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ - -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ - -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ - -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ - -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ - -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ - -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ - -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ - -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ - -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ - -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ - -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ - -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ - -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ - -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ - -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_GNULIB_EXPLICIT_BZERO)/g' \ + -e 's/@''GNULIB_FFSL''@/$(GL_GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GL_GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GL_GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GL_GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GL_GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GL_GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GL_GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GL_GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GL_GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GL_GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GL_GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GL_GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GL_GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GL_GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \ + -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_GNULIB_SIGABBREV_NP)/g' \ + -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_GNULIB_SIGDESCR_NP)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GL_GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GL_GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \ + -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \ < $(srcdir)/string.in.h | \ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ - -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -1162,10 +2306,15 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ + -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ + -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ @@ -1177,31 +2326,226 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ - < $(srcdir)/string.in.h; \ - } > $@-t && \ - mv $@-t $@ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + > $@-t + $(AM_V_at)mv $@-t $@ # We need the following in order to create <sys/types.h> when the system # doesn't have one that works with the given compiler. sys/types.h: sys_types.in.h $(top_builddir)/config.status - $(AM_V_at)$(MKDIR_P) sys - $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + $(AM_V_GEN)$(MKDIR_P) 'sys' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ - < $(srcdir)/sys_types.in.h; \ - } > $@-t && \ - mv $@-t $@ + $(srcdir)/sys_types.in.h > $@-t + $(AM_V_at)mv $@-t $@ + +# We need the following in order to create an empty placeholder for +# <unistd.h> when the system doesn't have one. +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_ACCESS''@/$(GL_GNULIB_ACCESS)/g' \ + -e 's/@''GNULIB_CHDIR''@/$(GL_GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GL_GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_GNULIB_COPY_FILE_RANGE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GL_GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GL_GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GL_GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GL_GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GL_GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_EXECL''@/$(GL_GNULIB_EXECL)/g' \ + -e 's/@''GNULIB_EXECLE''@/$(GL_GNULIB_EXECLE)/g' \ + -e 's/@''GNULIB_EXECLP''@/$(GL_GNULIB_EXECLP)/g' \ + -e 's/@''GNULIB_EXECV''@/$(GL_GNULIB_EXECV)/g' \ + -e 's/@''GNULIB_EXECVE''@/$(GL_GNULIB_EXECVE)/g' \ + -e 's/@''GNULIB_EXECVP''@/$(GL_GNULIB_EXECVP)/g' \ + -e 's/@''GNULIB_EXECVPE''@/$(GL_GNULIB_EXECVPE)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GL_GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GL_GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GL_GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETENTROPY''@/$(GL_GNULIB_GETENTROPY)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GL_GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GL_GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_GNULIB_GETOPT_POSIX)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETPASS''@/$(GL_GNULIB_GETPASS)/g' \ + -e 's/@''GNULIB_GETPASS_GNU''@/$(GL_GNULIB_GETPASS_GNU)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GL_GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GL_GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GL_GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GL_GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GL_GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GL_GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GL_GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GL_GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GL_GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GL_GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GL_GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GL_GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GL_GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GL_GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GL_GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GL_GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TRUNCATE''@/$(GL_GNULIB_TRUNCATE)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GL_GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GL_GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GL_GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GL_GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GL_GNULIB_WRITE)/g' \ + -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_GNULIB_MDA_ACCESS)/g' \ + -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_GNULIB_MDA_CHDIR)/g' \ + -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_GNULIB_MDA_CLOSE)/g' \ + -e 's/@''GNULIB_MDA_DUP''@/$(GL_GNULIB_MDA_DUP)/g' \ + -e 's/@''GNULIB_MDA_DUP2''@/$(GL_GNULIB_MDA_DUP2)/g' \ + -e 's/@''GNULIB_MDA_EXECL''@/$(GL_GNULIB_MDA_EXECL)/g' \ + -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_GNULIB_MDA_EXECLE)/g' \ + -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_GNULIB_MDA_EXECLP)/g' \ + -e 's/@''GNULIB_MDA_EXECV''@/$(GL_GNULIB_MDA_EXECV)/g' \ + -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_GNULIB_MDA_EXECVE)/g' \ + -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_GNULIB_MDA_EXECVP)/g' \ + -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_GNULIB_MDA_EXECVPE)/g' \ + -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_GNULIB_MDA_GETCWD)/g' \ + -e 's/@''GNULIB_MDA_GETPID''@/$(GL_GNULIB_MDA_GETPID)/g' \ + -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_GNULIB_MDA_ISATTY)/g' \ + -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_GNULIB_MDA_LSEEK)/g' \ + -e 's/@''GNULIB_MDA_READ''@/$(GL_GNULIB_MDA_READ)/g' \ + -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_GNULIB_MDA_RMDIR)/g' \ + -e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \ + -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \ + -e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \ + < $(srcdir)/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \ + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ + -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \ + -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \ + -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \ + -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \ + -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \ + -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \ + -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \ + -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ + -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + > $@-t + $(AM_V_at)mv $@-t $@ mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ @@ -1210,6 +2554,10 @@ mostlyclean-local: mostlyclean-generic fi; \ done; \ : +distclean-local: distclean-gnulib-libobjs +distclean-gnulib-libobjs: + -rm -f @gl_LIBOBJDEPS@ +maintainer-clean-local: distclean-gnulib-libobjs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/lib/gl/_Noreturn.h b/lib/gl/_Noreturn.h new file mode 100644 index 0000000..e914627 --- /dev/null +++ b/lib/gl/_Noreturn.h @@ -0,0 +1,45 @@ +/* A C macro for declaring that a function does not return. + Copyright (C) 2011-2022 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 <https://www.gnu.org/licenses/>. */ + +#ifndef _Noreturn +# if (defined __cplusplus \ + && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \ + || (defined _MSC_VER && 1900 <= _MSC_VER)) \ + && 0) + /* [[noreturn]] is not practically usable, because with it the syntax + extern _Noreturn void func (...); + would not be valid; such a declaration would only be valid with 'extern' + and '_Noreturn' swapped, or without the 'extern' keyword. However, some + AIX system header files and several gnulib header files use precisely + this syntax with 'extern'. */ +# define _Noreturn [[noreturn]] +# elif ((!defined __cplusplus || defined __clang__) \ + && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ + || (!defined __STRICT_ANSI__ \ + && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ + || (defined __apple_build_version__ \ + ? 6000000 <= __apple_build_version__ \ + : 3 < __clang_major__ + (5 <= __clang_minor__)))))) + /* _Noreturn works as-is. */ +# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif +#endif diff --git a/lib/gl/arg-nonnull.h b/lib/gl/arg-nonnull.h index ae3d858..e4513ef 100644 --- a/lib/gl/arg-nonnull.h +++ b/lib/gl/arg-nonnull.h @@ -1,9 +1,9 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2019 Free Software Foundation, Inc. + Copyright (C) 2009-2022 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.1 of the License, or + 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, @@ -18,7 +18,7 @@ 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 +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) # else # define _GL_ARG_NONNULL(params) diff --git a/lib/gl/c++defs.h b/lib/gl/c++defs.h index 51d64a1..ad18155 100644 --- a/lib/gl/c++defs.h +++ b/lib/gl/c++defs.h @@ -1,9 +1,9 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2019 Free Software Foundation, Inc. + Copyright (C) 2010-2022 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.1 of the License, or + 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, @@ -146,6 +146,16 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif +/* _GL_CXXALIAS_MDA (func, rettype, parameters); + is to be used when func is a Microsoft deprecated alias, on native Windows. + It declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to _func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); + */ +#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) + /* _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 @@ -171,6 +181,14 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif +/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_MDA (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. */ +#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) + /* _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 @@ -268,7 +286,7 @@ _GL_CXXALIASWARN_2 (func, namespace) /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_WARN_ON_USE (func, \ "The symbol ::" #func " refers to the system function. " \ @@ -296,14 +314,11 @@ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ "The symbol ::" #func " refers to the system function. " \ "Use " #namespace "::" #func " instead.") -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - extern __typeof__ (func) func # else # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ _GL_EXTERN_C int _gl_cxxalias_dummy diff --git a/lib/gl/c-ctype.c b/lib/gl/c-ctype.c new file mode 100644 index 0000000..a247514 --- /dev/null +++ b/lib/gl/c-ctype.c @@ -0,0 +1,21 @@ +/* Character handling in C locale. + + Copyright (C) 2003-2022 Free Software Foundation, Inc. + + This file 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. + + This file 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 <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +#define C_CTYPE_INLINE _GL_EXTERN_INLINE +#include "c-ctype.h" diff --git a/lib/gl/c-ctype.h b/lib/gl/c-ctype.h new file mode 100644 index 0000000..1a4f603 --- /dev/null +++ b/lib/gl/c-ctype.h @@ -0,0 +1,366 @@ +/* Character handling in C locale. + + These functions work like the corresponding functions in <ctype.h>, + except that they have the C (POSIX) locale hardwired, whereas the + <ctype.h> functions' behaviour depends on the current locale set via + setlocale. + + Copyright (C) 2000-2003, 2006, 2008-2022 Free Software Foundation, Inc. + + This file 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. + + This file 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 <https://www.gnu.org/licenses/>. */ + +#ifndef C_CTYPE_H +#define C_CTYPE_H + +#include <stdbool.h> + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef C_CTYPE_INLINE +# define C_CTYPE_INLINE _GL_INLINE +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* The functions defined in this file assume the "C" locale and a character + set without diacritics (ASCII-US or EBCDIC-US or something like that). + Even if the "C" locale on a particular system is an extension of the ASCII + character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it + is ISO-8859-1), the functions in this file recognize only the ASCII + characters. */ + + +#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) +/* The character set is ASCII or one of its variants or extensions, not EBCDIC. + Testing the value of '\n' and '\r' is not relevant. */ +# define C_CTYPE_ASCII 1 +#elif ! (' ' == '\x40' && '0' == '\xf0' \ + && 'A' == '\xc1' && 'J' == '\xd1' && 'S' == '\xe2' \ + && 'a' == '\x81' && 'j' == '\x91' && 's' == '\xa2') +# error "Only ASCII and EBCDIC are supported" +#endif + +#if 'A' < 0 +# error "EBCDIC and char is signed -- not supported" +#endif + +/* Cases for control characters. */ + +#define _C_CTYPE_CNTRL \ + case '\a': case '\b': case '\f': case '\n': \ + case '\r': case '\t': case '\v': \ + _C_CTYPE_OTHER_CNTRL + +/* ASCII control characters other than those with \-letter escapes. */ + +#if C_CTYPE_ASCII +# define _C_CTYPE_OTHER_CNTRL \ + case '\x00': case '\x01': case '\x02': case '\x03': \ + case '\x04': case '\x05': case '\x06': case '\x0e': \ + case '\x0f': case '\x10': case '\x11': case '\x12': \ + case '\x13': case '\x14': case '\x15': case '\x16': \ + case '\x17': case '\x18': case '\x19': case '\x1a': \ + case '\x1b': case '\x1c': case '\x1d': case '\x1e': \ + case '\x1f': case '\x7f' +#else + /* Use EBCDIC code page 1047's assignments for ASCII control chars; + assume all EBCDIC code pages agree about these assignments. */ +# define _C_CTYPE_OTHER_CNTRL \ + case '\x00': case '\x01': case '\x02': case '\x03': \ + case '\x07': case '\x0e': case '\x0f': case '\x10': \ + case '\x11': case '\x12': case '\x13': case '\x18': \ + case '\x19': case '\x1c': case '\x1d': case '\x1e': \ + case '\x1f': case '\x26': case '\x27': case '\x2d': \ + case '\x2e': case '\x32': case '\x37': case '\x3c': \ + case '\x3d': case '\x3f' +#endif + +/* Cases for lowercase hex letters, and lowercase letters, all offset by N. */ + +#define _C_CTYPE_LOWER_A_THRU_F_N(N) \ + case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \ + case 'e' + (N): case 'f' + (N) +#define _C_CTYPE_LOWER_N(N) \ + _C_CTYPE_LOWER_A_THRU_F_N(N): \ + case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \ + case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \ + case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \ + case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \ + case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N) + +/* Cases for hex letters, digits, lower, punct, and upper. */ + +#define _C_CTYPE_A_THRU_F \ + _C_CTYPE_LOWER_A_THRU_F_N (0): \ + _C_CTYPE_LOWER_A_THRU_F_N ('A' - 'a') +#define _C_CTYPE_DIGIT \ + case '0': case '1': case '2': case '3': \ + case '4': case '5': case '6': case '7': \ + case '8': case '9' +#define _C_CTYPE_LOWER _C_CTYPE_LOWER_N (0) +#define _C_CTYPE_PUNCT \ + case '!': case '"': case '#': case '$': \ + case '%': case '&': case '\'': case '(': \ + case ')': case '*': case '+': case ',': \ + case '-': case '.': case '/': case ':': \ + case ';': case '<': case '=': case '>': \ + case '?': case '@': case '[': case '\\': \ + case ']': case '^': case '_': case '`': \ + case '{': case '|': case '}': case '~' +#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a') + + +/* Function definitions. */ + +/* Unlike the functions in <ctype.h>, which require an argument in the range + of the 'unsigned char' type, the functions here operate on values that are + in the 'unsigned char' range or in the 'char' range. In other words, + when you have a 'char' value, you need to cast it before using it as + argument to a <ctype.h> function: + + const char *s = ...; + if (isalpha ((unsigned char) *s)) ... + + but you don't need to cast it for the functions defined in this file: + + const char *s = ...; + if (c_isalpha (*s)) ... + */ + +C_CTYPE_INLINE bool +c_isalnum (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isalpha (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +/* The function isascii is not locale dependent. + Its use in EBCDIC is questionable. */ +C_CTYPE_INLINE bool +c_isascii (int c) +{ + switch (c) + { + case ' ': + _C_CTYPE_CNTRL: + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isblank (int c) +{ + return c == ' ' || c == '\t'; +} + +C_CTYPE_INLINE bool +c_iscntrl (int c) +{ + switch (c) + { + _C_CTYPE_CNTRL: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isdigit (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isgraph (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_islower (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isprint (int c) +{ + switch (c) + { + case ' ': + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_ispunct (int c) +{ + switch (c) + { + _C_CTYPE_PUNCT: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isspace (int c) +{ + switch (c) + { + case ' ': case '\t': case '\n': case '\v': case '\f': case '\r': + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isupper (int c) +{ + switch (c) + { + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE bool +c_isxdigit (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_A_THRU_F: + return true; + default: + return false; + } +} + +C_CTYPE_INLINE int +c_tolower (int c) +{ + switch (c) + { + _C_CTYPE_UPPER: + return c - 'A' + 'a'; + default: + return c; + } +} + +C_CTYPE_INLINE int +c_toupper (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + return c - 'a' + 'A'; + default: + return c; + } +} + +#ifdef __cplusplus +} +#endif + +_GL_INLINE_HEADER_END + +#endif /* C_CTYPE_H */ diff --git a/lib/gl/cdefs.h b/lib/gl/cdefs.h index 4f92175..7b8ed5b 100644 --- a/lib/gl/cdefs.h +++ b/lib/gl/cdefs.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1992-2019 Free Software Foundation, Inc. +/* Copyright (C) 1992-2022 Free Software Foundation, Inc. + Copyright The GNU Toolchain Authors. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +26,7 @@ /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not - anymore supported. */ + supported anymore. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif @@ -34,7 +35,31 @@ #undef __P #undef __PMT -#ifdef __GNUC__ +/* Compilers that lack __has_attribute may object to + #if defined __has_attribute && __has_attribute (...) + even though they do not need to evaluate the right-hand side of the &&. + Similarly for __has_builtin, etc. */ +#if (defined __has_attribute \ + && (!defined __clang_minor__ \ + || (defined __apple_build_version__ \ + ? 6000000 <= __apple_build_version__ \ + : 3 < __clang_major__ + (5 <= __clang_minor__)))) +# define __glibc_has_attribute(attr) __has_attribute (attr) +#else +# define __glibc_has_attribute(attr) 0 +#endif +#ifdef __has_builtin +# define __glibc_has_builtin(name) __has_builtin (name) +#else +# define __glibc_has_builtin(name) 0 +#endif +#ifdef __has_extension +# define __glibc_has_extension(ext) __has_extension (ext) +#else +# define __glibc_has_extension(ext) 0 +#endif + +#if defined __GNUC__ || defined __clang__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ @@ -47,21 +72,26 @@ # endif /* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions + to help it optimize the function calls. But this only works with + gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ -# if !defined __cplusplus && __GNUC_PREREQ (3, 3) +# if !defined __cplusplus \ + && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__)) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# define __THROWNL throw () -# define __NTH(fct) __LEAF_ATTR fct throw () -# define __NTHNL(fct) fct throw () +# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) +# if __cplusplus >= 201103L +# define __THROW noexcept (true) +# else +# define __THROW throw () +# endif +# define __THROWNL __THROW +# define __NTH(fct) __LEAF_ATTR fct __THROW +# define __NTHNL(fct) fct __THROW # else # define __THROW # define __THROWNL @@ -70,7 +100,7 @@ # endif # endif -#else /* Not GCC. */ +#else /* Not GCC or clang. */ # if (defined __cplusplus \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) @@ -83,16 +113,7 @@ # define __THROWNL # define __NTH(fct) fct -#endif /* GCC. */ - -/* Compilers that are not clang may object to - #if defined __clang__ && __has_extension(...) - even though they do not need to evaluate the right-hand side of the &&. */ -#if defined __clang__ && defined __has_extension -# define __glibc_clang_has_extension(ext) __has_extension (ext) -#else -# define __glibc_clang_has_extension(ext) 0 -#endif +#endif /* GCC || clang. */ /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ @@ -123,14 +144,68 @@ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) +/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ +#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \ + || __GNUC_PREREQ (12, 0)) +# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) +# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) +#else +# define __glibc_objsize0(__o) __bos0 (__o) +# define __glibc_objsize(__o) __bos (__o) +#endif + +/* Compile time conditions to choose between the regular, _chk and _chk_warn + variants. These conditions should get evaluated to constant and optimized + away. */ + +#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s)) +#define __glibc_unsigned_or_positive(__l) \ + ((__typeof (__l)) 0 < (__typeof (__l)) -1 \ + || (__builtin_constant_p (__l) && (__l) > 0)) + +/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ + condition can be folded to a constant and if it is true, or unknown (-1) */ +#define __glibc_safe_or_unknown_len(__l, __s, __osz) \ + ((__osz) == (__SIZE_TYPE__) -1 \ + || (__glibc_unsigned_or_positive (__l) \ + && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ + (__s), (__osz))) \ + && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz)))) + +/* Conversely, we know at compile time that the length is unsafe if the + __L * __S <= __OBJSZ condition can be folded to a constant and if it is + false. */ +#define __glibc_unsafe_len(__l, __s, __osz) \ + (__glibc_unsigned_or_positive (__l) \ + && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ + __s, __osz)) \ + && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz)) + +/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be + declared. */ + +#define __glibc_fortify(f, __l, __s, __osz, ...) \ + (__glibc_safe_or_unknown_len (__l, __s, __osz) \ + ? __ ## f ## _alias (__VA_ARGS__) \ + : (__glibc_unsafe_len (__l, __s, __osz) \ + ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \ + : __ ## f ## _chk (__VA_ARGS__, __osz))) \ + +/* Fortify function f, where object size argument passed to f is the number of + elements and not total size. */ + +#define __glibc_fortify_n(f, __l, __s, __osz, ...) \ + (__glibc_safe_or_unknown_len (__l, __s, __osz) \ + ? __ ## f ## _alias (__VA_ARGS__) \ + : (__glibc_unsafe_len (__l, __s, __osz) \ + ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \ + : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \ + #if __GNUC_PREREQ (4,3) -# define __warndecl(name, msg) \ - extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else -# define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif @@ -142,8 +217,8 @@ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc # define __flexarr [] # define __glibc_c99_flexarr_available 1 -#elif __GNUC_PREREQ (2,97) -/* GCC 2.97 supports C99 flexible array members as an extension, +#elif __GNUC_PREREQ (2,97) || defined __clang__ +/* GCC 2.97 and clang support C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 @@ -169,7 +244,7 @@ Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ -#if defined __GNUC__ && __GNUC__ >= 2 +#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4) # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus @@ -194,17 +269,17 @@ */ #endif -/* GCC has various useful declarations that can be made with the - `__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !defined __GNUC__ || __GNUC__ < 2 +/* GCC and clang have various useful declarations that can be made with + the '__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !(defined __GNUC__ || defined __clang__) # define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) +#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # define __attribute_malloc__ /* Ignore */ @@ -219,26 +294,41 @@ # define __attribute_alloc_size__(params) /* Ignore. */ #endif +/* Tell the compiler which argument to an allocation function + indicates the alignment of the allocation. */ +#if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__alloc_align__) +# define __attribute_alloc_align__(param) \ + __attribute__ ((__alloc_align__ param)) +#else +# define __attribute_alloc_align__(param) /* Ignore. */ +#endif + /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) +#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__) # define __attribute_pure__ __attribute__ ((__pure__)) #else # define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) +#if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ #endif +#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__) +# define __attribute_maybe_unused__ __attribute__ ((__unused__)) +#else +# define __attribute_maybe_unused__ /* Ignore */ +#endif + /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) +#if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else @@ -247,7 +337,7 @@ #endif /* Since version 3.2, gcc allows marking deprecated functions. */ -#if __GNUC_PREREQ (3,2) +#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ @@ -256,8 +346,8 @@ /* Since version 4.5, gcc also allows one to specify the message printed when a deprecated function is used. clang claims to be gcc 4.2, but may also support this feature. */ -#if __GNUC_PREREQ (4,5) || \ - __glibc_clang_has_extension (__attribute_deprecated_with_message__) +#if __GNUC_PREREQ (4,5) \ + || __glibc_has_extension (__attribute_deprecated_with_message__) # define __attribute_deprecated_msg__(msg) \ __attribute__ ((__deprecated__ (msg))) #else @@ -270,7 +360,7 @@ If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) +#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # define __attribute_format_arg__(x) /* Ignore */ @@ -280,7 +370,7 @@ attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,97) +#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else @@ -288,19 +378,33 @@ #endif /* The nonnull function attribute marks pointer parameters that - must not be NULL. Do not define __nonnull if it is already defined, - for portability when this file is used in Gnulib. */ + must not be NULL. This has the name __nonnull in glibc, + and __attribute_nonnull__ in files shared with Gnulib to avoid + collision with a different __nonnull in DragonFlyBSD 5.9. */ +#ifndef __attribute_nonnull__ +# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) +# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params)) +# else +# define __attribute_nonnull__(params) +# endif +#endif #ifndef __nonnull -# if __GNUC_PREREQ (3,3) -# define __nonnull(params) __attribute__ ((__nonnull__ params)) +# define __nonnull(params) __attribute_nonnull__ (params) +#endif + +/* The returns_nonnull function attribute marks the return type of the function + as always being non-null. */ +#ifndef __returns_nonnull +# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__) +# define __returns_nonnull __attribute__ ((__returns_nonnull__)) # else -# define __nonnull(params) +# define __returns_nonnull # endif #endif /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ -#if __GNUC_PREREQ (3,4) +#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 @@ -314,7 +418,7 @@ #endif /* Forces a function to be always inlined. */ -#if __GNUC_PREREQ (3,2) +#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ @@ -327,7 +431,7 @@ /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ -#if __GNUC_PREREQ (4,3) +#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # define __attribute_artificial__ /* Ignore */ @@ -370,12 +474,14 @@ run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ -#if !__GNUC_PREREQ (2,8) +#if !(__GNUC_PREREQ (2,8) || defined __clang__) # define __extension__ /* Ignore */ #endif -/* __restrict is known in EGCS 1.2 and above. */ -#if !__GNUC_PREREQ (2,92) +/* __restrict is known in EGCS 1.2 and above, and in clang. + It works also in C++ mode (outside of arrays), but only when spelled + as '__restrict', not 'restrict'. */ +#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3) # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict restrict # else @@ -385,8 +491,9 @@ /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] - GCC 3.1 supports this. */ -#if __GNUC_PREREQ (3,1) && !defined __GNUG__ + GCC 3.1 and clang support this. + This syntax is not usable in C++ mode. */ +#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus # define __restrict_arr __restrict #else # ifdef __GNUC__ @@ -401,7 +508,7 @@ # endif #endif -#if __GNUC__ >= 3 +#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect) # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else @@ -409,15 +516,10 @@ # define __glibc_likely(cond) (cond) #endif -#ifdef __has_attribute -# define __glibc_has_attribute(attr) __has_attribute (attr) -#else -# define __glibc_has_attribute(attr) 0 -#endif - #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && !__GNUC_PREREQ (4,7)) + && !(__GNUC_PREREQ (4,7) \ + || (3 < __clang_major__ + (5 <= __clang_minor__)))) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else @@ -434,22 +536,63 @@ # define __attribute_nonstring__ #endif +/* Undefine (also defined in libc-symbols.h). */ +#undef __attribute_copy__ +#if __GNUC_PREREQ (9, 0) +/* Copies attributes from the declaration or type referenced by + the argument. */ +# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) +#else +# define __attribute_copy__(arg) +#endif + #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) + && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \ + || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif -/* The #ifndef lets Gnulib avoid including these on non-glibc - platforms, where the includes typically do not exist. */ -#ifndef __WORDSIZE +/* Gnulib avoids including these, as they don't work on non-glibc or + older glibc platforms. */ +#ifndef __GNULIB_CDEFS # include <bits/wordsize.h> # include <bits/long-double.h> #endif -#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT + +/* Alias name defined automatically. */ +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined automatically, with leading underscores. */ +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name \ + __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined manually. */ +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); + +# define __LDBL_REDIR1_NTH(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) + +/* Unused. */ +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth + +# else +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); +# endif +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) @@ -458,6 +601,8 @@ # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ @@ -468,11 +613,13 @@ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if !defined __LDBL_COMPAT || !defined __REDIRECT +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ + || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR2_DECL(name) # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) @@ -503,7 +650,7 @@ check is required to enable the use of generic selection. */ #if !defined __cplusplus \ && (__GNUC_PREREQ (4, 9) \ - || __glibc_clang_has_extension (c_generic_selections) \ + || __glibc_has_extension (c_generic_selections) \ || (!defined __GNUC__ && defined __STDC_VERSION__ \ && __STDC_VERSION__ >= 201112L)) # define __HAVE_GENERIC_SELECTION 1 @@ -511,4 +658,50 @@ # define __HAVE_GENERIC_SELECTION 0 #endif +#if __GNUC_PREREQ (10, 0) +/* Designates a 1-based positional argument ref-index of pointer type + that can be used to access size-index elements of the pointed-to + array according to access mode, or at least one element when + size-index is not provided: + access (access-mode, <ref-index> [, <size-index>]) */ +# define __attr_access(x) __attribute__ ((__access__ x)) +/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may + use the access attribute to get object sizes from function definition + arguments, so we can't use them on functions we fortify. Drop the object + size hints for such functions. */ +# if __USE_FORTIFY_LEVEL == 3 +# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o))) +# else +# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s)) +# endif +# if __GNUC_PREREQ (11, 0) +# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno))) +# else +# define __attr_access_none(argno) +# endif +#else +# define __fortified_attr_access(a, o, s) +# define __attr_access(x) +# define __attr_access_none(argno) +#endif + +#if __GNUC_PREREQ (11, 0) +/* Designates dealloc as a function to call to deallocate objects + allocated by the declared function. */ +# define __attr_dealloc(dealloc, argno) \ + __attribute__ ((__malloc__ (dealloc, argno))) +# define __attr_dealloc_free __attr_dealloc (__builtin_free, 1) +#else +# define __attr_dealloc(dealloc, argno) +# define __attr_dealloc_free +#endif + +/* Specify that a function such as setjmp or vfork may return + twice. */ +#if __GNUC_PREREQ (4, 1) +# define __attribute_returns_twice__ __attribute__ ((__returns_twice__)) +#else +# define __attribute_returns_twice__ /* Ignore. */ +#endif + #endif /* sys/cdefs.h */ diff --git a/lib/gl/hash-pjw-bare.c b/lib/gl/hash-pjw-bare.c deleted file mode 100644 index 01552ab..0000000 --- a/lib/gl/hash-pjw-bare.c +++ /dev/null @@ -1,42 +0,0 @@ -/* hash-pjw-bare.c -- compute a hash value from a provided buffer. - - Copyright (C) 2012-2019 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.1 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 <https://www.gnu.org/licenses/>. */ - -#include <config.h> - -#include "hash-pjw-bare.h" - -#include <limits.h> - -#define SIZE_BITS (sizeof (size_t) * CHAR_BIT) - -/* Return a hash of the N bytes of X using the method described by - Bruno Haible in https://www.haible.de/bruno/hashfunc.html. - Note that while many hash functions reduce their result via modulo - to a 0..table_size-1 range, this function does not do that. */ - -size_t -hash_pjw_bare (const void *x, size_t n) -{ - const unsigned char *s = x; - size_t h = 0; - unsigned i; - - for (i = 0; i < n; i++) - h = s[i] + ((h << 9) | (h >> (SIZE_BITS - 9))); - - return h; -} diff --git a/lib/gl/hash-pjw-bare.h b/lib/gl/hash-pjw-bare.h deleted file mode 100644 index eba0653..0000000 --- a/lib/gl/hash-pjw-bare.h +++ /dev/null @@ -1,24 +0,0 @@ -/* hash-pjw-bare.h -- declaration for a simple hash function - Copyright (C) 2012-2019 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.1 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 <https://www.gnu.org/licenses/>. */ - -#include <stddef.h> - -/* Compute a hash code for a buffer starting at X and of size N, - and return the hash code. Note that unlike hash_pjw(), it does not - return it modulo a table size. - The result is platform dependent: it depends on the size of the 'size_t' - type. */ -extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; diff --git a/lib/gl/intprops-internal.h b/lib/gl/intprops-internal.h new file mode 100644 index 0000000..f6455f7 --- /dev/null +++ b/lib/gl/intprops-internal.h @@ -0,0 +1,392 @@ +/* intprops-internal.h -- properties of integer types not visible to users + + Copyright (C) 2001-2022 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.1 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 <https://www.gnu.org/licenses/>. */ + +#ifndef _GL_INTPROPS_INTERNAL_H +#define _GL_INTPROPS_INTERNAL_H + +#include <limits.h> + +/* Return a value with the common real type of E and V and the value of V. + Do not evaluate E. */ +#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) + +/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see + <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */ +#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v)) + +/* The extra casts in the following macros work around compiler bugs, + e.g., in Cray C 5.0.3.0. */ + +/* True if the real type T is signed. */ +#define _GL_TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* Return 1 if the real expression E, after promotion, has a + signed or floating type. Do not evaluate E. */ +#define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) + + +/* Minimum and maximum values for integer types and expressions. */ + +/* The width in bits of the integer type or expression T. + Do not evaluate T. T must not be a bit-field expression. + Padding bits are not supported; this is checked at compile-time below. */ +#define _GL_TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) + +/* The maximum and minimum values for the type of the expression E, + after integer promotion. E is not evaluated. */ +#define _GL_INT_MINIMUM(e) \ + (_GL_EXPR_SIGNED (e) \ + ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_CONVERT (e, 0)) +#define _GL_INT_MAXIMUM(e) \ + (_GL_EXPR_SIGNED (e) \ + ? _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_NEGATE_CONVERT (e, 1)) +#define _GL_SIGNED_INT_MAXIMUM(e) \ + (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1) + +/* Work around OpenVMS incompatibility with C99. */ +#if !defined LLONG_MAX && defined __INT64_MAX +# define LLONG_MAX __INT64_MAX +# define LLONG_MIN __INT64_MIN +#endif + +/* This include file assumes that signed types are two's complement without + padding bits; the above macros have undefined behavior otherwise. + If this is a problem for you, please let us know how to fix it for your host. + This assumption is tested by the intprops-tests module. */ + +/* Does the __typeof__ keyword work? This could be done by + 'configure', but for now it's easier to do it by hand. */ +#if (2 <= __GNUC__ \ + || (4 <= __clang_major__) \ + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +# define _GL_HAVE___TYPEOF__ 1 +#else +# define _GL_HAVE___TYPEOF__ 0 +#endif + +/* Return 1 if the integer type or expression T might be signed. Return 0 + if it is definitely unsigned. T must not be a bit-field expression. + This macro does not evaluate its argument, and expands to an + integer constant expression. */ +#if _GL_HAVE___TYPEOF__ +# define _GL_SIGNED_TYPE_OR_EXPR(t) _GL_TYPE_SIGNED (__typeof__ (t)) +#else +# define _GL_SIGNED_TYPE_OR_EXPR(t) 1 +#endif + +/* Return 1 if - A would overflow in [MIN,MAX] arithmetic. + A should not have side effects, and A's type should be an + integer with minimum value MIN and maximum MAX. */ +#define _GL_INT_NEGATE_RANGE_OVERFLOW(a, min, max) \ + ((min) < 0 ? (a) < - (max) : 0 < (a)) + +/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow + (A, B, P) work when P is non-null. */ +#ifdef __EDG__ +/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned + <https://bugs.gnu.org/53256>. */ +# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) +/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, + see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */ +#elif 7 <= __GNUC__ +# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 +#else +# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 +#endif + +/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */ +#if defined __clang_major__ && __clang_major__ < 14 +/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */ +# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0 +#else +# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW +#endif + +/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for + __builtin_sub_overflow_p and __builtin_mul_overflow_p. */ +#ifdef __EDG__ +/* In EDG-based compilers like ICC 2021.3 and earlier, + __builtin_add_overflow_p etc. are not treated as integral constant + expressions even when all arguments are. */ +# define _GL_HAS_BUILTIN_OVERFLOW_P 0 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p) +#else +# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) +#endif + +#if (!defined _GL_STDCKDINT_H && 202311 <= __STDC_VERSION__ \ + && ! (_GL_HAS_BUILTIN_ADD_OVERFLOW && _GL_HAS_BUILTIN_MUL_OVERFLOW)) +# include <stdckdint.h> +#endif + +/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. + Return 1 if the result overflows. Arguments should not have side + effects and A, B and *R can be of any integer type other than char, + bool, a bit-precise integer type, or an enumeration type. */ +#if _GL_HAS_BUILTIN_ADD_OVERFLOW +# define _GL_INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r) +# define _GL_INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r) +#elif defined ckd_add && defined ckd_sub && !defined _GL_STDCKDINT_H +# define _GL_INT_ADD_WRAPV(a, b, r) ckd_add (r, + (a), + (b)) +# define _GL_INT_SUBTRACT_WRAPV(a, b, r) ckd_sub (r, + (a), + (b)) +#else +# define _GL_INT_ADD_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW) +# define _GL_INT_SUBTRACT_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW) +#endif +#if _GL_HAS_BUILTIN_MUL_OVERFLOW +# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ + || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \ + && !defined __EDG__) +# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r) +# else + /* Work around GCC bug 91450. */ +# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \ + ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) && _GL_EXPR_SIGNED (b) \ + && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \ + ? ((void) __builtin_mul_overflow (a, b, r), 1) \ + : __builtin_mul_overflow (a, b, r)) +# endif +#elif defined ckd_mul && !defined _GL_STDCKDINT_H +# define _GL_INT_MULTIPLY_WRAPV(a, b, r) ckd_mul (r, + (a), + (b)) +#else +# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW) +#endif + +/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 + https://llvm.org/bugs/show_bug.cgi?id=25390 + For now, assume all versions of GCC-like compilers generate bogus + warnings for _Generic. This matters only for compilers that + lack relevant builtins. */ +#if __GNUC__ || defined __clang__ +# define _GL__GENERIC_BOGUS 1 +#else +# define _GL__GENERIC_BOGUS 0 +#endif + +/* Store the low-order bits of A <op> B into *R, where OP specifies + the operation and OVERFLOW the overflow predicate. Return 1 if the + result overflows. Arguments should not have side effects, + and A, B and *R can be of any integer type other than char, bool, a + bit-precise integer type, or an enumeration type. */ +#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS +# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \ + (_Generic \ + (*(r), \ + signed char: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + signed char, SCHAR_MIN, SCHAR_MAX), \ + unsigned char: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + unsigned char, 0, UCHAR_MAX), \ + short int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + short int, SHRT_MIN, SHRT_MAX), \ + unsigned short int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + unsigned short int, 0, USHRT_MAX), \ + int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + int, INT_MIN, INT_MAX), \ + unsigned int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + unsigned int, 0, UINT_MAX), \ + long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX), \ + unsigned long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + unsigned long int, 0, ULONG_MAX), \ + long long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + long long int, LLONG_MIN, LLONG_MAX), \ + unsigned long long int: \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + unsigned long long int, 0, ULLONG_MAX))) +#else +/* Store the low-order bits of A <op> B into *R, where OP specifies + the operation and OVERFLOW the overflow predicate. If *R is + signed, its type is ST with bounds SMIN..SMAX; otherwise its type + is UT with bounds U..UMAX. ST and UT are narrower than int. + Return 1 if the result overflows. Arguments should not have side + effects, and A, B and *R can be of any integer type other than + char, bool, a bit-precise integer type, or an enumeration type. */ +# if _GL_HAVE___TYPEOF__ +# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \ + (_GL_TYPE_SIGNED (__typeof__ (*(r))) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax)) +# else +# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \ + (overflow (a, b, smin, smax) \ + ? (overflow (a, b, 0, umax) \ + ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \ + : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \ + : (overflow (a, b, 0, umax) \ + ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \ + : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0))) +# endif + +# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \ + (sizeof *(r) == sizeof (signed char) \ + ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \ + signed char, SCHAR_MIN, SCHAR_MAX, \ + unsigned char, UCHAR_MAX) \ + : sizeof *(r) == sizeof (short int) \ + ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \ + short int, SHRT_MIN, SHRT_MAX, \ + unsigned short int, USHRT_MAX) \ + : sizeof *(r) == sizeof (int) \ + ? (_GL_EXPR_SIGNED (*(r)) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + int, INT_MIN, INT_MAX) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ + unsigned int, 0, UINT_MAX)) \ + : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)) +# ifdef LLONG_MAX +# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + (sizeof *(r) == sizeof (long int) \ + ? (_GL_EXPR_SIGNED (*(r)) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + unsigned long int, 0, ULONG_MAX)) \ + : (_GL_EXPR_SIGNED (*(r)) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + long long int, LLONG_MIN, LLONG_MAX) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ + unsigned long long int, 0, ULLONG_MAX))) +# else +# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + (_GL_EXPR_SIGNED (*(r)) \ + ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + long int, LONG_MIN, LONG_MAX) \ + : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ + unsigned long int, 0, ULONG_MAX)) +# endif +#endif + +/* Store the low-order bits of A <op> B into *R, where the operation + is given by OP. Use the unsigned type UT for calculation to avoid + overflow problems. *R's type is T, with extrema TMIN and TMAX. + T can be any signed integer type other than char, bool, a + bit-precise integer type, or an enumeration type. + Return 1 if the result overflows. */ +#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \ + (overflow (a, b, tmin, tmax) \ + ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \ + : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0)) + +/* Return 1 if the integer expressions A - B and -A would overflow, + respectively. Arguments should not have side effects, + and can be any signed integer type other than char, bool, a + bit-precise integer type, or an enumeration type. + These macros are tuned for their last input argument being a constant. */ + +#if _GL_HAS_BUILTIN_OVERFLOW_P +# define _GL_INT_NEGATE_OVERFLOW(a) \ + __builtin_sub_overflow_p (0, a, (__typeof__ (- (a))) 0) +#else +# define _GL_INT_NEGATE_OVERFLOW(a) \ + _GL_INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) +#endif + +/* Return the low-order bits of A <op> B, where the operation is given + by OP. Use the unsigned type UT for calculation to avoid undefined + behavior on signed integer overflow, and convert the result to type T. + UT is at least as wide as T and is no narrower than unsigned int, + T is two's complement, and there is no padding or trap representations. + Assume that converting UT to T yields the low-order bits, as is + done in all known two's-complement C compilers. E.g., see: + https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html + + According to the C standard, converting UT to T yields an + implementation-defined result or signal for values outside T's + range. However, code that works around this theoretical problem + runs afoul of a compiler bug in Oracle Studio 12.3 x86. See: + https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html + As the compiler bug is real, don't try to work around the + theoretical problem. */ + +#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \ + ((t) ((ut) (a) op (ut) (b))) + +/* Return true if the numeric values A + B, A - B, A * B fall outside + the range TMIN..TMAX. Arguments should not have side effects + and can be any integer type other than char, bool, + a bit-precise integer type, or an enumeration type. + TMIN should be signed and nonpositive. + TMAX should be positive, and should be signed unless TMIN is zero. */ +#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \ + ((b) < 0 \ + ? (((tmin) \ + ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \ + && (a) < (tmin) - (b)) \ + : (a) <= -1 - (b)) \ + || ((_GL_EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \ + : (a) < 0 \ + ? (((tmin) \ + ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \ + && (b) < (tmin) - (a)) \ + : (b) <= -1 - (a)) \ + || ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \ + && (tmax) < (a) + (b))) \ + : (tmax) < (b) || (tmax) - (b) < (a)) +#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \ + (((a) < 0) == ((b) < 0) \ + ? ((a) < (b) \ + ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \ + : (tmax) < (a) - (b)) \ + : (a) < 0 \ + ? ((!_GL_EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \ + || (a) - (tmin) < (b)) \ + : ((! (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \ + && _GL_EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \ + && (tmax) <= -1 - (b)) \ + || (tmax) + (b) < (a))) +#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \ + ((b) < 0 \ + ? ((a) < 0 \ + ? (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \ + ? (a) < (tmax) / (b) \ + : ((_GL_INT_NEGATE_OVERFLOW (b) \ + ? _GL_INT_CONVERT (b, tmax) >> (_GL_TYPE_WIDTH (+ (b)) - 1) \ + : (tmax) / -(b)) \ + <= -1 - (a))) \ + : _GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \ + ? (_GL_EXPR_SIGNED (a) \ + ? 0 < (a) + (tmin) \ + : 0 < (a) && -1 - (tmin) < (a) - 1) \ + : (tmin) / (b) < (a)) \ + : (b) == 0 \ + ? 0 \ + : ((a) < 0 \ + ? (_GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \ + ? (_GL_EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \ + : (tmin) / (a) < (b)) \ + : (tmax) / (b) < (a))) + +#endif /* _GL_INTPROPS_INTERNAL_H */ diff --git a/lib/gl/intprops.h b/lib/gl/intprops.h index 140f6d2..f182ddc 100644 --- a/lib/gl/intprops.h +++ b/lib/gl/intprops.h @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2019 Free Software Foundation, Inc. + Copyright (C) 2001-2022 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 @@ -15,20 +15,10 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -/* Written by Paul Eggert. */ - #ifndef _GL_INTPROPS_H #define _GL_INTPROPS_H -#include <limits.h> - -/* Return a value with the common real type of E and V and the value of V. - Do not evaluate E. */ -#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) - -/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see - <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */ -#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v)) +#include "intprops-internal.h" /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -38,19 +28,19 @@ #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) /* True if the real type T is signed. */ -#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +#define TYPE_SIGNED(t) _GL_TYPE_SIGNED (t) /* Return 1 if the real expression E, after promotion, has a signed or floating type. Do not evaluate E. */ -#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) +#define EXPR_SIGNED(e) _GL_EXPR_SIGNED (e) /* Minimum and maximum values for integer types and expressions. */ /* The width in bits of the integer type or expression T. - Do not evaluate T. + Do not evaluate T. T must not be a bit-field expression. Padding bits are not supported; this is checked at compile-time below. */ -#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) +#define TYPE_WIDTH(t) _GL_TYPE_WIDTH (t) /* The maximum and minimum values for the integer type T. */ #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) @@ -59,78 +49,37 @@ ? (t) -1 \ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) -/* The maximum and minimum values for the type of the expression E, - after integer promotion. E is not evaluated. */ -#define _GL_INT_MINIMUM(e) \ - (EXPR_SIGNED (e) \ - ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ - : _GL_INT_CONVERT (e, 0)) -#define _GL_INT_MAXIMUM(e) \ - (EXPR_SIGNED (e) \ - ? _GL_SIGNED_INT_MAXIMUM (e) \ - : _GL_INT_NEGATE_CONVERT (e, 1)) -#define _GL_SIGNED_INT_MAXIMUM(e) \ - (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) - -/* Work around OpenVMS incompatibility with C99. */ -#if !defined LLONG_MAX && defined __INT64_MAX -# define LLONG_MAX __INT64_MAX -# define LLONG_MIN __INT64_MIN -#endif - -/* This include file assumes that signed types are two's complement without - padding bits; the above macros have undefined behavior otherwise. - If this is a problem for you, please let us know how to fix it for your host. - This assumption is tested by the intprops-tests module. */ - -/* Does the __typeof__ keyword work? This could be done by - 'configure', but for now it's easier to do it by hand. */ -#if (2 <= __GNUC__ \ - || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ - || (0x5110 <= __SUNPRO_C && !__STDC__)) -# define _GL_HAVE___TYPEOF__ 1 -#else -# define _GL_HAVE___TYPEOF__ 0 -#endif - -/* Return 1 if the integer type or expression T might be signed. Return 0 - if it is definitely unsigned. This macro does not evaluate its argument, - and expands to an integer constant expression. */ -#if _GL_HAVE___TYPEOF__ -# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t)) -#else -# define _GL_SIGNED_TYPE_OR_EXPR(t) 1 -#endif - /* Bound on length of the string representing an unsigned integer value representable in B bits. log10 (2.0) < 146/485. The smallest value of B where this bound is not tight is 2621. */ #define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) /* Bound on length of the string representing an integer type or expression T. + T must not be a bit-field expression. + Subtract 1 for the sign bit if T is signed, and then add 1 more for a minus sign if needed. - Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is - signed, this macro may overestimate the true bound by one byte when + Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is + unsigned, this macro may overestimate the true bound by one byte when applied to unsigned types of size 2, 4, 16, ... bytes. */ #define INT_STRLEN_BOUND(t) \ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + _GL_SIGNED_TYPE_OR_EXPR (t)) /* Bound on buffer size needed to represent an integer type or expression T, - including the terminating null. */ + including the terminating null. T must not be a bit-field expression. */ #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) /* Range overflow checks. The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C - operators might not yield numerically correct answers due to - arithmetic overflow. They do not rely on undefined or - implementation-defined behavior. Their implementations are simple - and straightforward, but they are a bit harder to use than the - INT_<op>_OVERFLOW macros described below. + operators overflow arithmetically when given the same arguments. + These macros do not rely on undefined or implementation-defined behavior. + Although their implementations are simple and straightforward, + they are harder to use and may be less efficient than the + INT_<op>_WRAPV, INT_<op>_OK, and INT_<op>_OVERFLOW macros described below. Example usage: @@ -154,6 +103,9 @@ must have minimum value MIN and maximum MAX. Unsigned types should use a zero MIN of the proper type. + Because all arguments are subject to integer promotions, these + macros typically do not work on types narrower than 'int'. + These macros are tuned for constant MIN and MAX. For commutative operations such as A + B, they are also tuned for constant B. */ @@ -174,9 +126,7 @@ /* Return 1 if - A would overflow in [MIN,MAX] arithmetic. See above for restrictions. */ #define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \ - ((min) < 0 \ - ? (a) < - (max) \ - : 0 < (a)) + _GL_INT_NEGATE_RANGE_OVERFLOW (a, min, max) /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. See above for restrictions. Avoid && and || as they tickle @@ -220,16 +170,6 @@ ? (a) < (min) >> (b) \ : (max) >> (b) < (a)) -/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ -#if 5 <= __GNUC__ && !defined __ICC -# define _GL_HAS_BUILTIN_OVERFLOW 1 -#else -# define _GL_HAS_BUILTIN_OVERFLOW 0 -#endif - -/* True if __builtin_add_overflow_p (A, B, C) works. */ -#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) - /* The _GL*_OVERFLOW macros have the same restrictions as the *_RANGE_OVERFLOW macros, except that they do not assume that operands (e.g., A and B) have the same type as MIN and MAX. Instead, they assume @@ -281,7 +221,9 @@ The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators might not yield numerically correct answers due to arithmetic overflow. - The INT_<op>_WRAPV macros also store the low-order bits of the answer. + The INT_<op>_WRAPV macros compute the low-order bits of the sum, + difference, and product of two C integers, and return 1 if these + low-order bits are not numerically correct. These macros work correctly on all known practical hosts, and do not rely on undefined behavior due to signed arithmetic overflow. @@ -309,9 +251,22 @@ arguments should not have side effects. The WRAPV macros are not constant expressions. They support only - +, binary -, and *. The result type must be signed. + +, binary -, and *. + + Because the WRAPV macros convert the result, they report overflow + in different circumstances than the OVERFLOW macros do. For + example, in the typical case with 16-bit 'short' and 32-bit 'int', + if A, B and *R are all of type 'short' then INT_ADD_OVERFLOW (A, B) + returns false because the addition cannot overflow after A and B + are converted to 'int', whereas INT_ADD_WRAPV (A, B, R) returns + true or false depending on whether the sum fits into 'short'. - These macros are tuned for their last argument being a constant. + These macros are tuned for their last input argument being a constant. + + A, B, and *R should be integers; they need not be the same type, + and they need not be all signed or all unsigned. + However, none of the integer types should be bit-precise, + and *R's type should not be char, bool, or an enumeration type. Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B, A % B, and A << B would overflow, respectively. */ @@ -320,12 +275,7 @@ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) #define INT_SUBTRACT_OVERFLOW(a, b) \ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) -#if _GL_HAS_BUILTIN_OVERFLOW_P -# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) -#else -# define INT_NEGATE_OVERFLOW(a) \ - INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) -#endif +#define INT_NEGATE_OVERFLOW(a) _GL_INT_NEGATE_OVERFLOW (a) #define INT_MULTIPLY_OVERFLOW(a, b) \ _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW) #define INT_DIVIDE_OVERFLOW(a, b) \ @@ -347,109 +297,39 @@ /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. Return 1 if the result overflows. See above for restrictions. */ -#define INT_ADD_WRAPV(a, b, r) \ - _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW) -#define INT_SUBTRACT_WRAPV(a, b, r) \ - _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW) -#define INT_MULTIPLY_WRAPV(a, b, r) \ - _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) - -/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 - https://llvm.org/bugs/show_bug.cgi?id=25390 - For now, assume all versions of GCC-like compilers generate bogus - warnings for _Generic. This matters only for older compilers that - lack __builtin_add_overflow. */ -#if __GNUC__ -# define _GL__GENERIC_BOGUS 1 -#else -# define _GL__GENERIC_BOGUS 0 -#endif +#define INT_ADD_WRAPV(a, b, r) _GL_INT_ADD_WRAPV (a, b, r) +#define INT_SUBTRACT_WRAPV(a, b, r) _GL_INT_SUBTRACT_WRAPV (a, b, r) +#define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r) -/* Store the low-order bits of A <op> B into *R, where OP specifies - the operation. BUILTIN is the builtin operation, and OVERFLOW the - overflow predicate. Return 1 if the result overflows. See above - for restrictions. */ -#if _GL_HAS_BUILTIN_OVERFLOW -# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) -#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS -# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ - (_Generic \ - (*(r), \ - signed char: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - signed char, SCHAR_MIN, SCHAR_MAX), \ - short int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - short int, SHRT_MIN, SHRT_MAX), \ - int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - int, INT_MIN, INT_MAX), \ - long int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ - long int, LONG_MIN, LONG_MAX), \ - long long int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ - long long int, LLONG_MIN, LLONG_MAX))) -#else -# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ - (sizeof *(r) == sizeof (signed char) \ - ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - signed char, SCHAR_MIN, SCHAR_MAX) \ - : sizeof *(r) == sizeof (short int) \ - ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - short int, SHRT_MIN, SHRT_MAX) \ - : sizeof *(r) == sizeof (int) \ - ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - int, INT_MIN, INT_MAX) \ - : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow)) -# ifdef LLONG_MAX -# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ - (sizeof *(r) == sizeof (long int) \ - ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ - long int, LONG_MIN, LONG_MAX) \ - : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ - long long int, LLONG_MIN, LLONG_MAX)) -# else -# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ - long int, LONG_MIN, LONG_MAX) -# endif -#endif +/* The following macros compute A + B, A - B, and A * B, respectively. + If no overflow occurs, they set *R to the result and return 1; + otherwise, they return 0 and may modify *R. + + Example usage: + + long int result; + if (INT_ADD_OK (a, b, &result)) + printf ("result is %ld\n", result); + else + printf ("overflow\n"); + + A, B, and *R should be integers; they need not be the same type, + and they need not be all signed or all unsigned. + However, none of the integer types should be bit-precise, + and *R's type should not be char, bool, or an enumeration type. + + These macros work correctly on all known practical hosts, and do not rely + on undefined behavior due to signed arithmetic overflow. + + These macros are not constant expressions. + + These macros may evaluate their arguments zero or multiple times, so the + arguments should not have side effects. + + These macros are tuned for B being a constant. */ -/* Store the low-order bits of A <op> B into *R, where the operation - is given by OP. Use the unsigned type UT for calculation to avoid - overflow problems. *R's type is T, with extrema TMIN and TMAX. - T must be a signed integer type. Return 1 if the result overflows. */ -#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \ - (sizeof ((a) op (b)) < sizeof (t) \ - ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \ - : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax)) -#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \ - ((overflow (a, b) \ - || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \ - || (tmax) < ((a) op (b))) \ - ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \ - : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0)) - -/* Return the low-order bits of A <op> B, where the operation is given - by OP. Use the unsigned type UT for calculation to avoid undefined - behavior on signed integer overflow, and convert the result to type T. - UT is at least as wide as T and is no narrower than unsigned int, - T is two's complement, and there is no padding or trap representations. - Assume that converting UT to T yields the low-order bits, as is - done in all known two's-complement C compilers. E.g., see: - https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html - - According to the C standard, converting UT to T yields an - implementation-defined result or signal for values outside T's - range. However, code that works around this theoretical problem - runs afoul of a compiler bug in Oracle Studio 12.3 x86. See: - https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html - As the compiler bug is real, don't try to work around the - theoretical problem. */ - -#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \ - ((t) ((ut) (a) op (ut) (b))) +#define INT_ADD_OK(a, b, r) (! INT_ADD_WRAPV (a, b, r)) +#define INT_SUBTRACT_OK(a, b, r) (! INT_SUBTRACT_WRAPV (a, b, r)) +#define INT_MULTIPLY_OK(a, b, r) (! INT_MULTIPLY_WRAPV (a, b, r)) #endif /* _GL_INTPROPS_H */ diff --git a/lib/gl/libc-config.h b/lib/gl/libc-config.h index f24fbfa..a56665b 100644 --- a/lib/gl/libc-config.h +++ b/lib/gl/libc-config.h @@ -1,6 +1,6 @@ /* System definitions for code taken from the GNU C Library - Copyright 2017-2019 Free Software Foundation, Inc. + Copyright 2017-2022 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 @@ -28,14 +28,17 @@ When compiled as part of glibc this is a no-op; when compiled as part of Gnulib this includes Gnulib's <config.h> and defines macros - that glibc library code would normally assume. */ + that glibc library code would normally assume. + + Note: This header file MUST NOT be included by public header files + of Gnulib. */ #include <config.h> /* On glibc this includes <features.h> and <sys/cdefs.h> and #defines - _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it - includes <sys/cdefs.h> which defines __nonnull. Elsewhere it - is harmless. */ + _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and + DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull. + Elsewhere it is harmless. */ #include <errno.h> /* From glibc <errno.h>. */ @@ -55,114 +58,138 @@ #ifndef __glibc_clang_prereq # if defined __clang_major__ && defined __clang_minor__ -# define __glibc_clang_prereq(maj, min) \ - ((maj) < __clang_major__ + ((min) <= __clang_minor__)) +# ifdef __apple_build_version__ +/* Apple for some reason renumbers __clang_major__ and __clang_minor__. + Gnulib code uses only __glibc_clang_prereq (3, 5); map it to + 6000000 <= __apple_build_version__. Support for other calls to + __glibc_clang_prereq can be added here as needed. */ +# define __glibc_clang_prereq(maj, min) \ + ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0) +# else +# define __glibc_clang_prereq(maj, min) \ + ((maj) < __clang_major__ + ((min) <= __clang_minor__)) +# endif # else # define __glibc_clang_prereq(maj, min) 0 # endif #endif - -/* Prepare to include <cdefs.h>, which is our copy of glibc - <sys/cdefs.h>. */ +#ifndef __attribute_nonnull__ +/* <sys/cdefs.h> either does not exist, or is too old for Gnulib. + Prepare to include <cdefs.h>, which is Gnulib's version of a + more-recent glibc <sys/cdefs.h>. */ /* Define _FEATURES_H so that <cdefs.h> does not include <features.h>. */ -#ifndef _FEATURES_H -# define _FEATURES_H 1 -#endif -/* Define __WORDSIZE so that <cdefs.h> does not attempt to include - nonexistent files. Make it a syntax error, since Gnulib does not - use __WORDSIZE now, and if Gnulib uses it later the syntax error - will let us know that __WORDSIZE needs configuring. */ -#ifndef __WORDSIZE -# define __WORDSIZE %%% -#endif +# ifndef _FEATURES_H +# define _FEATURES_H 1 +# endif +/* Define __GNULIB_CDEFS so that <cdefs.h> does not attempt to include + nonexistent files. */ +# define __GNULIB_CDEFS /* Undef the macros unconditionally defined by our copy of glibc <sys/cdefs.h>, so that they do not clash with any system-defined versions. */ -#undef _SYS_CDEFS_H -#undef __ASMNAME -#undef __ASMNAME2 -#undef __BEGIN_DECLS -#undef __CONCAT -#undef __END_DECLS -#undef __HAVE_GENERIC_SELECTION -#undef __LDBL_COMPAT -#undef __LDBL_REDIR -#undef __LDBL_REDIR1 -#undef __LDBL_REDIR1_DECL -#undef __LDBL_REDIR1_NTH -#undef __LDBL_REDIR_DECL -#undef __LDBL_REDIR_NTH -#undef __LEAF -#undef __LEAF_ATTR -#undef __NTH -#undef __NTHNL -#undef __P -#undef __PMT -#undef __REDIRECT -#undef __REDIRECT_LDBL -#undef __REDIRECT_NTH -#undef __REDIRECT_NTHNL -#undef __REDIRECT_NTH_LDBL -#undef __STRING -#undef __THROW -#undef __THROWNL -#undef __always_inline -#undef __attribute__ -#undef __attribute_alloc_size__ -#undef __attribute_artificial__ -#undef __attribute_const__ -#undef __attribute_deprecated__ -#undef __attribute_deprecated_msg__ -#undef __attribute_format_arg__ -#undef __attribute_format_strfmon__ -#undef __attribute_malloc__ -#undef __attribute_noinline__ -#undef __attribute_nonstring__ -#undef __attribute_pure__ -#undef __attribute_used__ -#undef __attribute_warn_unused_result__ -#undef __bos -#undef __bos0 -#undef __errordecl -#undef __extension__ -#undef __extern_always_inline -#undef __extern_inline -#undef __flexarr -#undef __fortify_function -#undef __glibc_c99_flexarr_available -#undef __glibc_clang_has_extension -#undef __glibc_likely -#undef __glibc_macro_warning -#undef __glibc_macro_warning1 -#undef __glibc_unlikely -#undef __inline -#undef __ptr_t -#undef __restrict -#undef __restrict_arr -#undef __va_arg_pack -#undef __va_arg_pack_len -#undef __warnattr -#undef __warndecl +# undef _SYS_CDEFS_H +# undef __ASMNAME +# undef __ASMNAME2 +# undef __BEGIN_DECLS +# undef __CONCAT +# undef __END_DECLS +# undef __HAVE_GENERIC_SELECTION +# undef __LDBL_COMPAT +# undef __LDBL_REDIR +# undef __LDBL_REDIR1 +# undef __LDBL_REDIR1_DECL +# undef __LDBL_REDIR1_NTH +# undef __LDBL_REDIR2_DECL +# undef __LDBL_REDIR_DECL +# undef __LDBL_REDIR_NTH +# undef __LEAF +# undef __LEAF_ATTR +# undef __NTH +# undef __NTHNL +# undef __REDIRECT +# undef __REDIRECT_LDBL +# undef __REDIRECT_NTH +# undef __REDIRECT_NTHNL +# undef __REDIRECT_NTH_LDBL +# undef __STRING +# undef __THROW +# undef __THROWNL +# undef __attr_access +# undef __attr_access_none +# undef __attr_dealloc +# undef __attr_dealloc_free +# undef __attribute__ +# undef __attribute_alloc_align__ +# undef __attribute_alloc_size__ +# undef __attribute_artificial__ +# undef __attribute_const__ +# undef __attribute_deprecated__ +# undef __attribute_deprecated_msg__ +# undef __attribute_format_arg__ +# undef __attribute_format_strfmon__ +# undef __attribute_malloc__ +# undef __attribute_maybe_unused__ +# undef __attribute_noinline__ +# undef __attribute_nonstring__ +# undef __attribute_pure__ +# undef __attribute_returns_twice__ +# undef __attribute_used__ +# undef __attribute_warn_unused_result__ +# undef __bos +# undef __bos0 +# undef __errordecl +# undef __extension__ +# undef __extern_always_inline +# undef __extern_inline +# undef __flexarr +# undef __fortified_attr_access +# undef __fortify_function +# undef __glibc_c99_flexarr_available +# undef __glibc_fortify +# undef __glibc_fortify_n +# undef __glibc_has_attribute +# undef __glibc_has_builtin +# undef __glibc_has_extension +# undef __glibc_likely +# undef __glibc_macro_warning +# undef __glibc_macro_warning1 +# undef __glibc_objsize +# undef __glibc_objsize0 +# undef __glibc_safe_len_cond +# undef __glibc_safe_or_unknown_len +# undef __glibc_unlikely +# undef __glibc_unsafe_len +# undef __glibc_unsigned_or_positive +# undef __inline +# undef __ptr_t +# undef __restrict +# undef __restrict_arr +# undef __va_arg_pack +# undef __va_arg_pack_len +# undef __warnattr +# undef __wur /* Include our copy of glibc <sys/cdefs.h>. */ -#include <cdefs.h> +# include <cdefs.h> /* <cdefs.h> __inline is too pessimistic for non-GCC. */ -#undef __inline -#ifndef HAVE___INLINE -# if 199901 <= __STDC_VERSION__ || defined inline -# define __inline inline -# else -# define __inline +# undef __inline +# ifndef HAVE___INLINE +# if 199901 <= __STDC_VERSION__ || defined inline +# define __inline inline +# else +# define __inline +# endif # endif -#endif + +#endif /* defined __glibc_likely */ /* A substitute for glibc <libc-symbols.h>, good enough for Gnulib. */ #define attribute_hidden -#define libc_hidden_proto(name, ...) +#define libc_hidden_proto(name) #define libc_hidden_def(name) #define libc_hidden_weak(name) #define libc_hidden_ver(local, name) @@ -171,4 +198,5 @@ /* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */ #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 -#define versioned_symbol(lib, local, symbol, version) +#define compat_symbol(lib, local, symbol, version) extern int dummy +#define versioned_symbol(lib, local, symbol, version) extern int dummy diff --git a/lib/gl/limits.in.h b/lib/gl/limits.in.h index e7cdd54..b77bf75 100644 --- a/lib/gl/limits.in.h +++ b/lib/gl/limits.in.h @@ -1,30 +1,46 @@ /* A GNU-like <limits.h>. - Copyright 2016-2019 Free Software Foundation, Inc. + Copyright 2016-2022 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.1, or - (at your option) any later version. + This file 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. - This program is distributed in the hope that it will be useful, + This file 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 <https://www.gnu.org/licenses/>. */ - -#ifndef _@GUARD_PREFIX@_LIMITS_H + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif @PRAGMA_COLUMNS@ -/* The include_next requires a split double-inclusion guard. */ +#if defined _GL_ALREADY_INCLUDING_LIMITS_H +/* Special invocation convention: + On Haiku/x86_64, we have a sequence of nested includes + <limits.h> -> <syslimits.h> -> <limits.h>. + In this situation, LONG_MAX and INT_MAX are not yet defined, + therefore we should not attempt to define LONG_BIT. */ + #@INCLUDE_NEXT@ @NEXT_LIMITS_H@ +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_LIMITS_H + +# define _GL_ALREADY_INCLUDING_LIMITS_H + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_LIMITS_H@ + +# undef _GL_ALREADY_INCLUDING_LIMITS_H + #ifndef _@GUARD_PREFIX@_LIMITS_H #define _@GUARD_PREFIX@_LIMITS_H @@ -83,10 +99,11 @@ # endif #endif -/* Macros specified by ISO/IEC TS 18661-1:2014. */ +/* Macros specified by C2x and by ISO/IEC TS 18661-1:2014. */ #if (! defined ULLONG_WIDTH \ - && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__ \ + || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__))) # define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX) # define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX) # define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX) @@ -98,7 +115,17 @@ # define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX) # define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX) # define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX) -#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ +#endif + +/* Macros specified by C2x. */ + +#if (! defined BOOL_WIDTH \ + && (defined _GNU_SOURCE \ + || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__))) +# define BOOL_MAX 1 +# define BOOL_WIDTH 1 +#endif #endif /* _@GUARD_PREFIX@_LIMITS_H */ #endif /* _@GUARD_PREFIX@_LIMITS_H */ +#endif diff --git a/lib/gl/minmax.h b/lib/gl/minmax.h index f0ccfa2..b4b1345 100644 --- a/lib/gl/minmax.h +++ b/lib/gl/minmax.h @@ -1,19 +1,19 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2019 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2022 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.1, or (at your option) - any later version. + This file 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. - This program is distributed in the hope that it will be useful, + This file 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 <https://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #ifndef _MINMAX_H #define _MINMAX_H diff --git a/lib/gl/stdbool.in.h b/lib/gl/stdbool.in.h new file mode 100644 index 0000000..2fa4672 --- /dev/null +++ b/lib/gl/stdbool.in.h @@ -0,0 +1,115 @@ +/* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc. + Written by Bruno Haible <haible@clisp.cons.org>, 2001. + + This file 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. + + This file 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 <https://www.gnu.org/licenses/>. */ + +#ifndef _GL_STDBOOL_H +#define _GL_STDBOOL_H + +/* ISO C 99 <stdbool.h> for platforms that lack it. */ + +/* Usage suggestions: + + Programs that use <stdbool.h> should be aware of some limitations + and standards compliance issues. + + Standards compliance: + + - <stdbool.h> must be #included before 'bool', 'false', 'true' + can be used. + + - You cannot assume that sizeof (bool) == 1. + + - Programs should not undefine the macros bool, true, and false, + as C99 lists that as an "obsolescent feature". + + Limitations of this substitute, when used in a C89 environment: + + - <stdbool.h> must be #included before the '_Bool' type can be used. + + - You cannot assume that _Bool is a typedef; it might be a macro. + + - Bit-fields of type 'bool' are not supported. Portable code + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. + + - In C99, casts and automatic conversions to '_Bool' or 'bool' are + performed in such a way that every nonzero value gets converted + to 'true', and zero gets converted to 'false'. This doesn't work + with this substitute. With this substitute, only the values 0 and 1 + give the expected result when converted to _Bool' or 'bool'. + + - C99 allows the use of (_Bool)0.0 in constant expressions, but + this substitute cannot always provide this property. + + Also, it is suggested that programs use 'bool' rather than '_Bool'; + this isn't required, but 'bool' is more common. */ + + +/* 7.16. Boolean type and values */ + +#ifdef __cplusplus +# define _Bool bool +# define bool bool +#else +# if !defined __GNUC__ + /* If @HAVE__BOOL@: + Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when + the built-in _Bool type is used. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html + https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html + Similar bugs are likely with other compilers as well; this file + wouldn't be used if <stdbool.h> was working. + So we override the _Bool type. + If !@HAVE__BOOL@: + Need to define _Bool ourselves. As 'signed char' or as an enum type? + Use of a typedef, with SunPRO C, leads to a stupid + "warning: _Bool is a keyword in ISO C99". + Use of an enum type, with IRIX cc, leads to a stupid + "warning(1185): enumerated type mixed with another type". + Even the existence of an enum type, without a typedef, + "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. + The only benefit of the enum, debuggability, is not important + with these compilers. So use 'signed char' and no enum. */ +# define _Bool signed char +# else + /* With this compiler, trust the _Bool type if the compiler has it. */ +# if !@HAVE__BOOL@ + /* For the sake of symbolic names in gdb, define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But then + values of type '_Bool' might promote to 'int' or 'unsigned int' + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' + (see ISO C 99 6.3.1.1.(2)). So add a negative value to the + enum; this ensures that '_Bool' promotes to 'int'. */ +typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif +# endif +# define bool _Bool +#endif + +/* The other macros must be usable in preprocessor directives. */ +#ifdef __cplusplus +# define false false +# define true true +#else +# define false 0 +# define true 1 +#endif + +#define __bool_true_false_are_defined 1 + +#endif /* _GL_STDBOOL_H */ diff --git a/lib/gl/stddef.in.h b/lib/gl/stddef.in.h index 29d8933..5c9a747 100644 --- a/lib/gl/stddef.in.h +++ b/lib/gl/stddef.in.h @@ -1,25 +1,25 @@ /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. - Copyright (C) 2009-2019 Free Software Foundation, Inc. + Copyright (C) 2009-2022 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.1, or (at your option) - any later version. + This file 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. - This program is distributed in the hope that it will be useful, + This file 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 <https://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* Written by Eric Blake. */ /* * POSIX 2008 <stddef.h> for platforms that have issues. - * <http://www.opengroup.org/susv3xbd/stddef.h.html> + * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html> */ #if __GNUC__ >= 3 @@ -42,6 +42,13 @@ # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ + /* On TinyCC, make sure that the macros that indicate the special invocation + convention get undefined. */ +# undef __need_wchar_t +# undef __need_size_t +# undef __need_ptrdiff_t +# undef __need_NULL +# undef __need_wint_t # endif #else @@ -49,6 +56,23 @@ # ifndef _@GUARD_PREFIX@_STDDEF_H +/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a + type with alignment 4, but 'long' has alignment 8. */ +# if defined _AIX && defined __LP64__ +# if !GNULIB_defined_max_align_t +# ifdef _MAX_ALIGN_T +/* /usr/include/stddef.h has already defined max_align_t. Override it. */ +typedef long rpl_max_align_t; +# define max_align_t rpl_max_align_t +# else +/* Prevent /usr/include/stddef.h from defining max_align_t. */ +typedef long max_align_t; +# define _MAX_ALIGN_T +# endif +# define GNULIB_defined_max_align_t 1 +# endif +# endif + /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -83,20 +107,28 @@ /* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is a hack in case the configure-time test was done with g++ even though - we are currently compiling with gcc. */ -#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) -# if !GNULIB_defined_max_align_t + we are currently compiling with gcc. + On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was + included. Its definition is good since it has an alignment of 8 (on x86 + and x86_64). + Similarly on OS/2 kLIBC. */ +#if (defined _MSC_VER || (defined __KLIBC__ && !defined __LIBCN__)) \ + && defined __cplusplus +# include <cstddef> +#else +# if ! (@HAVE_MAX_ALIGN_T@ || (defined _GCC_MAX_ALIGN_T && !defined __clang__)) +# if !GNULIB_defined_max_align_t /* On the x86, the maximum storage alignment of double, long, etc. is 4, but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, and the C11 standard allows this. Work around this problem by using __alignof__ (which returns 8 for double) rather than _Alignof (which returns 4), and align each union member accordingly. */ -# ifdef __GNUC__ -# define _GL_STDDEF_ALIGNAS(type) \ - __attribute__ ((__aligned__ (__alignof__ (type)))) -# else -# define _GL_STDDEF_ALIGNAS(type) /* */ -# endif +# if defined __GNUC__ || (__clang_major__ >= 4) +# define _GL_STDDEF_ALIGNAS(type) \ + __attribute__ ((__aligned__ (__alignof__ (type)))) +# else +# define _GL_STDDEF_ALIGNAS(type) /* */ +# endif typedef union { char *__p _GL_STDDEF_ALIGNAS (char *); @@ -104,8 +136,9 @@ typedef union long double __ld _GL_STDDEF_ALIGNAS (long double); long int __i _GL_STDDEF_ALIGNAS (long int); } rpl_max_align_t; -# define max_align_t rpl_max_align_t -# define GNULIB_defined_max_align_t 1 +# define max_align_t rpl_max_align_t +# define GNULIB_defined_max_align_t 1 +# endif # endif #endif diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h index 5875286..eaa7874 100644 --- a/lib/gl/stdint.in.h +++ b/lib/gl/stdint.in.h @@ -1,23 +1,23 @@ -/* Copyright (C) 2001-2002, 2004-2019 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2022 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. 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 Lesser General Public License as published by - the Free Software Foundation; either version 2.1, or (at your option) - any later version. + This file 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. - This program is distributed in the hope that it will be useful, + This file 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 <https://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* * ISO C 99 <stdint.h> for platforms that lack it. - * <http://www.opengroup.org/susv3xbd/stdint.h.html> + * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html> */ #ifndef _@GUARD_PREFIX@_STDINT_H @@ -85,7 +85,7 @@ /* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides wint_t. */ -#if @GNULIB_OVERRIDES_WINT_T@ +#if @GNULIBHEADERS_OVERRIDE_WINT_T@ # undef WINT_MIN # undef WINT_MAX # define WINT_MIN 0x0U @@ -188,7 +188,7 @@ typedef long int gl_int64_t; typedef __int64 gl_int64_t; # define int64_t gl_int64_t # define GL_INT64_T -# elif @HAVE_LONG_LONG_INT@ +# else # undef int64_t typedef long long int gl_int64_t; # define int64_t gl_int64_t @@ -209,7 +209,7 @@ typedef unsigned long int gl_uint64_t; typedef unsigned __int64 gl_uint64_t; # define uint64_t gl_uint64_t # define GL_UINT64_T -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# else # undef uint64_t typedef unsigned long long int gl_uint64_t; # define uint64_t gl_uint64_t @@ -299,16 +299,25 @@ typedef gl_uint_fast32_t gl_uint_fast16_t; /* 7.18.1.4. Integer types capable of holding object pointers */ -/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own +/* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own definitions of intptr_t and uintptr_t (which use int and unsigned) - to avoid clashes with declarations of system functions like sbrk. */ -# ifndef _INTPTR_T_DECLARED -# undef intptr_t -# undef uintptr_t + to avoid clashes with declarations of system functions like sbrk. + Similarly, MinGW WSL-5.4.1 <stdint.h> needs its own intptr_t and + uintptr_t to avoid conflicting declarations of system functions like + _findclose in <io.h>. */ +# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \ + || defined __MINGW32__) +# undef intptr_t +# undef uintptr_t +# ifdef _WIN64 +typedef long long int gl_intptr_t; +typedef unsigned long long int gl_uintptr_t; +# else typedef long int gl_intptr_t; typedef unsigned long int gl_uintptr_t; -# define intptr_t gl_intptr_t -# define uintptr_t gl_uintptr_t +# endif +# define intptr_t gl_intptr_t +# define uintptr_t gl_uintptr_t # endif /* 7.18.1.5. Greatest-width integer types */ @@ -323,7 +332,7 @@ typedef unsigned long int gl_uintptr_t; # ifndef INTMAX_MAX # undef INTMAX_C # undef intmax_t -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# if LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; # define intmax_t gl_intmax_t # elif defined GL_INT64_T @@ -337,7 +346,7 @@ typedef long int gl_intmax_t; # ifndef UINTMAX_MAX # undef UINTMAX_C # undef uintmax_t -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# if ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; # define uintmax_t gl_uintmax_t # elif defined GL_UINT64_T @@ -485,9 +494,15 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) # undef INTPTR_MIN # undef INTPTR_MAX # undef UINTPTR_MAX -# define INTPTR_MIN LONG_MIN -# define INTPTR_MAX LONG_MAX -# define UINTPTR_MAX ULONG_MAX +# ifdef _WIN64 +# define INTPTR_MIN LLONG_MIN +# define INTPTR_MAX LLONG_MAX +# define UINTPTR_MAX ULLONG_MAX +# else +# define INTPTR_MIN LONG_MIN +# define INTPTR_MAX LONG_MAX +# define UINTPTR_MAX ULONG_MAX +# endif /* 7.18.2.5. Limits of greatest-width integer types */ @@ -564,11 +579,6 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes <stdint.h> and assumes its types are already defined. */ # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) - /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -# include <stddef.h> -# include <stdio.h> -# include <time.h> # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include <wchar.h> # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H @@ -586,17 +596,21 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) /* wint_t limits */ -# undef WINT_MIN -# undef WINT_MAX -# if @HAVE_SIGNED_WINT_T@ -# define WINT_MIN \ - _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -# else -# define WINT_MIN \ - _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +/* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not + accurate, therefore use the definitions from above. */ +# if !@GNULIBHEADERS_OVERRIDE_WINT_T@ +# undef WINT_MIN +# undef WINT_MAX +# if @HAVE_SIGNED_WINT_T@ +# define WINT_MIN \ + _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +# else +# define WINT_MIN \ + _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +# endif +# define WINT_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) # endif -# define WINT_MAX \ - _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) /* 7.18.4. Macros for integer constants */ @@ -627,21 +641,21 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) # define INT64_C(x) x##L # elif defined _MSC_VER # define INT64_C(x) x##i64 -# elif @HAVE_LONG_LONG_INT@ +# else # define INT64_C(x) x##LL # endif # if ULONG_MAX >> 31 >> 31 >> 1 == 1 # define UINT64_C(x) x##UL # elif defined _MSC_VER # define UINT64_C(x) x##ui64 -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# else # define UINT64_C(x) x##ULL # endif /* 7.18.4.2. Macros for greatest-width integer constants */ # ifndef INTMAX_C -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# if LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL # elif defined GL_INT64_T # define INTMAX_C(x) INT64_C(x) @@ -651,7 +665,7 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) # endif # ifndef UINTMAX_C -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# if ULONG_MAX >> 31 == 1 # define UINTMAX_C(x) x##ULL # elif defined GL_UINT64_T # define UINTMAX_C(x) UINT64_C(x) diff --git a/lib/gl/stdlib.in.h b/lib/gl/stdlib.in.h new file mode 100644 index 0000000..a86643c --- /dev/null +++ b/lib/gl/stdlib.in.h @@ -0,0 +1,1559 @@ +/* A GNU-like <stdlib.h>. + + Copyright (C) 1995, 2001-2004, 2006-2022 Free Software Foundation, Inc. + + This file 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. + + This file 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 <https://www.gnu.org/licenses/>. */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc +/* Special invocation conventions inside some gnulib header files, + and inside some glibc header files, respectively. */ + +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_STDLIB_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#ifndef _@GUARD_PREFIX@_STDLIB_H +#define _@GUARD_PREFIX@_STDLIB_H + +/* NetBSD 5.0 mis-defines NULL. */ +#include <stddef.h> + +/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */ +#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS +# include <sys/wait.h> +#endif + +/* Solaris declares getloadavg() in <sys/loadavg.h>. */ +#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ +/* OpenIndiana has a bug: <sys/time.h> must be included before + <sys/loadavg.h>. */ +# include <sys/time.h> +# include <sys/loadavg.h> +#endif + +/* Native Windows platforms declare _mktemp() in <io.h>. */ +#if defined _WIN32 && !defined __CYGWIN__ +# include <io.h> +#endif + +#if @GNULIB_RANDOM_R@ + +/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included + from <stdlib.h> if _REENTRANT is defined. Include it whenever we need + 'struct random_data'. */ +# if @HAVE_RANDOM_H@ +# include <random.h> +# endif + +# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ +# include <stdint.h> +# endif + +# if !@HAVE_STRUCT_RANDOM_DATA@ +/* Define 'struct random_data'. + But allow multiple gnulib generated <stdlib.h> replacements to coexist. */ +# if !GNULIB_defined_struct_random_data +struct random_data +{ + int32_t *fptr; /* Front pointer. */ + int32_t *rptr; /* Rear pointer. */ + int32_t *state; /* Array of state values. */ + int rand_type; /* Type of random number generator. */ + int rand_deg; /* Degree of random number generator. */ + int rand_sep; /* Distance between front and rear. */ + int32_t *end_ptr; /* Pointer behind state table. */ +}; +# define GNULIB_defined_struct_random_data 1 +# endif +# endif +#endif + +#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__) +/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */ +/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */ +/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */ +/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ +/* But avoid namespace pollution on glibc systems and native Windows. */ +# include <unistd.h> +#endif + +/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers + that can be freed by passing them as the Ith argument to the + function F. */ +#ifndef _GL_ATTRIBUTE_DEALLOC +# if __GNUC__ >= 11 +# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) +# else +# define _GL_ATTRIBUTE_DEALLOC(f, i) +# endif +#endif + +/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that + can be freed via 'free'; it can be used only after declaring 'free'. */ +/* Applies to: functions. Cannot be used on inline functions. */ +#ifndef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +#endif + +/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly + allocated memory. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_MALLOC +# if __GNUC__ >= 3 || defined __clang__ +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define _GL_ATTRIBUTE_MALLOC +# endif +#endif + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif +#endif + +/* The definition of _Noreturn is copied here. */ + +/* 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. */ + + +/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere + with proper operation of xargs. */ +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#elif EXIT_FAILURE != 1 +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + + +#if @GNULIB__EXIT@ +/* Terminate the current process with the given return code, without running + the 'atexit' handlers. */ +# if !@HAVE__EXIT@ +_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); +# endif +_GL_CXXALIAS_SYS (_Exit, void, (int status)); +_GL_CXXALIASWARN (_Exit); +#elif defined GNULIB_POSIXCHECK +# undef _Exit +# if HAVE_RAW_DECL__EXIT +_GL_WARN_ON_USE (_Exit, "_Exit is unportable - " + "use gnulib module _Exit for portability"); +# endif +#endif + + +#if @GNULIB_FREE_POSIX@ +# if @REPLACE_FREE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef free +# define free rpl_free +# endif +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ()); +# else +_GL_FUNCDECL_RPL (free, void, (void *ptr)); +# endif +_GL_CXXALIAS_RPL (free, void, (void *ptr)); +# else +_GL_CXXALIAS_SYS (free, void, (void *ptr)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (free); +# endif +#elif defined GNULIB_POSIXCHECK +# undef free +/* Assume free is always declared. */ +_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - " + "use gnulib module free for portability"); +#endif + + +/* Allocate memory with indefinite extent and specified alignment. */ +#if @GNULIB_ALIGNED_ALLOC@ +# if @REPLACE_ALIGNED_ALLOC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef aligned_alloc +# define aligned_alloc rpl_aligned_alloc +# endif +_GL_FUNCDECL_RPL (aligned_alloc, void *, + (size_t alignment, size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); +# else +# if @HAVE_ALIGNED_ALLOC@ +# if __GNUC__ >= 11 +/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (aligned_alloc, void *, + (size_t alignment, size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); +# endif +# endif +# if @HAVE_ALIGNED_ALLOC@ +_GL_CXXALIASWARN (aligned_alloc); +# endif +#else +# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc +/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (aligned_alloc, void *, + (size_t alignment, size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK +# undef aligned_alloc +# if HAVE_RAW_DECL_ALIGNED_ALLOC +_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " + "use gnulib module aligned_alloc for portability"); +# endif +# endif +#endif + +#if @GNULIB_ATOLL@ +/* Parse a signed decimal integer. + Returns the value of the integer. Errors are not detected. */ +# if !@HAVE_ATOLL@ +_GL_FUNCDECL_SYS (atoll, long long, (const char *string) + _GL_ATTRIBUTE_PURE + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (atoll, long long, (const char *string)); +_GL_CXXALIASWARN (atoll); +#elif defined GNULIB_POSIXCHECK +# undef atoll +# if HAVE_RAW_DECL_ATOLL +_GL_WARN_ON_USE (atoll, "atoll is unportable - " + "use gnulib module atoll for portability"); +# endif +#endif + +#if @GNULIB_CALLOC_POSIX@ +# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \ + || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef calloc +# define calloc rpl_calloc +# endif +_GL_FUNCDECL_RPL (calloc, void *, + (size_t nmemb, size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size)); +# else +# if __GNUC__ >= 11 +/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (calloc, void *, + (size_t nmemb, size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (calloc); +# endif +#else +# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc +/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (calloc, void *, + (size_t nmemb, size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK +# undef calloc +/* Assume calloc is always declared. */ +_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - " + "use gnulib module calloc-posix for portability"); +# endif +#endif + +#if @GNULIB_CANONICALIZE_FILE_NAME@ +# if @REPLACE_CANONICALIZE_FILE_NAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define canonicalize_file_name rpl_canonicalize_file_name +# endif +_GL_FUNCDECL_RPL (canonicalize_file_name, char *, + (const char *name) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name)); +# else +# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11 +_GL_FUNCDECL_SYS (canonicalize_file_name, char *, + (const char *name) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name)); +# endif +# ifndef GNULIB_defined_canonicalize_file_name +# define GNULIB_defined_canonicalize_file_name \ + (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@) +# endif +_GL_CXXALIASWARN (canonicalize_file_name); +#else +# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name +/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or + rpl_free. */ +_GL_FUNCDECL_SYS (canonicalize_file_name, char *, + (const char *name) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK +# undef canonicalize_file_name +# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME +_GL_WARN_ON_USE (canonicalize_file_name, + "canonicalize_file_name is unportable - " + "use gnulib module canonicalize-lgpl for portability"); +# endif +# endif +#endif + +#if @GNULIB_MDA_ECVT@ +/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ecvt +# define ecvt _ecvt +# endif +_GL_CXXALIAS_MDA (ecvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# else +# if @HAVE_DECL_ECVT@ +_GL_CXXALIAS_SYS (ecvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@ +_GL_CXXALIASWARN (ecvt); +# endif +#endif + +#if @GNULIB_MDA_FCVT@ +/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcvt +# define fcvt _fcvt +# endif +_GL_CXXALIAS_MDA (fcvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# else +# if @HAVE_DECL_FCVT@ +_GL_CXXALIAS_SYS (fcvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@ +_GL_CXXALIASWARN (fcvt); +# endif +#endif + +#if @GNULIB_MDA_GCVT@ +/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gcvt +# define gcvt _gcvt +# endif +_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf)); +# else +# if @HAVE_DECL_GCVT@ +_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@ +_GL_CXXALIASWARN (gcvt); +# endif +#endif + +#if @GNULIB_GETLOADAVG@ +/* Store max(NELEM,3) load average numbers in LOADAVG[]. + The three numbers are the load average of the last 1 minute, the last 5 + minutes, and the last 15 minutes, respectively. + LOADAVG is an array of NELEM numbers. */ +# if !@HAVE_DECL_GETLOADAVG@ +_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem)); +_GL_CXXALIASWARN (getloadavg); +#elif defined GNULIB_POSIXCHECK +# undef getloadavg +# if HAVE_RAW_DECL_GETLOADAVG +_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " + "use gnulib module getloadavg for portability"); +# endif +#endif + +#if @GNULIB_GETSUBOPT@ +/* Assuming *OPTIONP is a comma separated list of elements of the form + "token" or "token=value", getsubopt parses the first of these elements. + If the first element refers to a "token" that is member of the given + NULL-terminated array of tokens: + - It replaces the comma with a NUL byte, updates *OPTIONP to point past + the first option and the comma, sets *VALUEP to the value of the + element (or NULL if it doesn't contain an "=" sign), + - It returns the index of the "token" in the given array of tokens. + Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. + For more details see the POSIX specification. + https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */ +# if !@HAVE_GETSUBOPT@ +_GL_FUNCDECL_SYS (getsubopt, int, + (char **optionp, char *const *tokens, char **valuep) + _GL_ARG_NONNULL ((1, 2, 3))); +# endif +_GL_CXXALIAS_SYS (getsubopt, int, + (char **optionp, char *const *tokens, char **valuep)); +_GL_CXXALIASWARN (getsubopt); +#elif defined GNULIB_POSIXCHECK +# undef getsubopt +# if HAVE_RAW_DECL_GETSUBOPT +_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " + "use gnulib module getsubopt for portability"); +# endif +#endif + +#if @GNULIB_GRANTPT@ +/* Change the ownership and access permission of the slave side of the + pseudo-terminal whose master side is specified by FD. */ +# if !@HAVE_GRANTPT@ +_GL_FUNCDECL_SYS (grantpt, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (grantpt, int, (int fd)); +_GL_CXXALIASWARN (grantpt); +#elif defined GNULIB_POSIXCHECK +# undef grantpt +# if HAVE_RAW_DECL_GRANTPT +_GL_WARN_ON_USE (grantpt, "grantpt is not portable - " + "use gnulib module grantpt for portability"); +# endif +#endif + +/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not + rely on GNU or POSIX semantics for malloc and realloc (for example, + by never specifying a zero size), so it does not need malloc or + realloc to be redefined. */ +#if @GNULIB_MALLOC_POSIX@ +# if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \ + || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@) +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) +# undef malloc +# define malloc rpl_malloc +# endif +_GL_FUNCDECL_RPL (malloc, void *, + (size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +_GL_CXXALIAS_RPL (malloc, void *, (size_t size)); +# else +# if __GNUC__ >= 11 +/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (malloc, void *, + (size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +_GL_CXXALIAS_SYS (malloc, void *, (size_t size)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (malloc); +# endif +#else +# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc +/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (malloc, void *, + (size_t size) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC +# undef malloc +/* Assume malloc is always declared. */ +_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - " + "use gnulib module malloc-posix for portability"); +# endif +#endif + +/* Convert a multibyte character to a wide character. */ +#if @GNULIB_MBTOWC@ +# if @REPLACE_MBTOWC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mbtowc +# define mbtowc rpl_mbtowc +# endif +_GL_FUNCDECL_RPL (mbtowc, int, + (wchar_t *restrict pwc, const char *restrict s, size_t n)); +_GL_CXXALIAS_RPL (mbtowc, int, + (wchar_t *restrict pwc, const char *restrict s, size_t n)); +# else +# if !@HAVE_MBTOWC@ +_GL_FUNCDECL_SYS (mbtowc, int, + (wchar_t *restrict pwc, const char *restrict s, size_t n)); +# endif +_GL_CXXALIAS_SYS (mbtowc, int, + (wchar_t *restrict pwc, const char *restrict s, size_t n)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (mbtowc); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mbtowc +# if HAVE_RAW_DECL_MBTOWC +_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - " + "use gnulib module mbtowc for portability"); +# endif +#endif + +#if @GNULIB_MKDTEMP@ +/* Create a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the directory name unique. + Returns TEMPLATE, or a null pointer if it cannot get a unique name. + The directory is created mode 700. */ +# if !@HAVE_MKDTEMP@ +_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/)); +_GL_CXXALIASWARN (mkdtemp); +#elif defined GNULIB_POSIXCHECK +# undef mkdtemp +# if HAVE_RAW_DECL_MKDTEMP +_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - " + "use gnulib module mkdtemp for portability"); +# endif +#endif + +#if @GNULIB_MKOSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + The file is then created, with the specified flags, ensuring it didn't exist + before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if !@HAVE_MKOSTEMP@ +_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)); +_GL_CXXALIASWARN (mkostemp); +#elif defined GNULIB_POSIXCHECK +# undef mkostemp +# if HAVE_RAW_DECL_MKOSTEMP +_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - " + "use gnulib module mkostemp for portability"); +# endif +#endif + +#if @GNULIB_MKOSTEMPS@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE before a suffix of length + SUFFIXLEN must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + The file is then created, with the specified flags, ensuring it didn't exist + before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if !@HAVE_MKOSTEMPS@ +_GL_FUNCDECL_SYS (mkostemps, int, + (char * /*template*/, int /*suffixlen*/, int /*flags*/) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkostemps, int, + (char * /*template*/, int /*suffixlen*/, int /*flags*/)); +_GL_CXXALIASWARN (mkostemps); +#elif defined GNULIB_POSIXCHECK +# undef mkostemps +# if HAVE_RAW_DECL_MKOSTEMPS +_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - " + "use gnulib module mkostemps for portability"); +# endif +#endif + +#if @GNULIB_MKSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if @REPLACE_MKSTEMP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define mkstemp rpl_mkstemp +# endif +_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/)); +# else +# if ! @HAVE_MKSTEMP@ +_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/)); +# endif +_GL_CXXALIASWARN (mkstemp); +#elif defined GNULIB_POSIXCHECK +# undef mkstemp +# if HAVE_RAW_DECL_MKSTEMP +_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - " + "use gnulib module mkstemp for portability"); +# endif +#endif + +#if @GNULIB_MKSTEMPS@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE prior to a suffix of length + SUFFIXLEN must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# if !@HAVE_MKSTEMPS@ +_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)); +_GL_CXXALIASWARN (mkstemps); +#elif defined GNULIB_POSIXCHECK +# undef mkstemps +# if HAVE_RAW_DECL_MKSTEMPS +_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - " + "use gnulib module mkstemps for portability"); +# endif +#endif + +#if @GNULIB_MDA_MKTEMP@ +/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::mktemp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mktemp +# define mktemp _mktemp +# endif +_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/)); +# else +_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/)); +# endif +_GL_CXXALIASWARN (mktemp); +#endif + +/* Allocate memory with indefinite extent and specified alignment. */ +#if @GNULIB_POSIX_MEMALIGN@ +# if @REPLACE_POSIX_MEMALIGN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef posix_memalign +# define posix_memalign rpl_posix_memalign +# endif +_GL_FUNCDECL_RPL (posix_memalign, int, + (void **memptr, size_t alignment, size_t size) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (posix_memalign, int, + (void **memptr, size_t alignment, size_t size)); +# else +# if @HAVE_POSIX_MEMALIGN@ +_GL_CXXALIAS_SYS (posix_memalign, int, + (void **memptr, size_t alignment, size_t size)); +# endif +# endif +# if @HAVE_POSIX_MEMALIGN@ +_GL_CXXALIASWARN (posix_memalign); +# endif +#elif defined GNULIB_POSIXCHECK +# undef posix_memalign +# if HAVE_RAW_DECL_POSIX_MEMALIGN +_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " + "use gnulib module posix_memalign for portability"); +# endif +#endif + +#if @GNULIB_POSIX_OPENPT@ +/* Return an FD open to the master side of a pseudo-terminal. Flags should + include O_RDWR, and may also include O_NOCTTY. */ +# if !@HAVE_POSIX_OPENPT@ +_GL_FUNCDECL_SYS (posix_openpt, int, (int flags)); +# endif +_GL_CXXALIAS_SYS (posix_openpt, int, (int flags)); +_GL_CXXALIASWARN (posix_openpt); +#elif defined GNULIB_POSIXCHECK +# undef posix_openpt +# if HAVE_RAW_DECL_POSIX_OPENPT +_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - " + "use gnulib module posix_openpt for portability"); +# endif +#endif + +#if @GNULIB_PTSNAME@ +/* Return the pathname of the pseudo-terminal slave associated with + the master FD is open on, or NULL on errors. */ +# if @REPLACE_PTSNAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ptsname +# define ptsname rpl_ptsname +# endif +_GL_FUNCDECL_RPL (ptsname, char *, (int fd)); +_GL_CXXALIAS_RPL (ptsname, char *, (int fd)); +# else +# if !@HAVE_PTSNAME@ +_GL_FUNCDECL_SYS (ptsname, char *, (int fd)); +# endif +_GL_CXXALIAS_SYS (ptsname, char *, (int fd)); +# endif +_GL_CXXALIASWARN (ptsname); +#elif defined GNULIB_POSIXCHECK +# undef ptsname +# if HAVE_RAW_DECL_PTSNAME +_GL_WARN_ON_USE (ptsname, "ptsname is not portable - " + "use gnulib module ptsname for portability"); +# endif +#endif + +#if @GNULIB_PTSNAME_R@ +/* Set the pathname of the pseudo-terminal slave associated with + the master FD is open on and return 0, or set errno and return + non-zero on errors. */ +# if @REPLACE_PTSNAME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ptsname_r +# define ptsname_r rpl_ptsname_r +# endif +_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +# else +# if !@HAVE_PTSNAME_R@ +_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +# endif +_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +# endif +# ifndef GNULIB_defined_ptsname_r +# define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@) +# endif +_GL_CXXALIASWARN (ptsname_r); +#elif defined GNULIB_POSIXCHECK +# undef ptsname_r +# if HAVE_RAW_DECL_PTSNAME_R +_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - " + "use gnulib module ptsname_r for portability"); +# endif +#endif + +#if @GNULIB_PUTENV@ +# if @REPLACE_PUTENV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv rpl_putenv +# endif +_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (putenv, int, (char *string)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv _putenv +# endif +_GL_CXXALIAS_MDA (putenv, int, (char *string)); +# else +_GL_CXXALIAS_SYS (putenv, int, (char *string)); +# endif +_GL_CXXALIASWARN (putenv); +#elif @GNULIB_MDA_PUTENV@ +/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::putenv always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv _putenv +# endif +/* Need to cast, because on mingw, the parameter is either + 'const char *string' or 'char *string'. */ +_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string)); +# else +_GL_CXXALIAS_SYS (putenv, int, (char *string)); +# endif +_GL_CXXALIASWARN (putenv); +#endif + +#if @GNULIB_QSORT_R@ +/* Sort an array of NMEMB elements, starting at address BASE, each element + occupying SIZE bytes, in ascending order according to the comparison + function COMPARE. */ +# ifdef __cplusplus +extern "C" { +# endif +# if !GNULIB_defined_qsort_r_fn_types +typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *); +# define GNULIB_defined_qsort_r_fn_types 1 +# endif +# ifdef __cplusplus +} +# endif +# if @REPLACE_QSORT_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef qsort_r +# define qsort_r rpl_qsort_r +# endif +_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, + _gl_qsort_r_compar_fn compare, + void *arg) _GL_ARG_NONNULL ((1, 4))); +_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, + _gl_qsort_r_compar_fn compare, + void *arg)); +# else +# if !@HAVE_QSORT_R@ +_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + _gl_qsort_r_compar_fn compare, + void *arg) _GL_ARG_NONNULL ((1, 4))); +# endif +_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + _gl_qsort_r_compar_fn compare, + void *arg)); +# endif +_GL_CXXALIASWARN (qsort_r); +#elif defined GNULIB_POSIXCHECK +# undef qsort_r +# if HAVE_RAW_DECL_QSORT_R +_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " + "use gnulib module qsort_r for portability"); +# endif +#endif + + +#if @GNULIB_RANDOM_R@ +# if !@HAVE_RANDOM_R@ +# ifndef RAND_MAX +# define RAND_MAX 2147483647 +# endif +# endif +#endif + + +#if @GNULIB_RANDOM@ +# if @REPLACE_RANDOM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef random +# define random rpl_random +# endif +_GL_FUNCDECL_RPL (random, long, (void)); +_GL_CXXALIAS_RPL (random, long, (void)); +# else +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (random, long, (void)); +# endif +/* Need to cast, because on Haiku, the return type is + int. */ +_GL_CXXALIAS_SYS_CAST (random, long, (void)); +# endif +_GL_CXXALIASWARN (random); +#elif defined GNULIB_POSIXCHECK +# undef random +# if HAVE_RAW_DECL_RANDOM +_GL_WARN_ON_USE (random, "random is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if @REPLACE_RANDOM@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef srandom +# define srandom rpl_srandom +# endif +_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); +_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); +# else +# if !@HAVE_RANDOM@ +_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); +# endif +/* Need to cast, because on FreeBSD, the first parameter is + unsigned long seed. */ +_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed)); +# endif +_GL_CXXALIASWARN (srandom); +#elif defined GNULIB_POSIXCHECK +# undef srandom +# if HAVE_RAW_DECL_SRANDOM +_GL_WARN_ON_USE (srandom, "srandom is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if @REPLACE_INITSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef initstate +# define initstate rpl_initstate +# endif +_GL_FUNCDECL_RPL (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size)); +# else +# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@ +_GL_FUNCDECL_SYS (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size) + _GL_ARG_NONNULL ((2))); +# endif +/* Need to cast, because on FreeBSD, the first parameter is + unsigned long seed. */ +_GL_CXXALIAS_SYS_CAST (initstate, char *, + (unsigned int seed, char *buf, size_t buf_size)); +# endif +_GL_CXXALIASWARN (initstate); +#elif defined GNULIB_POSIXCHECK +# undef initstate +# if HAVE_RAW_DECL_INITSTATE +_GL_WARN_ON_USE (initstate, "initstate is unportable - " + "use gnulib module random for portability"); +# endif +#endif + +#if @GNULIB_RANDOM@ +# if @REPLACE_SETSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setstate +# define setstate rpl_setstate +# endif +_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state)); +# else +# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@ +_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter + is const char *arg_state. */ +_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state)); +# endif +_GL_CXXALIASWARN (setstate); +#elif defined GNULIB_POSIXCHECK +# undef setstate +# if HAVE_RAW_DECL_SETSTATE +_GL_WARN_ON_USE (setstate, "setstate is unportable - " + "use gnulib module random for portability"); +# endif +#endif + + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef random_r +# define random_r rpl_random_r +# endif +_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); +# endif +_GL_CXXALIASWARN (random_r); +#elif defined GNULIB_POSIXCHECK +# undef random_r +# if HAVE_RAW_DECL_RANDOM_R +_GL_WARN_ON_USE (random_r, "random_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef srandom_r +# define srandom_r rpl_srandom_r +# endif +_GL_FUNCDECL_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (srandom_r, int, + (unsigned int seed, struct random_data *rand_state) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (srandom_r, int, + (unsigned int seed, struct random_data *rand_state)); +# endif +_GL_CXXALIASWARN (srandom_r); +#elif defined GNULIB_POSIXCHECK +# undef srandom_r +# if HAVE_RAW_DECL_SRANDOM_R +_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef initstate_r +# define initstate_r rpl_initstate_r +# endif +_GL_FUNCDECL_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state) + _GL_ARG_NONNULL ((2, 4))); +# endif +/* Need to cast, because on Haiku, the third parameter is + unsigned long buf_size. */ +_GL_CXXALIAS_SYS_CAST (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state)); +# endif +_GL_CXXALIASWARN (initstate_r); +#elif defined GNULIB_POSIXCHECK +# undef initstate_r +# if HAVE_RAW_DECL_INITSTATE_R +_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + +#if @GNULIB_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setstate_r +# define setstate_r rpl_setstate_r +# endif +_GL_FUNCDECL_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ +_GL_FUNCDECL_SYS (setstate_r, int, + (char *arg_state, struct random_data *rand_state) + _GL_ARG_NONNULL ((1, 2))); +# endif +/* Need to cast, because on Haiku, the first parameter is + void *arg_state. */ +_GL_CXXALIAS_SYS_CAST (setstate_r, int, + (char *arg_state, struct random_data *rand_state)); +# endif +_GL_CXXALIASWARN (setstate_r); +#elif defined GNULIB_POSIXCHECK +# undef setstate_r +# if HAVE_RAW_DECL_SETSTATE_R +_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " + "use gnulib module random_r for portability"); +# endif +#endif + + +#if @GNULIB_REALLOC_POSIX@ +# if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \ + || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@) +# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ + || _GL_USE_STDLIB_ALLOC) +# undef realloc +# define realloc rpl_realloc +# endif +_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size) + _GL_ATTRIBUTE_DEALLOC_FREE); +_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size)); +# else +# if __GNUC__ >= 11 +/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size) + _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (realloc); +# endif +#else +# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc +/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */ +_GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size) + _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC +# undef realloc +/* Assume realloc is always declared. */ +_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - " + "use gnulib module realloc-posix for portability"); +# endif +#endif + + +#if @GNULIB_REALLOCARRAY@ +# if @REPLACE_REALLOCARRAY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef reallocarray +# define reallocarray rpl_reallocarray +# endif +_GL_FUNCDECL_RPL (reallocarray, void *, + (void *ptr, size_t nmemb, size_t size)); +_GL_CXXALIAS_RPL (reallocarray, void *, + (void *ptr, size_t nmemb, size_t size)); +# else +# if ! @HAVE_REALLOCARRAY@ +_GL_FUNCDECL_SYS (reallocarray, void *, + (void *ptr, size_t nmemb, size_t size)); +# endif +_GL_CXXALIAS_SYS (reallocarray, void *, + (void *ptr, size_t nmemb, size_t size)); +# endif +_GL_CXXALIASWARN (reallocarray); +#elif defined GNULIB_POSIXCHECK +# undef reallocarray +# if HAVE_RAW_DECL_REALLOCARRAY +_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " + "use gnulib module reallocarray for portability"); +# endif +#endif + +#if @GNULIB_REALPATH@ +# if @REPLACE_REALPATH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define realpath rpl_realpath +# endif +_GL_FUNCDECL_RPL (realpath, char *, + (const char *restrict name, char *restrict resolved) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (realpath, char *, + (const char *restrict name, char *restrict resolved)); +# else +# if !@HAVE_REALPATH@ +_GL_FUNCDECL_SYS (realpath, char *, + (const char *restrict name, char *restrict resolved) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (realpath, char *, + (const char *restrict name, char *restrict resolved)); +# endif +_GL_CXXALIASWARN (realpath); +#elif defined GNULIB_POSIXCHECK +# undef realpath +# if HAVE_RAW_DECL_REALPATH +_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module " + "canonicalize or canonicalize-lgpl for portability"); +# endif +#endif + +#if @GNULIB_RPMATCH@ +/* Test a user response to a question. + Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ +# if !@HAVE_RPMATCH@ +_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (rpmatch, int, (const char *response)); +_GL_CXXALIASWARN (rpmatch); +#elif defined GNULIB_POSIXCHECK +# undef rpmatch +# if HAVE_RAW_DECL_RPMATCH +_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - " + "use gnulib module rpmatch for portability"); +# endif +#endif + +#if @GNULIB_SECURE_GETENV@ +/* Look up NAME in the environment, returning 0 in insecure situations. */ +# if !@HAVE_SECURE_GETENV@ +_GL_FUNCDECL_SYS (secure_getenv, char *, + (char const *name) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name)); +_GL_CXXALIASWARN (secure_getenv); +#elif defined GNULIB_POSIXCHECK +# undef secure_getenv +# if HAVE_RAW_DECL_SECURE_GETENV +_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - " + "use gnulib module secure_getenv for portability"); +# endif +#endif + +#if @GNULIB_SETENV@ +/* Set NAME to VALUE in the environment. + If REPLACE is nonzero, overwrite an existing value. */ +# if @REPLACE_SETENV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setenv +# define setenv rpl_setenv +# endif +_GL_FUNCDECL_RPL (setenv, int, + (const char *name, const char *value, int replace) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (setenv, int, + (const char *name, const char *value, int replace)); +# else +# if !@HAVE_DECL_SETENV@ +_GL_FUNCDECL_SYS (setenv, int, + (const char *name, const char *value, int replace) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (setenv, int, + (const char *name, const char *value, int replace)); +# endif +# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@) +_GL_CXXALIASWARN (setenv); +# endif +#elif defined GNULIB_POSIXCHECK +# undef setenv +# if HAVE_RAW_DECL_SETENV +_GL_WARN_ON_USE (setenv, "setenv is unportable - " + "use gnulib module setenv for portability"); +# endif +#endif + +#if @GNULIB_STRTOD@ + /* Parse a double from STRING, updating ENDP if appropriate. */ +# if @REPLACE_STRTOD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtod rpl_strtod +# endif +# define GNULIB_defined_strtod_function 1 +_GL_FUNCDECL_RPL (strtod, double, + (const char *restrict str, char **restrict endp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtod, double, + (const char *restrict str, char **restrict endp)); +# else +# if !@HAVE_STRTOD@ +_GL_FUNCDECL_SYS (strtod, double, + (const char *restrict str, char **restrict endp) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtod, double, + (const char *restrict str, char **restrict endp)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (strtod); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtod +# if HAVE_RAW_DECL_STRTOD +_GL_WARN_ON_USE (strtod, "strtod is unportable - " + "use gnulib module strtod for portability"); +# endif +#endif + +#if @GNULIB_STRTOLD@ + /* Parse a 'long double' from STRING, updating ENDP if appropriate. */ +# if @REPLACE_STRTOLD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtold rpl_strtold +# endif +# define GNULIB_defined_strtold_function 1 +_GL_FUNCDECL_RPL (strtold, long double, + (const char *restrict str, char **restrict endp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtold, long double, + (const char *restrict str, char **restrict endp)); +# else +# if !@HAVE_STRTOLD@ +_GL_FUNCDECL_SYS (strtold, long double, + (const char *restrict str, char **restrict endp) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtold, long double, + (const char *restrict str, char **restrict endp)); +# endif +_GL_CXXALIASWARN (strtold); +#elif defined GNULIB_POSIXCHECK +# undef strtold +# if HAVE_RAW_DECL_STRTOLD +_GL_WARN_ON_USE (strtold, "strtold is unportable - " + "use gnulib module strtold for portability"); +# endif +#endif + +#if @GNULIB_STRTOL@ +/* Parse a signed integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set + to ERANGE. */ +# if @REPLACE_STRTOL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtol rpl_strtol +# endif +# define GNULIB_defined_strtol_function 1 +_GL_FUNCDECL_RPL (strtol, long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtol, long, + (const char *restrict string, char **restrict endptr, + int base)); +# else +# if !@HAVE_STRTOL@ +_GL_FUNCDECL_SYS (strtol, long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtol, long, + (const char *restrict string, char **restrict endptr, + int base)); +# endif +_GL_CXXALIASWARN (strtol); +#elif defined GNULIB_POSIXCHECK +# undef strtol +# if HAVE_RAW_DECL_STRTOL +_GL_WARN_ON_USE (strtol, "strtol is unportable - " + "use gnulib module strtol for portability"); +# endif +#endif + +#if @GNULIB_STRTOLL@ +/* Parse a signed integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set + to ERANGE. */ +# if @REPLACE_STRTOLL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtoll rpl_strtoll +# endif +# define GNULIB_defined_strtoll_function 1 +_GL_FUNCDECL_RPL (strtoll, long long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtoll, long long, + (const char *restrict string, char **restrict endptr, + int base)); +# else +# if !@HAVE_STRTOLL@ +_GL_FUNCDECL_SYS (strtoll, long long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoll, long long, + (const char *restrict string, char **restrict endptr, + int base)); +# endif +_GL_CXXALIASWARN (strtoll); +#elif defined GNULIB_POSIXCHECK +# undef strtoll +# if HAVE_RAW_DECL_STRTOLL +_GL_WARN_ON_USE (strtoll, "strtoll is unportable - " + "use gnulib module strtoll for portability"); +# endif +#endif + +#if @GNULIB_STRTOUL@ +/* Parse an unsigned integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE. */ +# if @REPLACE_STRTOUL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtoul rpl_strtoul +# endif +# define GNULIB_defined_strtoul_function 1 +_GL_FUNCDECL_RPL (strtoul, unsigned long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtoul, unsigned long, + (const char *restrict string, char **restrict endptr, + int base)); +# else +# if !@HAVE_STRTOUL@ +_GL_FUNCDECL_SYS (strtoul, unsigned long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoul, unsigned long, + (const char *restrict string, char **restrict endptr, + int base)); +# endif +_GL_CXXALIASWARN (strtoul); +#elif defined GNULIB_POSIXCHECK +# undef strtoul +# if HAVE_RAW_DECL_STRTOUL +_GL_WARN_ON_USE (strtoul, "strtoul is unportable - " + "use gnulib module strtoul for portability"); +# endif +#endif + +#if @GNULIB_STRTOULL@ +/* Parse an unsigned integer whose textual representation starts at STRING. + The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, + it may be decimal or octal (with prefix "0") or hexadecimal (with prefix + "0x"). + If ENDPTR is not NULL, the address of the first byte after the integer is + stored in *ENDPTR. + Upon overflow, the return value is ULLONG_MAX, and errno is set to + ERANGE. */ +# if @REPLACE_STRTOULL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtoull rpl_strtoull +# endif +# define GNULIB_defined_strtoull_function 1 +_GL_FUNCDECL_RPL (strtoull, unsigned long long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtoull, unsigned long long, + (const char *restrict string, char **restrict endptr, + int base)); +# else +# if !@HAVE_STRTOULL@ +_GL_FUNCDECL_SYS (strtoull, unsigned long long, + (const char *restrict string, char **restrict endptr, + int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtoull, unsigned long long, + (const char *restrict string, char **restrict endptr, + int base)); +# endif +_GL_CXXALIASWARN (strtoull); +#elif defined GNULIB_POSIXCHECK +# undef strtoull +# if HAVE_RAW_DECL_STRTOULL +_GL_WARN_ON_USE (strtoull, "strtoull is unportable - " + "use gnulib module strtoull for portability"); +# endif +#endif + +#if @GNULIB_UNLOCKPT@ +/* Unlock the slave side of the pseudo-terminal whose master side is specified + by FD, so that it can be opened. */ +# if !@HAVE_UNLOCKPT@ +_GL_FUNCDECL_SYS (unlockpt, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (unlockpt, int, (int fd)); +_GL_CXXALIASWARN (unlockpt); +#elif defined GNULIB_POSIXCHECK +# undef unlockpt +# if HAVE_RAW_DECL_UNLOCKPT +_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " + "use gnulib module unlockpt for portability"); +# endif +#endif + +#if @GNULIB_UNSETENV@ +/* Remove the variable NAME from the environment. */ +# if @REPLACE_UNSETENV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unsetenv +# define unsetenv rpl_unsetenv +# endif +_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); +# else +# if !@HAVE_DECL_UNSETENV@ +_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); +# endif +# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@) +_GL_CXXALIASWARN (unsetenv); +# endif +#elif defined GNULIB_POSIXCHECK +# undef unsetenv +# if HAVE_RAW_DECL_UNSETENV +_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " + "use gnulib module unsetenv for portability"); +# endif +#endif + +/* Convert a wide character to a multibyte character. */ +#if @GNULIB_WCTOMB@ +# if @REPLACE_WCTOMB@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wctomb +# define wctomb rpl_wctomb +# endif +_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); +_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); +# else +_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (wctomb); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_STDLIB_H */ +#endif /* _@GUARD_PREFIX@_STDLIB_H */ +#endif diff --git a/lib/gl/string.in.h b/lib/gl/string.in.h index 440f4ce..3996da9 100644 --- a/lib/gl/string.in.h +++ b/lib/gl/string.in.h @@ -1,19 +1,19 @@ /* A GNU-like <string.h>. - Copyright (C) 1995-1996, 2001-2019 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2022 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.1, or (at your option) - any later version. + This file 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. - This program is distributed in the hope that it will be useful, + This file 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 <https://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -52,14 +52,6 @@ # include <wchar.h> #endif -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The attribute __pure__ was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ -#endif - /* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */ /* But in any case avoid namespace pollution on glibc systems. */ #if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \ @@ -67,12 +59,98 @@ # include <unistd.h> #endif +/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \ + && defined _AIX) \ + && ! defined __GLIBC__ +# include <strings.h> +#endif + +/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers + that can be freed by passing them as the Ith argument to the + function F. */ +#ifndef _GL_ATTRIBUTE_DEALLOC +# if __GNUC__ >= 11 +# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) +# else +# define _GL_ATTRIBUTE_DEALLOC(f, i) +# endif +#endif + +/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that + can be freed via 'free'; it can be used only after declaring 'free'. */ +/* Applies to: functions. Cannot be used on inline functions. */ +#ifndef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +#endif + +/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly + allocated memory. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_MALLOC +# if __GNUC__ >= 3 || defined __clang__ +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define _GL_ATTRIBUTE_MALLOC +# endif +#endif + +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The attribute __pure__ was added in gcc 2.96. */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif +#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. */ +/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have + been included yet. */ +#if @GNULIB_FREE_POSIX@ +# if (@REPLACE_FREE@ && !defined free \ + && !(defined __cplusplus && defined GNULIB_NAMESPACE)) +/* We can't do '#define free rpl_free' here. */ +_GL_EXTERN_C void rpl_free (void *); +# undef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1) +# else +# if defined _MSC_VER && !defined free +_GL_EXTERN_C +# if defined _DLL + __declspec (dllimport) +# endif + void __cdecl free (void *); +# else +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void free (void *) throw (); +# else +_GL_EXTERN_C void free (void *); +# endif +# endif +# endif +#else +# if defined _MSC_VER && !defined free +_GL_EXTERN_C +# if defined _DLL + __declspec (dllimport) +# endif + void __cdecl free (void *); +# else +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void free (void *) throw (); +# else +_GL_EXTERN_C void free (void *); +# endif +# endif +#endif /* Clear a block of memory. The compiler will not delete a call to this function, even if the block is dead after the call. */ @@ -108,10 +186,18 @@ _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module"); /* Find the index of the least-significant set bit. */ #if @GNULIB_FFSLL@ -# if !@HAVE_FFSLL@ +# if @REPLACE_FFSLL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define ffsll rpl_ffsll +# endif +_GL_FUNCDECL_RPL (ffsll, int, (long long int i)); +_GL_CXXALIAS_RPL (ffsll, int, (long long int i)); +# else +# if !@HAVE_FFSLL@ _GL_FUNCDECL_SYS (ffsll, int, (long long int i)); -# endif +# endif _GL_CXXALIAS_SYS (ffsll, int, (long long int i)); +# endif _GL_CXXALIASWARN (ffsll); #elif defined GNULIB_POSIXCHECK # undef ffsll @@ -121,10 +207,30 @@ _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module"); #endif +#if @GNULIB_MDA_MEMCCPY@ +/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::memccpy always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef memccpy +# define memccpy _memccpy +# endif +_GL_CXXALIAS_MDA (memccpy, void *, + (void *dest, const void *src, int c, size_t n)); +# else +_GL_CXXALIAS_SYS (memccpy, void *, + (void *dest, const void *src, int c, size_t n)); +# endif +_GL_CXXALIASWARN (memccpy); +#endif + + /* Return the first instance of C within N bytes of S, or NULL. */ #if @GNULIB_MEMCHR@ # if @REPLACE_MEMCHR@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef memchr # define memchr rpl_memchr # endif _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) @@ -132,11 +238,6 @@ _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); # else -# if ! @HAVE_MEMCHR@ -_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) - _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1))); -# endif /* On some systems, this function is defined as an overloaded function: extern "C" { const void * std::memchr (const void *, int, size_t); } extern "C++" { void * std::memchr (void *, int, size_t); } */ @@ -145,11 +246,12 @@ _GL_CXXALIAS_SYS_CAST2 (memchr, void const *, (void const *__s, int __c, size_t __n)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n) throw ()); _GL_CXXALIASWARN1 (memchr, void const *, - (void const *__s, int __c, size_t __n)); -# else + (void const *__s, int __c, size_t __n) throw ()); +# elif __GLIBC__ >= 2 _GL_CXXALIASWARN (memchr); # endif #elif defined GNULIB_POSIXCHECK @@ -230,9 +332,10 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr, void *, (void const *, int, size_t), void const *, (void const *, int, size_t)); # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t)); -_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ()); +_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ()); # else _GL_CXXALIASWARN (memrchr); # endif @@ -260,9 +363,11 @@ _GL_CXXALIAS_SYS_CAST2 (rawmemchr, void *, (void const *__s, int __c_in), void const *, (void const *__s, int __c_in)); # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in)); -_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in) throw ()); +_GL_CXXALIASWARN1 (rawmemchr, void const *, + (void const *__s, int __c_in) throw ()); # else _GL_CXXALIASWARN (rawmemchr); # endif @@ -332,9 +437,11 @@ _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - " GB18030 and the character to be searched is a digit. */ # undef strchr /* Assume strchr is always declared. */ -_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings " - "in some multibyte locales - " - "use mbschr if you care about internationalization"); +_GL_WARN_ON_USE_CXX (strchr, + const char *, char *, (const char *, int), + "strchr cannot work correctly on character strings " + "in some multibyte locales - " + "use mbschr if you care about internationalization"); #endif /* Find the first occurrence of C in S or the final NUL byte. */ @@ -362,9 +469,11 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul, char const *, (char const *__s, int __c_in)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in)); -_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ()); +_GL_CXXALIASWARN1 (strchrnul, char const *, + (char const *__s, int __c_in) throw ()); # else _GL_CXXALIASWARN (strchrnul); # endif @@ -383,24 +492,62 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - " # undef strdup # define strdup rpl_strdup # endif -_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (strdup, char *, + (char const *__s) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup _strdup +# endif +_GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); # else # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup /* strdup exists as a function and as a macro. Get rid of the macro. */ # undef strdup # endif -# if !(@HAVE_DECL_STRDUP@ || defined strdup) -_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); +# if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup +_GL_FUNCDECL_SYS (strdup, char *, + (char const *__s) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); # endif _GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); # endif _GL_CXXALIASWARN (strdup); -#elif defined GNULIB_POSIXCHECK -# undef strdup -# if HAVE_RAW_DECL_STRDUP +#else +# if __GNUC__ >= 11 && !defined strdup +/* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */ +_GL_FUNCDECL_SYS (strdup, char *, + (char const *__s) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK +# undef strdup +# if HAVE_RAW_DECL_STRDUP _GL_WARN_ON_USE (strdup, "strdup is unportable - " "use gnulib module strdup for portability"); +# endif +# elif @GNULIB_MDA_STRDUP@ +/* On native Windows, map 'creat' to '_creat', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::strdup always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup _strdup +# endif +_GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); +# else +# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup +# undef strdup +# endif +_GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); +# endif +_GL_CXXALIASWARN (strdup); # endif #endif @@ -411,13 +558,18 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - " # undef strncat # define strncat rpl_strncat # endif -_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) - _GL_ARG_NONNULL ((1, 2))); -_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); +_GL_FUNCDECL_RPL (strncat, char *, + (char *restrict dest, const char *restrict src, size_t n) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (strncat, char *, + (char *restrict dest, const char *restrict src, size_t n)); # else -_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); +_GL_CXXALIAS_SYS (strncat, char *, + (char *restrict dest, const char *restrict src, size_t n)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (strncat); +# endif #elif defined GNULIB_POSIXCHECK # undef strncat # if HAVE_RAW_DECL_STRNCAT @@ -433,22 +585,35 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " # undef strndup # define strndup rpl_strndup # endif -_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) - _GL_ARG_NONNULL ((1))); +_GL_FUNCDECL_RPL (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # else -# if ! @HAVE_DECL_STRNDUP@ -_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) - _GL_ARG_NONNULL ((1))); +# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup) +_GL_FUNCDECL_SYS (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); # endif _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); # endif _GL_CXXALIASWARN (strndup); -#elif defined GNULIB_POSIXCHECK -# undef strndup -# if HAVE_RAW_DECL_STRNDUP +#else +# if __GNUC__ >= 11 && !defined strndup +/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ +_GL_FUNCDECL_SYS (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); +# endif +# if defined GNULIB_POSIXCHECK +# undef strndup +# if HAVE_RAW_DECL_STRNDUP _GL_WARN_ON_USE (strndup, "strndup is unportable - " "use gnulib module strndup for portability"); +# endif # endif #endif @@ -508,11 +673,12 @@ _GL_CXXALIAS_SYS_CAST2 (strpbrk, char *, (char const *__s, char const *__accept), const char *, (char const *__s, char const *__accept)); # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept) throw ()); _GL_CXXALIASWARN1 (strpbrk, char const *, - (char const *__s, char const *__accept)); -# else + (char const *__s, char const *__accept) throw ()); +# elif __GLIBC__ >= 2 _GL_CXXALIASWARN (strpbrk); # endif # if defined GNULIB_POSIXCHECK @@ -521,15 +687,19 @@ _GL_CXXALIASWARN (strpbrk); locale encoding is GB18030 and one of the characters to be searched is a digit. */ # undef strpbrk -_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings " - "in multibyte locales - " - "use mbspbrk if you care about internationalization"); +_GL_WARN_ON_USE_CXX (strpbrk, + const char *, char *, (const char *, const char *), + "strpbrk cannot work correctly on character strings " + "in multibyte locales - " + "use mbspbrk if you care about internationalization"); # endif #elif defined GNULIB_POSIXCHECK # undef strpbrk # if HAVE_RAW_DECL_STRPBRK -_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - " - "use gnulib module strpbrk for portability"); +_GL_WARN_ON_USE_CXX (strpbrk, + const char *, char *, (const char *, const char *), + "strpbrk is unportable - " + "use gnulib module strpbrk for portability"); # endif #endif @@ -548,9 +718,11 @@ _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings " GB18030 and the character to be searched is a digit. */ # undef strrchr /* Assume strrchr is always declared. */ -_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings " - "in some multibyte locales - " - "use mbsrchr if you care about internationalization"); +_GL_WARN_ON_USE_CXX (strrchr, + const char *, char *, (const char *, int), + "strrchr cannot work correctly on character strings " + "in some multibyte locales - " + "use mbsrchr if you care about internationalization"); #endif /* Search the next delimiter (char listed in DELIM) starting at *STRINGP. @@ -610,11 +782,13 @@ _GL_CXXALIAS_SYS_CAST2 (strstr, const char *, (const char *haystack, const char *needle)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strstr, char *, + (char *haystack, const char *needle) throw ()); _GL_CXXALIASWARN1 (strstr, const char *, - (const char *haystack, const char *needle)); -# else + (const char *haystack, const char *needle) throw ()); +# elif __GLIBC__ >= 2 _GL_CXXALIASWARN (strstr); # endif #elif defined GNULIB_POSIXCHECK @@ -659,10 +833,12 @@ _GL_CXXALIAS_SYS_CAST2 (strcasestr, const char *, (const char *haystack, const char *needle)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strcasestr, char *, + (char *haystack, const char *needle) throw ()); _GL_CXXALIASWARN1 (strcasestr, const char *, - (const char *haystack, const char *needle)); + (const char *haystack, const char *needle) throw ()); # else _GL_CXXALIASWARN (strcasestr); # endif @@ -693,7 +869,7 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character " This is a variant of strtok() that is multithread-safe. For the POSIX documentation for this function, see: - http://www.opengroup.org/susv3xsh/strtok.html + https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html Caveat: It modifies the original string. Caveat: These functions cannot be used on constant strings. @@ -964,7 +1140,8 @@ _GL_EXTERN_C char * mbssep (char **stringp, const char *delim) Caveat: The identity of the delimiting character is lost. See also mbssep(). */ -_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr) +_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim, + char **save_ptr) _GL_ARG_NONNULL ((2, 3)); #endif @@ -980,7 +1157,9 @@ _GL_CXXALIAS_RPL (strerror, char *, (int)); # else _GL_CXXALIAS_SYS (strerror, char *, (int)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (strerror); +# endif #elif defined GNULIB_POSIXCHECK # undef strerror /* Assume strerror is always declared. */ @@ -1017,6 +1196,60 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " # endif #endif +/* Return the name of the system error code ERRNUM. */ +#if @GNULIB_STRERRORNAME_NP@ +# if @REPLACE_STRERRORNAME_NP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerrorname_np +# define strerrorname_np rpl_strerrorname_np +# endif +_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); +_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); +# else +# if !@HAVE_STRERRORNAME_NP@ +_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIASWARN (strerrorname_np); +#elif defined GNULIB_POSIXCHECK +# undef strerrorname_np +# if HAVE_RAW_DECL_STRERRORNAME_NP +_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " + "use gnulib module strerrorname_np for portability"); +# endif +#endif + +/* Return an abbreviation string for the signal number SIG. */ +#if @GNULIB_SIGABBREV_NP@ +# if ! @HAVE_SIGABBREV_NP@ +_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig)); +# endif +_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig)); +_GL_CXXALIASWARN (sigabbrev_np); +#elif defined GNULIB_POSIXCHECK +# undef sigabbrev_np +# if HAVE_RAW_DECL_SIGABBREV_NP +_GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - " + "use gnulib module sigabbrev_np for portability"); +# endif +#endif + +/* Return an English description string for the signal number SIG. */ +#if @GNULIB_SIGDESCR_NP@ +# if ! @HAVE_SIGDESCR_NP@ +_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig)); +# endif +_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig)); +_GL_CXXALIASWARN (sigdescr_np); +#elif defined GNULIB_POSIXCHECK +# undef sigdescr_np +# if HAVE_RAW_DECL_SIGDESCR_NP +_GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - " + "use gnulib module sigdescr_np for portability"); +# endif +#endif + #if @GNULIB_STRSIGNAL@ # if @REPLACE_STRSIGNAL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) diff --git a/lib/gl/strverscmp.c b/lib/gl/strverscmp.c index 83922ea..374f564 100644 --- a/lib/gl/strverscmp.c +++ b/lib/gl/strverscmp.c @@ -1,5 +1,5 @@ /* Compare strings while treating digits characters numerically. - Copyright (C) 1997-2019 Free Software Foundation, Inc. + Copyright (C) 1997-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997. diff --git a/lib/gl/sys_types.in.h b/lib/gl/sys_types.in.h index ac2bd7e..698e88d 100644 --- a/lib/gl/sys_types.in.h +++ b/lib/gl/sys_types.in.h @@ -1,19 +1,19 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2019 Free Software Foundation, Inc. + Copyright (C) 2011-2022 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.1, or (at your option) - any later version. + This file 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. - This program is distributed in the hope that it will be useful, + This file 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 <https://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ diff --git a/lib/gl/unistd.c b/lib/gl/unistd.c new file mode 100644 index 0000000..95978e6 --- /dev/null +++ b/lib/gl/unistd.c @@ -0,0 +1,22 @@ +/* Inline functions for <unistd.h>. + + Copyright (C) 2012-2022 Free Software Foundation, Inc. + + This file 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. + + This file 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 <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE +#include "unistd.h" +typedef int dummy; diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h new file mode 100644 index 0000000..57df09e --- /dev/null +++ b/lib/gl/unistd.in.h @@ -0,0 +1,2327 @@ +/* Substitute for and wrapper around <unistd.h>. + Copyright (C) 2003-2022 Free Software Foundation, Inc. + + This file 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. + + This file 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 <https://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_UNISTD_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H +/* Special invocation convention: + - On Mac OS X 10.3.9 we have a sequence of nested includes + <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h> + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT@ @NEXT_UNISTD_H@ + +#else +/* Normal invocation convention. */ + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_UNISTD_H@ +# define _GL_INCLUDING_UNISTD_H +# @INCLUDE_NEXT@ @NEXT_UNISTD_H@ +# undef _GL_INCLUDING_UNISTD_H +#endif + +/* Get all possible declarations of gethostname(). */ +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ + && !defined _GL_INCLUDING_WINSOCK2_H +# define _GL_INCLUDING_WINSOCK2_H +# include <winsock2.h> +# undef _GL_INCLUDING_WINSOCK2_H +#endif + +#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H +#define _@GUARD_PREFIX@_UNISTD_H + +/* NetBSD 5.0 mis-defines NULL. Also get size_t. */ +/* But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include <stddef.h> +#endif + +/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ +/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include + it before we #define unlink rpl_unlink. */ +/* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ + || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ + && (defined _WIN32 && ! defined __CYGWIN__)) \ + || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ + && defined __CYGWIN__)) \ + && ! defined __GLIBC__ +# include <stdio.h> +#endif + +/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in + <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ + && (defined __CYGWIN__ || defined __ANDROID__) \ + && ! defined __GLIBC__ +# include <fcntl.h> +#endif + +/* mingw fails to declare _exit in <unistd.h>. */ +/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in + <unistd.h>. */ +/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */ +/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is + included here. */ +/* But avoid namespace pollution on glibc systems. */ +#if !defined __GLIBC__ && !defined __osf__ +# define __need_system_stdlib_h +# include <stdlib.h> +# undef __need_system_stdlib_h +#endif + +/* Native Windows platforms declare _chdir, _getcwd, _rmdir in + <io.h> and/or <direct.h>, not in <unistd.h>. + They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(), + _lseek(), _read(), _unlink(), _write() in <io.h>. */ +#if defined _WIN32 && !defined __CYGWIN__ +# include <io.h> +# include <direct.h> +#endif + +/* Native Windows platforms declare _execl*, _execv* in <process.h>. */ +#if defined _WIN32 && !defined __CYGWIN__ +# include <process.h> +#endif + +/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. + NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \ + || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \ + && !defined __GLIBC__ +# include <netdb.h> +#endif + +/* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in + <sys/random.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \ + && ((defined __APPLE__ && defined __MACH__) || defined __sun \ + || defined __ANDROID__) \ + && @UNISTD_H_HAVE_SYS_RANDOM_H@ \ + && !defined __GLIBC__ +# include <sys/random.h> +#endif + +/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ + && !defined __GLIBC__ +# include <sys/stat.h> +#endif + +/* MSVC defines off_t in <sys/types.h>. + May also define off_t to a 64-bit type on native Windows. */ +/* Get off_t, ssize_t, mode_t. */ +#include <sys/types.h> + +/* 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. */ + + +/* Get getopt(), optarg, optind, opterr, optopt. */ +#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT +# include <getopt-cdefs.h> +# include <getopt-pfx-core.h> +#endif + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_UNISTD_INLINE +# define _GL_UNISTD_INLINE _GL_INLINE +#endif + +/* Hide some function declarations from <winsock2.h>. */ + +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ +# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# else + _GL_WARN_ON_USE (socket, + "socket() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (connect, + "connect() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (accept, + "accept() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (bind, + "bind() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getpeername, + "getpeername() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockname, + "getsockname() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (getsockopt, + "getsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (listen, + "listen() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recv, + "recv() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (send, + "send() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (recvfrom, + "recvfrom() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (sendto, + "sendto() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (setsockopt, + "setsockopt() used without including <sys/socket.h>"); + _GL_WARN_ON_USE (shutdown, + "shutdown() used without including <sys/socket.h>"); +# endif +# endif +# if !defined _@GUARD_PREFIX@_SYS_SELECT_H +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef select +# define select select_used_without_including_sys_select_h +# else + _GL_WARN_ON_USE (select, + "select() used without including <sys/select.h>"); +# endif +# endif +#endif + + +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + +/* Ensure *_OK macros exist. */ +#ifndef F_OK +# define F_OK 0 +# define X_OK 1 +# define W_OK 2 +# define R_OK 4 +#endif + + +/* Declare overridden functions. */ + + +#if @GNULIB_ACCESS@ +# if @REPLACE_ACCESS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access rpl_access +# endif +_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access _access +# endif +_GL_CXXALIAS_MDA (access, int, (const char *file, int mode)); +# else +_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); +# endif +_GL_CXXALIASWARN (access); +#elif defined GNULIB_POSIXCHECK +# undef access +# if HAVE_RAW_DECL_ACCESS +/* The access() function is a security risk. */ +_GL_WARN_ON_USE (access, "access does not always support X_OK - " + "use gnulib module access for portability; " + "also, this function is a security risk - " + "use the gnulib module faccessat instead"); +# endif +#elif @GNULIB_MDA_ACCESS@ +/* On native Windows, map 'access' to '_access', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::access always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access _access +# endif +_GL_CXXALIAS_MDA (access, int, (const char *file, int mode)); +# else +_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); +# endif +_GL_CXXALIASWARN (access); +#endif + + +#if @GNULIB_CHDIR@ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chdir +# define chdir _chdir +# endif +_GL_CXXALIAS_MDA (chdir, int, (const char *file)); +# else +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIASWARN (chdir); +#elif defined GNULIB_POSIXCHECK +# undef chdir +# if HAVE_RAW_DECL_CHDIR +_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " + "use gnulib module chdir for portability"); +# endif +#elif @GNULIB_MDA_CHDIR@ +/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::chdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chdir +# define chdir _chdir +# endif +_GL_CXXALIAS_MDA (chdir, int, (const char *file)); +# else +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIASWARN (chdir); +#endif + + +#if @GNULIB_CHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */ +# if @REPLACE_CHOWN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chown +# define chown rpl_chown +# endif +_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)); +# else +# if !@HAVE_CHOWN@ +_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); +# endif +_GL_CXXALIASWARN (chown); +#elif defined GNULIB_POSIXCHECK +# undef chown +# if HAVE_RAW_DECL_CHOWN +_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " + "doesn't treat a uid or gid of -1 on some systems - " + "use gnulib module chown for portability"); +# endif +#endif + + +#if @GNULIB_CLOSE@ +# if @REPLACE_CLOSE@ +/* Automatically included by modules that need a replacement for close. */ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close rpl_close +# endif +_GL_FUNCDECL_RPL (close, int, (int fd)); +_GL_CXXALIAS_RPL (close, int, (int fd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close _close +# endif +_GL_CXXALIAS_MDA (close, int, (int fd)); +# else +_GL_CXXALIAS_SYS (close, int, (int fd)); +# endif +_GL_CXXALIASWARN (close); +#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +# undef close +# define close close_used_without_requesting_gnulib_module_close +#elif defined GNULIB_POSIXCHECK +# undef close +/* Assume close is always declared. */ +_GL_WARN_ON_USE (close, "close does not portably work on sockets - " + "use gnulib module close for portability"); +#elif @GNULIB_MDA_CLOSE@ +/* On native Windows, map 'close' to '_close', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::close always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close _close +# endif +_GL_CXXALIAS_MDA (close, int, (int fd)); +# else +_GL_CXXALIAS_SYS (close, int, (int fd)); +# endif +_GL_CXXALIASWARN (close); +#endif + + +#if @GNULIB_COPY_FILE_RANGE@ +# if @REPLACE_COPY_FILE_RANGE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef copy_file_range +# define copy_file_range rpl_copy_file_range +# endif +_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +# else +# if !@HAVE_COPY_FILE_RANGE@ +_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +# endif +_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +# endif +_GL_CXXALIASWARN (copy_file_range); +#elif defined GNULIB_POSIXCHECK +# undef copy_file_range +# if HAVE_RAW_DECL_COPY_FILE_RANGE +_GL_WARN_ON_USE (copy_file_range, + "copy_file_range is unportable - " + "use gnulib module copy_file_range for portability"); +# endif +#endif + + +#if @GNULIB_DUP@ +# if @REPLACE_DUP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup rpl_dup +# endif +_GL_FUNCDECL_RPL (dup, int, (int oldfd)); +_GL_CXXALIAS_RPL (dup, int, (int oldfd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup +# define dup _dup +# endif +_GL_CXXALIAS_MDA (dup, int, (int oldfd)); +# else +_GL_CXXALIAS_SYS (dup, int, (int oldfd)); +# endif +_GL_CXXALIASWARN (dup); +#elif defined GNULIB_POSIXCHECK +# undef dup +# if HAVE_RAW_DECL_DUP +_GL_WARN_ON_USE (dup, "dup is unportable - " + "use gnulib module dup for portability"); +# endif +#elif @GNULIB_MDA_DUP@ +/* On native Windows, map 'dup' to '_dup', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::dup always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup +# define dup _dup +# endif +_GL_CXXALIAS_MDA (dup, int, (int oldfd)); +# else +_GL_CXXALIAS_SYS (dup, int, (int oldfd)); +# endif +_GL_CXXALIASWARN (dup); +#endif + + +#if @GNULIB_DUP2@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if + NEWFD = OLDFD, otherwise close NEWFD first if it is open. + Return newfd if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */ +# if @REPLACE_DUP2@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup2 rpl_dup2 +# endif +_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); +_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup2 +# define dup2 _dup2 +# endif +_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd)); +# else +_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); +# endif +_GL_CXXALIASWARN (dup2); +#elif defined GNULIB_POSIXCHECK +# undef dup2 +# if HAVE_RAW_DECL_DUP2 +_GL_WARN_ON_USE (dup2, "dup2 is unportable - " + "use gnulib module dup2 for portability"); +# endif +#elif @GNULIB_MDA_DUP2@ +/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::dup2 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup2 +# define dup2 _dup2 +# endif +_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd)); +# else +_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); +# endif +_GL_CXXALIASWARN (dup2); +#endif + + +#if @GNULIB_DUP3@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the + specified flags. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + Close NEWFD first if it is open. + Return newfd if successful, otherwise -1 and errno set. + See the Linux man page at + <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ +# if @HAVE_DUP3@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup3 rpl_dup3 +# endif +_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); +_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); +# else +_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); +_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); +# endif +_GL_CXXALIASWARN (dup3); +#elif defined GNULIB_POSIXCHECK +# undef dup3 +# if HAVE_RAW_DECL_DUP3 +_GL_WARN_ON_USE (dup3, "dup3 is unportable - " + "use gnulib module dup3 for portability"); +# endif +#endif + + +#if @GNULIB_ENVIRON@ +# if defined __CYGWIN__ && !defined __i386__ +/* The 'environ' variable is defined in a DLL. Therefore its declaration needs + the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it. + This leads to a link error on 64-bit Cygwin when the option + -Wl,--disable-auto-import is in use. */ +_GL_EXTERN_C __declspec(dllimport) char **environ; +# endif +# if !@HAVE_DECL_ENVIRON@ +/* Set of environment variables and values. An array of strings of the form + "VARIABLE=VALUE", terminated with a NULL. */ +# if defined __APPLE__ && defined __MACH__ +# include <TargetConditionals.h> +# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR +# define _GL_USE_CRT_EXTERNS +# endif +# endif +# ifdef _GL_USE_CRT_EXTERNS +# include <crt_externs.h> +# define environ (*_NSGetEnviron ()) +# else +# ifdef __cplusplus +extern "C" { +# endif +extern char **environ; +# ifdef __cplusplus +} +# endif +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# if HAVE_RAW_DECL_ENVIRON +_GL_UNISTD_INLINE char *** +_GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - " + "use gnulib module environ for portability") +rpl_environ (void) +{ + return &environ; +} +# undef environ +# define environ (*rpl_environ ()) +# endif +#endif + + +#if @GNULIB_EUIDACCESS@ +/* Like access(), except that it uses the effective user id and group id of + the current process. */ +# if !@HAVE_EUIDACCESS@ +_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode)); +_GL_CXXALIASWARN (euidaccess); +# if defined GNULIB_POSIXCHECK +/* Like access(), this function is a security risk. */ +_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - " + "use the gnulib module faccessat instead"); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# if HAVE_RAW_DECL_EUIDACCESS +_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " + "use gnulib module euidaccess for portability"); +# endif +#endif + + +#if @GNULIB_EXECL@ +# if @REPLACE_EXECL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl rpl_execl +# endif +_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#elif defined GNULIB_POSIXCHECK +# undef execl +# if HAVE_RAW_DECL_EXECL +_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - " + "use gnulib module execl for portability"); +# endif +#elif @GNULIB_MDA_EXECL@ +/* On native Windows, map 'execl' to '_execl', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execl always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl _execl +# endif +_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#endif + +#if @GNULIB_EXECLE@ +# if @REPLACE_EXECLE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle rpl_execle +# endif +_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#elif defined GNULIB_POSIXCHECK +# undef execle +# if HAVE_RAW_DECL_EXECLE +_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - " + "use gnulib module execle for portability"); +# endif +#elif @GNULIB_MDA_EXECLE@ +/* On native Windows, map 'execle' to '_execle', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execle always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle _execle +# endif +_GL_CXXALIAS_MDA (execle, intptr_t, + (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#endif + +#if @GNULIB_EXECLP@ +# if @REPLACE_EXECLP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp rpl_execlp +# endif +_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#elif defined GNULIB_POSIXCHECK +# undef execlp +# if HAVE_RAW_DECL_EXECLP +_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - " + "use gnulib module execlp for portability"); +# endif +#elif @GNULIB_MDA_EXECLP@ +/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execlp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp _execlp +# endif +_GL_CXXALIAS_MDA (execlp, intptr_t, + (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#endif + + +#if @GNULIB_EXECV@ +# if @REPLACE_EXECV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv rpl_execv +# endif +_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#elif defined GNULIB_POSIXCHECK +# undef execv +# if HAVE_RAW_DECL_EXECV +_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - " + "use gnulib module execv for portability"); +# endif +#elif @GNULIB_MDA_EXECV@ +/* On native Windows, map 'execv' to '_execv', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execv always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv _execv +# endif +_GL_CXXALIAS_MDA_CAST (execv, intptr_t, + (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#endif + +#if @GNULIB_EXECVE@ +# if @REPLACE_EXECVE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve rpl_execve +# endif +_GL_FUNCDECL_RPL (execve, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execve, int, + (const char *program, char * const *argv, char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#elif defined GNULIB_POSIXCHECK +# undef execve +# if HAVE_RAW_DECL_EXECVE +_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - " + "use gnulib module execve for portability"); +# endif +#elif @GNULIB_MDA_EXECVE@ +/* On native Windows, map 'execve' to '_execve', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execve always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve _execve +# endif +_GL_CXXALIAS_MDA_CAST (execve, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#endif + +#if @GNULIB_EXECVP@ +# if @REPLACE_EXECVP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp rpl_execvp +# endif +_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#elif defined GNULIB_POSIXCHECK +# undef execvp +# if HAVE_RAW_DECL_EXECVP +_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - " + "use gnulib module execvp for portability"); +# endif +#elif @GNULIB_MDA_EXECVP@ +/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execvp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp _execvp +# endif +_GL_CXXALIAS_MDA_CAST (execvp, intptr_t, + (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#endif + +#if @GNULIB_EXECVPE@ +# if @REPLACE_EXECVPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe rpl_execvpe +# endif +_GL_FUNCDECL_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# else +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execvpe); +#elif defined GNULIB_POSIXCHECK +# undef execvpe +# if HAVE_RAW_DECL_EXECVPE +_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - " + "use gnulib module execvpe for portability"); +# endif +#elif @GNULIB_MDA_EXECVPE@ +/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe _execvpe +# endif +_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# elif @HAVE_EXECVPE@ +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@ +_GL_CXXALIASWARN (execvpe); +# endif +#endif + + +#if @GNULIB_FACCESSAT@ +# if @REPLACE_FACCESSAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef faccessat +# define faccessat rpl_faccessat +# endif +_GL_FUNCDECL_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag)); +# else +# if !@HAVE_FACCESSAT@ +_GL_FUNCDECL_SYS (faccessat, int, + (int fd, char const *file, int mode, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (faccessat, int, + (int fd, char const *file, int mode, int flag)); +# endif +_GL_CXXALIASWARN (faccessat); +#elif defined GNULIB_POSIXCHECK +# undef faccessat +# if HAVE_RAW_DECL_FACCESSAT +_GL_WARN_ON_USE (faccessat, "faccessat is not portable - " + "use gnulib module faccessat for portability"); +# endif +#endif + + +#if @GNULIB_FCHDIR@ +/* Change the process' current working directory to the directory on which + the given file descriptor is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ +# if ! @HAVE_FCHDIR@ +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); + +/* Gnulib internal hooks needed to maintain the fchdir metadata. */ +_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename) + _GL_ARG_NONNULL ((2)); +_GL_EXTERN_C void _gl_unregister_fd (int fd); +_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); +_GL_EXTERN_C const char *_gl_directory_name (int fd); + +# else +# if !@HAVE_DECL_FCHDIR@ +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); +# endif +# endif +_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); +_GL_CXXALIASWARN (fchdir); +#elif defined GNULIB_POSIXCHECK +# undef fchdir +# if HAVE_RAW_DECL_FCHDIR +_GL_WARN_ON_USE (fchdir, "fchdir is unportable - " + "use gnulib module fchdir for portability"); +# endif +#endif + + +#if @GNULIB_FCHOWNAT@ +# if @REPLACE_FCHOWNAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fchownat +# define fchownat rpl_fchownat +# endif +_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag)); +# else +# if !@HAVE_FCHOWNAT@ +_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file, + uid_t owner, gid_t group, int flag)); +# endif +_GL_CXXALIASWARN (fchownat); +#elif defined GNULIB_POSIXCHECK +# undef fchownat +# if HAVE_RAW_DECL_FCHOWNAT +_GL_WARN_ON_USE (fchownat, "fchownat is not portable - " + "use gnulib module fchownat for portability"); +# endif +#endif + + +#if @GNULIB_FDATASYNC@ +/* Synchronize changes to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ +# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ +_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (fdatasync, int, (int fd)); +_GL_CXXALIASWARN (fdatasync); +#elif defined GNULIB_POSIXCHECK +# undef fdatasync +# if HAVE_RAW_DECL_FDATASYNC +_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " + "use gnulib module fdatasync for portability"); +# endif +#endif + + +#if @GNULIB_FSYNC@ +/* Synchronize changes, including metadata, to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ +# if !@HAVE_FSYNC@ +_GL_FUNCDECL_SYS (fsync, int, (int fd)); +# endif +_GL_CXXALIAS_SYS (fsync, int, (int fd)); +_GL_CXXALIASWARN (fsync); +#elif defined GNULIB_POSIXCHECK +# undef fsync +# if HAVE_RAW_DECL_FSYNC +_GL_WARN_ON_USE (fsync, "fsync is unportable - " + "use gnulib module fsync for portability"); +# endif +#endif + + +#if @GNULIB_FTRUNCATE@ +/* Change the size of the file to which FD is opened to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */ +# if @REPLACE_FTRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ftruncate +# define ftruncate rpl_ftruncate +# endif +_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length)); +_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length)); +# else +# if !@HAVE_FTRUNCATE@ +_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length)); +# endif +_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length)); +# endif +_GL_CXXALIASWARN (ftruncate); +#elif defined GNULIB_POSIXCHECK +# undef ftruncate +# if HAVE_RAW_DECL_FTRUNCATE +_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " + "use gnulib module ftruncate for portability"); +# endif +#endif + + +#if @GNULIB_GETCWD@ +/* Get the name of the current working directory, and put it in SIZE bytes + of BUF. + Return BUF if successful, or NULL if the directory couldn't be determined + or SIZE was too small. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. + Additionally, the gnulib module 'getcwd' guarantees the following GNU + extension: If BUF is NULL, an array is allocated with 'malloc'; the array + is SIZE bytes long, unless SIZE == 0, in which case it is as big as + necessary. */ +# if @REPLACE_GETCWD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getcwd rpl_getcwd +# endif +_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); +_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getcwd +# define getcwd _getcwd +# endif +_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size)); +# else +/* Need to cast, because on mingw, the second parameter is + int size. */ +_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); +# endif +_GL_CXXALIASWARN (getcwd); +#elif defined GNULIB_POSIXCHECK +# undef getcwd +# if HAVE_RAW_DECL_GETCWD +_GL_WARN_ON_USE (getcwd, "getcwd is unportable - " + "use gnulib module getcwd for portability"); +# endif +#elif @GNULIB_MDA_GETCWD@ +/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getcwd always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getcwd +# define getcwd _getcwd +# endif +/* Need to cast, because on mingw, the second parameter is either + 'int size' or 'size_t size'. */ +_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size)); +# else +_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); +# endif +_GL_CXXALIASWARN (getcwd); +#endif + + +#if @GNULIB_GETDOMAINNAME@ +/* Return the NIS domain name of the machine. + WARNING! The NIS domain name is unrelated to the fully qualified host name + of the machine. It is also unrelated to email addresses. + WARNING! The NIS domain name is usually the empty string or "(none)" when + not using NIS. + + Put up to LEN bytes of the NIS domain name into NAME. + Null terminate it if the name is shorter than LEN. + If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @REPLACE_GETDOMAINNAME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getdomainname +# define getdomainname rpl_getdomainname +# endif +_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len)); +# else +# if !@HAVE_DECL_GETDOMAINNAME@ +_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len)); +# endif +_GL_CXXALIASWARN (getdomainname); +#elif defined GNULIB_POSIXCHECK +# undef getdomainname +# if HAVE_RAW_DECL_GETDOMAINNAME +_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - " + "use gnulib module getdomainname for portability"); +# endif +#endif + + +#if @GNULIB_GETDTABLESIZE@ +/* Return the maximum number of file descriptors in the current process. + In POSIX, this is same as sysconf (_SC_OPEN_MAX). */ +# if @REPLACE_GETDTABLESIZE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getdtablesize +# define getdtablesize rpl_getdtablesize +# endif +_GL_FUNCDECL_RPL (getdtablesize, int, (void)); +_GL_CXXALIAS_RPL (getdtablesize, int, (void)); +# else +# if !@HAVE_GETDTABLESIZE@ +_GL_FUNCDECL_SYS (getdtablesize, int, (void)); +# endif +/* Need to cast, because on AIX, the parameter list is + (...). */ +_GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void)); +# endif +_GL_CXXALIASWARN (getdtablesize); +#elif defined GNULIB_POSIXCHECK +# undef getdtablesize +# if HAVE_RAW_DECL_GETDTABLESIZE +_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " + "use gnulib module getdtablesize for portability"); +# endif +#endif + + +#if @GNULIB_GETENTROPY@ +/* Fill a buffer with random bytes. */ +# if !@HAVE_GETENTROPY@ +_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); +# endif +_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); +_GL_CXXALIASWARN (getentropy); +#elif defined GNULIB_POSIXCHECK +# undef getentropy +# if HAVE_RAW_DECL_GETENTROPY +_GL_WARN_ON_USE (getentropy, "getentropy is unportable - " + "use gnulib module getentropy for portability"); +# endif +#endif + + +#if @GNULIB_GETGROUPS@ +/* Return the supplemental groups that the current process belongs to. + It is unspecified whether the effective group id is in the list. + If N is 0, return the group count; otherwise, N describes how many + entries are available in GROUPS. Return -1 and set errno if N is + not 0 and not large enough. Fails with ENOSYS on some systems. */ +# if @REPLACE_GETGROUPS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getgroups +# define getgroups rpl_getgroups +# endif +_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups)); +_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups)); +# else +# if !@HAVE_GETGROUPS@ +_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups)); +# endif +_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups)); +# endif +_GL_CXXALIASWARN (getgroups); +#elif defined GNULIB_POSIXCHECK +# undef getgroups +# if HAVE_RAW_DECL_GETGROUPS +_GL_WARN_ON_USE (getgroups, "getgroups is unportable - " + "use gnulib module getgroups for portability"); +# endif +#endif + + +#if @GNULIB_GETHOSTNAME@ +/* Return the standard host name of the machine. + WARNING! The host name may or may not be fully qualified. + + Put up to LEN bytes of the host name into NAME. + Null terminate it if the name is shorter than LEN. + If the host name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gethostname +# define gethostname rpl_gethostname +# endif +_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); +# else +# if !@HAVE_GETHOSTNAME@ +_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second + parameter is + int len. */ +_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len)); +# endif +_GL_CXXALIASWARN (gethostname); +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +#elif defined GNULIB_POSIXCHECK +# undef gethostname +# if HAVE_RAW_DECL_GETHOSTNAME +_GL_WARN_ON_USE (gethostname, "gethostname is unportable - " + "use gnulib module gethostname for portability"); +# endif +#endif + + +#if @GNULIB_GETLOGIN@ +/* Returns the user's login name, or NULL if it cannot be found. Upon error, + returns NULL with errno set. + + See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>. + + Most programs don't need to use this function, because the information is + available through environment variables: + ${LOGNAME-$USER} on Unix platforms, + $USERNAME on native Windows platforms. + */ +# if !@HAVE_DECL_GETLOGIN@ +_GL_FUNCDECL_SYS (getlogin, char *, (void)); +# endif +_GL_CXXALIAS_SYS (getlogin, char *, (void)); +_GL_CXXALIASWARN (getlogin); +#elif defined GNULIB_POSIXCHECK +# undef getlogin +# if HAVE_RAW_DECL_GETLOGIN +_GL_WARN_ON_USE (getlogin, "getlogin is unportable - " + "use gnulib module getlogin for portability"); +# endif +#endif + + +#if @GNULIB_GETLOGIN_R@ +/* Copies the user's login name to NAME. + The array pointed to by NAME has room for SIZE bytes. + + Returns 0 if successful. Upon error, an error number is returned, or -1 in + the case that the login name cannot be found but no specific error is + provided (this case is hopefully rare but is left open by the POSIX spec). + + See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>. + + Most programs don't need to use this function, because the information is + available through environment variables: + ${LOGNAME-$USER} on Unix platforms, + $USERNAME on native Windows platforms. + */ +# if @REPLACE_GETLOGIN_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getlogin_r rpl_getlogin_r +# endif +_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size)); +# else +# if !@HAVE_DECL_GETLOGIN_R@ +_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 10 systems, the second argument is + int size. */ +_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size)); +# endif +_GL_CXXALIASWARN (getlogin_r); +#elif defined GNULIB_POSIXCHECK +# undef getlogin_r +# if HAVE_RAW_DECL_GETLOGIN_R +_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " + "use gnulib module getlogin_r for portability"); +# endif +#endif + + +#if @GNULIB_GETPAGESIZE@ +# if @REPLACE_GETPAGESIZE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getpagesize rpl_getpagesize +# endif +_GL_FUNCDECL_RPL (getpagesize, int, (void)); +_GL_CXXALIAS_RPL (getpagesize, int, (void)); +# else +/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if + the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ +# if defined __hpux +_GL_FUNCDECL_SYS (getpagesize, int, (void)); +# endif +# if !@HAVE_GETPAGESIZE@ +# if !defined getpagesize +/* This is for POSIX systems. */ +# if !defined _gl_getpagesize && defined _SC_PAGESIZE +# if ! (defined __VMS && __VMS_VER < 70000000) +# define _gl_getpagesize() sysconf (_SC_PAGESIZE) +# endif +# endif +/* This is for older VMS. */ +# if !defined _gl_getpagesize && defined __VMS +# ifdef __ALPHA +# define _gl_getpagesize() 8192 +# else +# define _gl_getpagesize() 512 +# endif +# endif +/* This is for BeOS. */ +# if !defined _gl_getpagesize && @HAVE_OS_H@ +# include <OS.h> +# if defined B_PAGE_SIZE +# define _gl_getpagesize() B_PAGE_SIZE +# endif +# endif +/* This is for AmigaOS4.0. */ +# if !defined _gl_getpagesize && defined __amigaos4__ +# define _gl_getpagesize() 2048 +# endif +/* This is for older Unix systems. */ +# if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@ +# include <sys/param.h> +# ifdef EXEC_PAGESIZE +# define _gl_getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# define _gl_getpagesize() (NBPG * CLSIZE) +# else +# ifdef NBPC +# define _gl_getpagesize() NBPC +# endif +# endif +# endif +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define getpagesize() _gl_getpagesize () +# else +# if !GNULIB_defined_getpagesize_function +_GL_UNISTD_INLINE int +getpagesize () +{ + return _gl_getpagesize (); +} +# define GNULIB_defined_getpagesize_function 1 +# endif +# endif +# endif +# endif +/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */ +_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void)); +# endif +# if @HAVE_DECL_GETPAGESIZE@ +_GL_CXXALIASWARN (getpagesize); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getpagesize +# if HAVE_RAW_DECL_GETPAGESIZE +_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - " + "use gnulib module getpagesize for portability"); +# endif +#endif + + +#if @GNULIB_GETPASS@ +/* Function getpass() from module 'getpass': + Read a password from /dev/tty or stdin. + Function getpass() from module 'getpass-gnu': + Read a password of arbitrary length from /dev/tty or stdin. */ +# if (@GNULIB_GETPASS@ && @REPLACE_GETPASS@) \ + || (@GNULIB_GETPASS_GNU@ && @REPLACE_GETPASS_FOR_GETPASS_GNU@) +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpass +# define getpass rpl_getpass +# endif +_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt)); +# else +# if !@HAVE_GETPASS@ +_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt)); +# endif +_GL_CXXALIASWARN (getpass); +#elif defined GNULIB_POSIXCHECK +# undef getpass +# if HAVE_RAW_DECL_GETPASS +_GL_WARN_ON_USE (getpass, "getpass is unportable - " + "use gnulib module getpass or getpass-gnu for portability"); +# endif +#endif + + +#if @GNULIB_MDA_GETPID@ +/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getpid always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpid +# define getpid _getpid +# endif +_GL_CXXALIAS_MDA (getpid, int, (void)); +# else +_GL_CXXALIAS_SYS (getpid, pid_t, (void)); +# endif +_GL_CXXALIASWARN (getpid); +#endif + + +#if @GNULIB_GETUSERSHELL@ +/* Return the next valid login shell on the system, or NULL when the end of + the list has been reached. */ +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (getusershell, char *, (void)); +# endif +_GL_CXXALIAS_SYS (getusershell, char *, (void)); +_GL_CXXALIASWARN (getusershell); +#elif defined GNULIB_POSIXCHECK +# undef getusershell +# if HAVE_RAW_DECL_GETUSERSHELL +_GL_WARN_ON_USE (getusershell, "getusershell is unportable - " + "use gnulib module getusershell for portability"); +# endif +#endif + +#if @GNULIB_GETUSERSHELL@ +/* Rewind to pointer that is advanced at each getusershell() call. */ +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (setusershell, void, (void)); +# endif +_GL_CXXALIAS_SYS (setusershell, void, (void)); +_GL_CXXALIASWARN (setusershell); +#elif defined GNULIB_POSIXCHECK +# undef setusershell +# if HAVE_RAW_DECL_SETUSERSHELL +_GL_WARN_ON_USE (setusershell, "setusershell is unportable - " + "use gnulib module getusershell for portability"); +# endif +#endif + +#if @GNULIB_GETUSERSHELL@ +/* Free the pointer that is advanced at each getusershell() call and + associated resources. */ +# if !@HAVE_DECL_GETUSERSHELL@ +_GL_FUNCDECL_SYS (endusershell, void, (void)); +# endif +_GL_CXXALIAS_SYS (endusershell, void, (void)); +_GL_CXXALIASWARN (endusershell); +#elif defined GNULIB_POSIXCHECK +# undef endusershell +# if HAVE_RAW_DECL_ENDUSERSHELL +_GL_WARN_ON_USE (endusershell, "endusershell is unportable - " + "use gnulib module getusershell for portability"); +# endif +#endif + + +#if @GNULIB_GROUP_MEMBER@ +/* Determine whether group id is in calling user's group list. */ +# if !@HAVE_GROUP_MEMBER@ +_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); +# endif +_GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); +_GL_CXXALIASWARN (group_member); +#elif defined GNULIB_POSIXCHECK +# undef group_member +# if HAVE_RAW_DECL_GROUP_MEMBER +_GL_WARN_ON_USE (group_member, "group_member is unportable - " + "use gnulib module group-member for portability"); +# endif +#endif + + +#if @GNULIB_ISATTY@ +# if @REPLACE_ISATTY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty rpl_isatty +# endif +# define GNULIB_defined_isatty 1 +_GL_FUNCDECL_RPL (isatty, int, (int fd)); +_GL_CXXALIAS_RPL (isatty, int, (int fd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty _isatty +# endif +_GL_CXXALIAS_MDA (isatty, int, (int fd)); +# else +_GL_CXXALIAS_SYS (isatty, int, (int fd)); +# endif +_GL_CXXALIASWARN (isatty); +#elif defined GNULIB_POSIXCHECK +# undef isatty +# if HAVE_RAW_DECL_ISATTY +_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " + "use gnulib module isatty for portability"); +# endif +#elif @GNULIB_MDA_ISATTY@ +/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::isatty always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty _isatty +# endif +_GL_CXXALIAS_MDA (isatty, int, (int fd)); +# else +_GL_CXXALIAS_SYS (isatty, int, (int fd)); +# endif +_GL_CXXALIASWARN (isatty); +#endif + + +#if @GNULIB_LCHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Do not follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */ +# if @REPLACE_LCHOWN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lchown +# define lchown rpl_lchown +# endif +_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)); +# else +# if !@HAVE_LCHOWN@ +_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)); +# endif +_GL_CXXALIASWARN (lchown); +#elif defined GNULIB_POSIXCHECK +# undef lchown +# if HAVE_RAW_DECL_LCHOWN +_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - " + "use gnulib module lchown for portability"); +# endif +#endif + + +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */ +# if @REPLACE_LINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define link rpl_link +# endif +_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2)); +# else +# if !@HAVE_LINK@ +_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2)); +# endif +_GL_CXXALIASWARN (link); +#elif defined GNULIB_POSIXCHECK +# undef link +# if HAVE_RAW_DECL_LINK +_GL_WARN_ON_USE (link, "link is unportable - " + "use gnulib module link for portability"); +# endif +#endif + + +#if @GNULIB_LINKAT@ +/* Create a new hard link for an existing file, relative to two + directories. FLAG controls whether symlinks are followed. + Return 0 if successful, otherwise -1 and errno set. */ +# if @REPLACE_LINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef linkat +# define linkat rpl_linkat +# endif +_GL_FUNCDECL_RPL (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag)); +# else +# if !@HAVE_LINKAT@ +_GL_FUNCDECL_SYS (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag) + _GL_ARG_NONNULL ((2, 4))); +# endif +_GL_CXXALIAS_SYS (linkat, int, + (int fd1, const char *path1, int fd2, const char *path2, + int flag)); +# endif +_GL_CXXALIASWARN (linkat); +#elif defined GNULIB_POSIXCHECK +# undef linkat +# if HAVE_RAW_DECL_LINKAT +_GL_WARN_ON_USE (linkat, "linkat is unportable - " + "use gnulib module linkat for portability"); +# endif +#endif + + +#if @GNULIB_LSEEK@ +/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. + Return the new offset if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */ +# if @REPLACE_LSEEK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define lseek rpl_lseek +# endif +_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lseek +# define lseek _lseek +# endif +_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence)); +# else +_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); +# endif +_GL_CXXALIASWARN (lseek); +#elif defined GNULIB_POSIXCHECK +# undef lseek +# if HAVE_RAW_DECL_LSEEK +_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " + "systems - use gnulib module lseek for portability"); +# endif +#elif @GNULIB_MDA_LSEEK@ +/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::lseek always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lseek +# define lseek _lseek +# endif +_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence)); +# else +_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); +# endif +_GL_CXXALIASWARN (lseek); +#endif + + +#if @GNULIB_PIPE@ +/* Create a pipe, defaulting to O_BINARY mode. + Store the read-end as fd[0] and the write-end as fd[1]. + Return 0 upon success, or -1 with errno set upon failure. */ +# if !@HAVE_PIPE@ +_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pipe, int, (int fd[2])); +_GL_CXXALIASWARN (pipe); +#elif defined GNULIB_POSIXCHECK +# undef pipe +# if HAVE_RAW_DECL_PIPE +_GL_WARN_ON_USE (pipe, "pipe is unportable - " + "use gnulib module pipe-posix for portability"); +# endif +#endif + + +#if @GNULIB_PIPE2@ +/* Create a pipe, applying the given flags when opening the read-end of the + pipe and the write-end of the pipe. + The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) + and O_TEXT, O_BINARY (defined in "binary-io.h"). + Store the read-end as fd[0] and the write-end as fd[1]. + Return 0 upon success, or -1 with errno set upon failure. + See also the Linux man page at + <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ +# if @HAVE_PIPE2@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define pipe2 rpl_pipe2 +# endif +_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags)); +# else +_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags)); +# endif +_GL_CXXALIASWARN (pipe2); +#elif defined GNULIB_POSIXCHECK +# undef pipe2 +# if HAVE_RAW_DECL_PIPE2 +_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - " + "use gnulib module pipe2 for portability"); +# endif +#endif + + +#if @GNULIB_PREAD@ +/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET. + Return the number of bytes placed into BUF if successful, otherwise + set errno and return -1. 0 indicates EOF. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */ +# if @REPLACE_PREAD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pread +# define pread rpl_pread +# endif +_GL_FUNCDECL_RPL (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset)); +# else +# if !@HAVE_PREAD@ +_GL_FUNCDECL_SYS (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (pread, ssize_t, + (int fd, void *buf, size_t bufsize, off_t offset)); +# endif +_GL_CXXALIASWARN (pread); +#elif defined GNULIB_POSIXCHECK +# undef pread +# if HAVE_RAW_DECL_PREAD +_GL_WARN_ON_USE (pread, "pread is unportable - " + "use gnulib module pread for portability"); +# endif +#endif + + +#if @GNULIB_PWRITE@ +/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET. + Return the number of bytes written if successful, otherwise + set errno and return -1. 0 indicates nothing written. See the + POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */ +# if @REPLACE_PWRITE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pwrite +# define pwrite rpl_pwrite +# endif +_GL_FUNCDECL_RPL (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset)); +# else +# if !@HAVE_PWRITE@ +_GL_FUNCDECL_SYS (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (pwrite, ssize_t, + (int fd, const void *buf, size_t bufsize, off_t offset)); +# endif +_GL_CXXALIASWARN (pwrite); +#elif defined GNULIB_POSIXCHECK +# undef pwrite +# if HAVE_RAW_DECL_PWRITE +_GL_WARN_ON_USE (pwrite, "pwrite is unportable - " + "use gnulib module pwrite for portability"); +# endif +#endif + + +#if @GNULIB_READ@ +/* Read up to COUNT bytes from file descriptor FD into the buffer starting + at BUF. See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */ +# if @REPLACE_READ@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read rpl_read +# endif +_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read _read +# endif +_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count)); +# else +_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#elif @GNULIB_MDA_READ@ +/* On native Windows, map 'read' to '_read', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::read always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read _read +# endif +# ifdef __MINGW32__ +_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count)); +# else +_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count)); +# endif +# else +_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#endif + + +#if @GNULIB_READLINK@ +/* Read the contents of the symbolic link FILE and place the first BUFSIZE + bytes of it into BUF. Return the number of bytes placed into BUF if + successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */ +# if @REPLACE_READLINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define readlink rpl_readlink +# endif +_GL_FUNCDECL_RPL (readlink, ssize_t, + (const char *restrict file, + char *restrict buf, size_t bufsize) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (readlink, ssize_t, + (const char *restrict file, + char *restrict buf, size_t bufsize)); +# else +# if !@HAVE_READLINK@ +_GL_FUNCDECL_SYS (readlink, ssize_t, + (const char *restrict file, + char *restrict buf, size_t bufsize) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (readlink, ssize_t, + (const char *restrict file, + char *restrict buf, size_t bufsize)); +# endif +_GL_CXXALIASWARN (readlink); +#elif defined GNULIB_POSIXCHECK +# undef readlink +# if HAVE_RAW_DECL_READLINK +_GL_WARN_ON_USE (readlink, "readlink is unportable - " + "use gnulib module readlink for portability"); +# endif +#endif + + +#if @GNULIB_READLINKAT@ +# if @REPLACE_READLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define readlinkat rpl_readlinkat +# endif +_GL_FUNCDECL_RPL (readlinkat, ssize_t, + (int fd, char const *restrict file, + char *restrict buf, size_t len) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (readlinkat, ssize_t, + (int fd, char const *restrict file, + char *restrict buf, size_t len)); +# else +# if !@HAVE_READLINKAT@ +_GL_FUNCDECL_SYS (readlinkat, ssize_t, + (int fd, char const *restrict file, + char *restrict buf, size_t len) + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (readlinkat, ssize_t, + (int fd, char const *restrict file, + char *restrict buf, size_t len)); +# endif +_GL_CXXALIASWARN (readlinkat); +#elif defined GNULIB_POSIXCHECK +# undef readlinkat +# if HAVE_RAW_DECL_READLINKAT +_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - " + "use gnulib module readlinkat for portability"); +# endif +#endif + + +#if @GNULIB_RMDIR@ +/* Remove the directory DIR. */ +# if @REPLACE_RMDIR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define rmdir rpl_rmdir +# endif +_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (rmdir, int, (char const *name)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rmdir +# define rmdir _rmdir +# endif +_GL_CXXALIAS_MDA (rmdir, int, (char const *name)); +# else +_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); +# endif +_GL_CXXALIASWARN (rmdir); +#elif defined GNULIB_POSIXCHECK +# undef rmdir +# if HAVE_RAW_DECL_RMDIR +_GL_WARN_ON_USE (rmdir, "rmdir is unportable - " + "use gnulib module rmdir for portability"); +# endif +#elif @GNULIB_MDA_RMDIR@ +/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::rmdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rmdir +# define rmdir _rmdir +# endif +_GL_CXXALIAS_MDA (rmdir, int, (char const *name)); +# else +_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); +# endif +_GL_CXXALIASWARN (rmdir); +#endif + + +#if @GNULIB_SETHOSTNAME@ +/* Set the host name of the machine. + The host name may or may not be fully qualified. + + Put LEN bytes of NAME into the host name. + Return 0 if successful, otherwise, set errno and return -1. + + Platforms with no ability to set the hostname return -1 and set + errno = ENOSYS. */ +# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ +_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5 + and FreeBSD 6.4 the second parameter is int. On Solaris 11 + 2011-10, the first parameter is not const. */ +_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); +_GL_CXXALIASWARN (sethostname); +#elif defined GNULIB_POSIXCHECK +# undef sethostname +# if HAVE_RAW_DECL_SETHOSTNAME +_GL_WARN_ON_USE (sethostname, "sethostname is unportable - " + "use gnulib module sethostname for portability"); +# endif +#endif + + +#if @GNULIB_SLEEP@ +/* Pause the execution of the current thread for N seconds. + Returns the number of seconds left to sleep. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */ +# if @REPLACE_SLEEP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sleep +# define sleep rpl_sleep +# endif +_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n)); +_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n)); +# else +# if !@HAVE_SLEEP@ +_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n)); +# endif +_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); +# endif +_GL_CXXALIASWARN (sleep); +#elif defined GNULIB_POSIXCHECK +# undef sleep +# if HAVE_RAW_DECL_SLEEP +_GL_WARN_ON_USE (sleep, "sleep is unportable - " + "use gnulib module sleep for portability"); +# endif +#endif + + +#if @GNULIB_MDA_SWAB@ +/* On native Windows, map 'swab' to '_swab', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::swab always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef swab +# define swab _swab +# endif +/* Need to cast, because in old mingw the arguments are + (const char *from, char *to, size_t n). */ +_GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n)); +# else +# if defined __hpux /* HP-UX */ +_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n)); +# elif defined __sun && !defined _XPG4 /* Solaris */ +_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n)); +# else +_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n)); +# endif +# endif +_GL_CXXALIASWARN (swab); +#endif + + +#if @GNULIB_SYMLINK@ +# if @REPLACE_SYMLINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef symlink +# define symlink rpl_symlink +# endif +_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file)); +# else +# if !@HAVE_SYMLINK@ +_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file)); +# endif +_GL_CXXALIASWARN (symlink); +#elif defined GNULIB_POSIXCHECK +# undef symlink +# if HAVE_RAW_DECL_SYMLINK +_GL_WARN_ON_USE (symlink, "symlink is not portable - " + "use gnulib module symlink for portability"); +# endif +#endif + + +#if @GNULIB_SYMLINKAT@ +# if @REPLACE_SYMLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef symlinkat +# define symlinkat rpl_symlinkat +# endif +_GL_FUNCDECL_RPL (symlinkat, int, + (char const *contents, int fd, char const *file) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (symlinkat, int, + (char const *contents, int fd, char const *file)); +# else +# if !@HAVE_SYMLINKAT@ +_GL_FUNCDECL_SYS (symlinkat, int, + (char const *contents, int fd, char const *file) + _GL_ARG_NONNULL ((1, 3))); +# endif +_GL_CXXALIAS_SYS (symlinkat, int, + (char const *contents, int fd, char const *file)); +# endif +_GL_CXXALIASWARN (symlinkat); +#elif defined GNULIB_POSIXCHECK +# undef symlinkat +# if HAVE_RAW_DECL_SYMLINKAT +_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " + "use gnulib module symlinkat for portability"); +# endif +#endif + + +#if @GNULIB_TRUNCATE@ +/* Change the size of the file designated by FILENAME to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */ +# if @REPLACE_TRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef truncate +# define truncate rpl_truncate +# endif +_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); +# else +# if !@HAVE_DECL_TRUNCATE@ +_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); +# endif +_GL_CXXALIASWARN (truncate); +#elif defined GNULIB_POSIXCHECK +# undef truncate +# if HAVE_RAW_DECL_TRUNCATE +_GL_WARN_ON_USE (truncate, "truncate is unportable - " + "use gnulib module truncate for portability"); +# endif +#endif + + +#if @GNULIB_TTYNAME_R@ +/* Store at most BUFLEN characters of the pathname of the terminal FD is + open on in BUF. Return 0 on success, otherwise an error number. */ +# if @REPLACE_TTYNAME_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ttyname_r +# define ttyname_r rpl_ttyname_r +# endif +_GL_FUNCDECL_RPL (ttyname_r, int, + (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (ttyname_r, int, + (int fd, char *buf, size_t buflen)); +# else +# if !@HAVE_DECL_TTYNAME_R@ +_GL_FUNCDECL_SYS (ttyname_r, int, + (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (ttyname_r, int, + (int fd, char *buf, size_t buflen)); +# endif +_GL_CXXALIASWARN (ttyname_r); +#elif defined GNULIB_POSIXCHECK +# undef ttyname_r +# if HAVE_RAW_DECL_TTYNAME_R +_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - " + "use gnulib module ttyname_r for portability"); +# endif +#endif + + +#if @GNULIB_UNLINK@ +# if @REPLACE_UNLINK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink rpl_unlink +# endif +_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (unlink, int, (char const *file)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink _unlink +# endif +_GL_CXXALIAS_MDA (unlink, int, (char const *file)); +# else +_GL_CXXALIAS_SYS (unlink, int, (char const *file)); +# endif +_GL_CXXALIASWARN (unlink); +#elif defined GNULIB_POSIXCHECK +# undef unlink +# if HAVE_RAW_DECL_UNLINK +_GL_WARN_ON_USE (unlink, "unlink is not portable - " + "use gnulib module unlink for portability"); +# endif +#elif @GNULIB_MDA_UNLINK@ +/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::unlink always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink _unlink +# endif +_GL_CXXALIAS_MDA (unlink, int, (char const *file)); +# else +_GL_CXXALIAS_SYS (unlink, int, (char const *file)); +# endif +_GL_CXXALIASWARN (unlink); +#endif + + +#if @GNULIB_UNLINKAT@ +# if @REPLACE_UNLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlinkat +# define unlinkat rpl_unlinkat +# endif +_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag)); +# else +# if !@HAVE_UNLINKAT@ +_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag)); +# endif +_GL_CXXALIASWARN (unlinkat); +#elif defined GNULIB_POSIXCHECK +# undef unlinkat +# if HAVE_RAW_DECL_UNLINKAT +_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " + "use gnulib module unlinkat for portability"); +# endif +#endif + + +#if @GNULIB_USLEEP@ +/* Pause the execution of the current thread for N microseconds. + Returns 0 on completion, or -1 on range error. + See the POSIX:2001 specification + <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */ +# if @REPLACE_USLEEP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef usleep +# define usleep rpl_usleep +# endif +_GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); +_GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); +# else +# if !@HAVE_USLEEP@ +_GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); +# endif +/* Need to cast, because on Haiku, the first parameter is + unsigned int n. */ +_GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n)); +# endif +_GL_CXXALIASWARN (usleep); +#elif defined GNULIB_POSIXCHECK +# undef usleep +# if HAVE_RAW_DECL_USLEEP +_GL_WARN_ON_USE (usleep, "usleep is unportable - " + "use gnulib module usleep for portability"); +# endif +#endif + + +#if @GNULIB_WRITE@ +/* Write up to COUNT bytes starting at BUF to file descriptor FD. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */ +# if @REPLACE_WRITE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write rpl_write +# endif +_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write _write +# endif +_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); +# else +_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (write); +#elif @GNULIB_MDA_WRITE@ +/* On native Windows, map 'write' to '_write', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::write always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write _write +# endif +# ifdef __MINGW32__ +_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count)); +# else +_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count)); +# endif +# else +_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (write); +#endif + +_GL_INLINE_HEADER_END + +#endif /* _@GUARD_PREFIX@_UNISTD_H */ +#endif /* _GL_INCLUDING_UNISTD_H */ +#endif /* _@GUARD_PREFIX@_UNISTD_H */ diff --git a/lib/gl/warn-on-use.h b/lib/gl/warn-on-use.h index 7bd331f..94f5b92 100644 --- a/lib/gl/warn-on-use.h +++ b/lib/gl/warn-on-use.h @@ -1,9 +1,9 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2019 Free Software Foundation, Inc. + Copyright (C) 2010-2022 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.1 of the License, or + 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, @@ -84,13 +84,20 @@ # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) /* A compiler attribute is available in gcc versions 4.3.0 and later. */ # define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function __attribute__ ((__warning__ (message))) +_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message))) # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ __attribute__ ((__warning__ (message))) +# elif __clang_major__ >= 4 +/* Another compiler attribute is available in clang. */ +# define _GL_WARN_ON_USE(function, message) \ +_GL_WARN_EXTERN_C __typeof__ (function) function \ + __attribute__ ((__diagnose_if__ (1, message, "warning"))) +# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ + __attribute__ ((__diagnose_if__ (1, message, "warning"))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ # define _GL_WARN_ON_USE(function, message) \ -extern __typeof__ (function) function +_GL_WARN_EXTERN_C __typeof__ (function) function # define _GL_WARN_ON_USE_ATTRIBUTE(message) # else /* Unsupported. */ # define _GL_WARN_ON_USE(function, message) \ @@ -99,24 +106,35 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use # endif #endif -/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") - is like _GL_WARN_ON_USE (function, "string"), except that the function is - declared with the given prototype, consisting of return type, parameters, - and attributes. +/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") + is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the + function is declared with the given prototype, consisting of return type, + parameters, and attributes. This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does not work in this case. */ #ifndef _GL_WARN_ON_USE_CXX -# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# if !defined __cplusplus +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ + _GL_WARN_ON_USE (function, msg) +# else +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_gcc function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __clang_major__ >= 4 +/* Another compiler attribute is available in clang. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_clang function parameters_and_attributes \ + __attribute__ ((__diagnose_if__ (1, msg, "warning"))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes -# else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_gcc function parameters_and_attributes +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ _GL_WARN_EXTERN_C int _gl_warn_on_use +# endif # endif #endif @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -40,7 +40,7 @@ _asn1_str_cat (char *dest, size_t dest_tot_size, const char *src) } else { - if (dest_tot_size - dest_size > 0) + if (dest_tot_size > dest_size) { strncat (dest, src, (dest_tot_size - dest_size) - 1); dest[dest_tot_size - 1] = 0; @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -19,24 +19,32 @@ * 02110-1301, USA */ +#ifndef GSTR_H +# define GSTR_H + unsigned int _asn1_str_cpy (char *dest, size_t dest_tot_size, const char *src); void _asn1_str_cat (char *dest, size_t dest_tot_size, const char *src); -#define Estrcpy(x,y) _asn1_str_cpy(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y) -#define Estrcat(x,y) _asn1_str_cat(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y) +# define Estrcpy(x,y) _asn1_str_cpy(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y) +# define Estrcat(x,y) _asn1_str_cat(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y) -inline static -void safe_memset(void *data, int c, size_t size) +inline static void +safe_memset (void *data, int c, size_t size) { - volatile unsigned volatile_zero = 0; - volatile char *vdata = (volatile char*)data; + volatile unsigned volatile_zero = 0; + volatile char *vdata = (volatile char *) data; - /* This is based on a nice trick for safe memset, - * sent by David Jacobson in the openssl-dev mailing list. - */ + /* This is based on a nice trick for safe memset, + * sent by David Jacobson in the openssl-dev mailing list. + */ - if (size > 0) do { - memset(data, c, size); - } while(vdata[volatile_zero] != c); + if (size > 0) + do + { + memset (data, c, size); + } + while (vdata[volatile_zero] != c); } + +#endif /* GSTR_H */ diff --git a/lib/includes/libtasn1.h b/lib/includes/libtasn1.h index ce4eb90..51cc787 100644 --- a/lib/includes/libtasn1.h +++ b/lib/includes/libtasn1.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -21,12 +21,8 @@ */ /** - * libtasn1:Short_Description: - * - * GNU ASN.1 library - */ -/** - * libtasn1:Long_Description: + * SECTION:libtasn1 + * @short_description: GNU ASN.1 library * * The Libtasn1 library provides Abstract Syntax Notation One (ASN.1, as * specified by the X.680 ITU-T recommendation) parsing and structures @@ -36,140 +32,148 @@ #ifndef LIBTASN1_H -#define LIBTASN1_H - -#ifndef ASN1_API -#if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY -#define ASN1_API __attribute__((__visibility__("default"))) -#elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC -#define ASN1_API __declspec(dllexport) -#elif defined _MSC_VER && ! defined ASN1_STATIC -#define ASN1_API __declspec(dllimport) -#else -#define ASN1_API -#endif -#endif - -#include <sys/types.h> -#include <time.h> -#include <stdio.h> /* for FILE* */ - -#ifdef __cplusplus +# define LIBTASN1_H + +# ifndef ASN1_API +# if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY +# define ASN1_API __attribute__((__visibility__("default"))) +# elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC +# define ASN1_API __declspec(dllexport) +# elif defined _MSC_VER && ! defined ASN1_STATIC +# define ASN1_API __declspec(dllimport) +# else +# define ASN1_API +# endif +# endif + +# ifdef __GNUC__ +# define __LIBTASN1_CONST__ __attribute__((const)) +# define __LIBTASN1_PURE__ __attribute__((pure)) +# else +# define __LIBTASN1_CONST__ +# define __LIBTASN1_PURE__ +# endif + +# include <sys/types.h> +# include <time.h> +# include <stdio.h> /* for FILE* */ + +# ifdef __cplusplus extern "C" { -#endif +# endif /** * ASN1_VERSION: * * Version of the library as a string. */ -#define ASN1_VERSION "4.14" +# define ASN1_VERSION "4.19.0" /** * ASN1_VERSION_MAJOR: * * Major version number of the library. */ -#define ASN1_VERSION_MAJOR 4 +# define ASN1_VERSION_MAJOR 4 /** * ASN1_VERSION_MINOR: * * Minor version number of the library. */ -#define ASN1_VERSION_MINOR 14 +# define ASN1_VERSION_MINOR 19 /** * ASN1_VERSION_PATCH: * * Patch version number of the library. */ -#define ASN1_VERSION_PATCH 0 +# define ASN1_VERSION_PATCH 0 /** * ASN1_VERSION_NUMBER: * * Version number of the library as a number. */ -#define ASN1_VERSION_NUMBER 0x040e00 +# define ASN1_VERSION_NUMBER 0x041300 -#if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD -# define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -# if _ASN1_GCC_VERSION >= 30100 -# define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +# if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD +# define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +# if _ASN1_GCC_VERSION >= 30100 +# define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +# endif # endif -#endif -#ifndef _ASN1_GCC_ATTR_DEPRECATED -#define _ASN1_GCC_ATTR_DEPRECATED -#endif +# ifndef _ASN1_GCC_ATTR_DEPRECATED +# define _ASN1_GCC_ATTR_DEPRECATED +# endif /*****************************************/ /* Errors returned by libtasn1 functions */ /*****************************************/ -#define ASN1_SUCCESS 0 -#define ASN1_FILE_NOT_FOUND 1 -#define ASN1_ELEMENT_NOT_FOUND 2 -#define ASN1_IDENTIFIER_NOT_FOUND 3 -#define ASN1_DER_ERROR 4 -#define ASN1_VALUE_NOT_FOUND 5 -#define ASN1_GENERIC_ERROR 6 -#define ASN1_VALUE_NOT_VALID 7 -#define ASN1_TAG_ERROR 8 -#define ASN1_TAG_IMPLICIT 9 -#define ASN1_ERROR_TYPE_ANY 10 -#define ASN1_SYNTAX_ERROR 11 -#define ASN1_MEM_ERROR 12 -#define ASN1_MEM_ALLOC_ERROR 13 -#define ASN1_DER_OVERFLOW 14 -#define ASN1_NAME_TOO_LONG 15 -#define ASN1_ARRAY_ERROR 16 -#define ASN1_ELEMENT_NOT_EMPTY 17 -#define ASN1_TIME_ENCODING_ERROR 18 -#define ASN1_RECURSION 19 +# define ASN1_SUCCESS 0 +# define ASN1_FILE_NOT_FOUND 1 +# define ASN1_ELEMENT_NOT_FOUND 2 +# define ASN1_IDENTIFIER_NOT_FOUND 3 +# define ASN1_DER_ERROR 4 +# define ASN1_VALUE_NOT_FOUND 5 +# define ASN1_GENERIC_ERROR 6 +# define ASN1_VALUE_NOT_VALID 7 +# define ASN1_TAG_ERROR 8 +# define ASN1_TAG_IMPLICIT 9 +# define ASN1_ERROR_TYPE_ANY 10 +# define ASN1_SYNTAX_ERROR 11 +# define ASN1_MEM_ERROR 12 +# define ASN1_MEM_ALLOC_ERROR 13 +# define ASN1_DER_OVERFLOW 14 +# define ASN1_NAME_TOO_LONG 15 +# define ASN1_ARRAY_ERROR 16 +# define ASN1_ELEMENT_NOT_EMPTY 17 +# define ASN1_TIME_ENCODING_ERROR 18 +# define ASN1_RECURSION 19 /*************************************/ /* Constants used in asn1_visit_tree */ /*************************************/ -#define ASN1_PRINT_NAME 1 -#define ASN1_PRINT_NAME_TYPE 2 -#define ASN1_PRINT_NAME_TYPE_VALUE 3 -#define ASN1_PRINT_ALL 4 +# define ASN1_PRINT_NAME 1 +# define ASN1_PRINT_NAME_TYPE 2 +# define ASN1_PRINT_NAME_TYPE_VALUE 3 +# define ASN1_PRINT_ALL 4 /*****************************************/ /* Constants returned by asn1_read_tag */ /*****************************************/ -#define ASN1_CLASS_UNIVERSAL 0x00 /* old: 1 */ -#define ASN1_CLASS_APPLICATION 0x40 /* old: 2 */ -#define ASN1_CLASS_CONTEXT_SPECIFIC 0x80 /* old: 3 */ -#define ASN1_CLASS_PRIVATE 0xC0 /* old: 4 */ -#define ASN1_CLASS_STRUCTURED 0x20 +# define ASN1_CLASS_UNIVERSAL 0x00 /* old: 1 */ +# define ASN1_CLASS_APPLICATION 0x40 /* old: 2 */ +# define ASN1_CLASS_CONTEXT_SPECIFIC 0x80 /* old: 3 */ +# define ASN1_CLASS_PRIVATE 0xC0 /* old: 4 */ +# define ASN1_CLASS_STRUCTURED 0x20 /*****************************************/ /* Constants returned by asn1_read_tag */ /*****************************************/ -#define ASN1_TAG_BOOLEAN 0x01 -#define ASN1_TAG_INTEGER 0x02 -#define ASN1_TAG_SEQUENCE 0x10 -#define ASN1_TAG_SET 0x11 -#define ASN1_TAG_OCTET_STRING 0x04 -#define ASN1_TAG_BIT_STRING 0x03 -#define ASN1_TAG_UTCTime 0x17 -#define ASN1_TAG_GENERALIZEDTime 0x18 -#define ASN1_TAG_OBJECT_ID 0x06 -#define ASN1_TAG_ENUMERATED 0x0A -#define ASN1_TAG_NULL 0x05 -#define ASN1_TAG_GENERALSTRING 0x1B -#define ASN1_TAG_NUMERIC_STRING 0x12 -#define ASN1_TAG_IA5_STRING 0x16 -#define ASN1_TAG_TELETEX_STRING 0x14 -#define ASN1_TAG_PRINTABLE_STRING 0x13 -#define ASN1_TAG_UNIVERSAL_STRING 0x1C -#define ASN1_TAG_BMP_STRING 0x1E -#define ASN1_TAG_UTF8_STRING 0x0C -#define ASN1_TAG_VISIBLE_STRING 0x1A +# define ASN1_TAG_BOOLEAN 0x01 +# define ASN1_TAG_INTEGER 0x02 +# define ASN1_TAG_SEQUENCE 0x10 +# define ASN1_TAG_SET 0x11 +# define ASN1_TAG_OCTET_STRING 0x04 +# define ASN1_TAG_BIT_STRING 0x03 +# define ASN1_TAG_UTCTime 0x17 +# define ASN1_TAG_GENERALIZEDTime 0x18 +# define ASN1_TAG_OBJECT_ID 0x06 +# define ASN1_TAG_ENUMERATED 0x0A +# define ASN1_TAG_NULL 0x05 +# define ASN1_TAG_GENERALSTRING 0x1B +# define ASN1_TAG_NUMERIC_STRING 0x12 +# define ASN1_TAG_IA5_STRING 0x16 +# define ASN1_TAG_TELETEX_STRING 0x14 +# define ASN1_TAG_PRINTABLE_STRING 0x13 +# define ASN1_TAG_UNIVERSAL_STRING 0x1C +# define ASN1_TAG_BMP_STRING 0x1E +# define ASN1_TAG_UTF8_STRING 0x0C +# define ASN1_TAG_VISIBLE_STRING 0x1A /** * asn1_node: @@ -177,10 +181,10 @@ extern "C" * Structure definition used for the node of the tree * that represents an ASN.1 DEFINITION. */ -typedef struct asn1_node_st asn1_node_st; + typedef struct asn1_node_st asn1_node_st; -typedef asn1_node_st *asn1_node; -typedef const asn1_node_st *asn1_node_const; + typedef asn1_node_st *asn1_node; + typedef const asn1_node_st *asn1_node_const; /** * ASN1_MAX_NAME_SIZE: @@ -188,7 +192,7 @@ typedef const asn1_node_st *asn1_node_const; * Maximum number of characters of a name * inside a file with ASN1 definitions. */ -#define ASN1_MAX_NAME_SIZE 64 +# define ASN1_MAX_NAME_SIZE 64 /** @@ -199,47 +203,46 @@ typedef const asn1_node_st *asn1_node_const; * * For the on-disk format of ASN.1 trees, created by asn1_parser2array(). */ -struct asn1_static_node_st -{ - const char *name; /* Node name */ - unsigned int type; /* Node type */ - const void *value; /* Node value */ -}; -typedef struct asn1_static_node_st asn1_static_node; - -/* List of constants for field type of node_asn */ -#define ASN1_ETYPE_INVALID 0 -#define ASN1_ETYPE_CONSTANT 1 -#define ASN1_ETYPE_IDENTIFIER 2 -#define ASN1_ETYPE_INTEGER 3 -#define ASN1_ETYPE_BOOLEAN 4 -#define ASN1_ETYPE_SEQUENCE 5 -#define ASN1_ETYPE_BIT_STRING 6 -#define ASN1_ETYPE_OCTET_STRING 7 -#define ASN1_ETYPE_TAG 8 -#define ASN1_ETYPE_DEFAULT 9 -#define ASN1_ETYPE_SIZE 10 -#define ASN1_ETYPE_SEQUENCE_OF 11 -#define ASN1_ETYPE_OBJECT_ID 12 -#define ASN1_ETYPE_ANY 13 -#define ASN1_ETYPE_SET 14 -#define ASN1_ETYPE_SET_OF 15 -#define ASN1_ETYPE_DEFINITIONS 16 -#define ASN1_ETYPE_CHOICE 18 -#define ASN1_ETYPE_IMPORTS 19 -#define ASN1_ETYPE_NULL 20 -#define ASN1_ETYPE_ENUMERATED 21 -#define ASN1_ETYPE_GENERALSTRING 27 -#define ASN1_ETYPE_NUMERIC_STRING 28 -#define ASN1_ETYPE_IA5_STRING 29 -#define ASN1_ETYPE_TELETEX_STRING 30 -#define ASN1_ETYPE_PRINTABLE_STRING 31 -#define ASN1_ETYPE_UNIVERSAL_STRING 32 -#define ASN1_ETYPE_BMP_STRING 33 -#define ASN1_ETYPE_UTF8_STRING 34 -#define ASN1_ETYPE_VISIBLE_STRING 35 -#define ASN1_ETYPE_UTC_TIME 36 -#define ASN1_ETYPE_GENERALIZED_TIME 37 + typedef struct asn1_static_node_st + { + const char *name; /* Node name */ + unsigned int type; /* Node type */ + const void *value; /* Node value */ + } asn1_static_node; + +/* List of constants for field type of asn1_static_node */ +# define ASN1_ETYPE_INVALID 0 +# define ASN1_ETYPE_CONSTANT 1 +# define ASN1_ETYPE_IDENTIFIER 2 +# define ASN1_ETYPE_INTEGER 3 +# define ASN1_ETYPE_BOOLEAN 4 +# define ASN1_ETYPE_SEQUENCE 5 +# define ASN1_ETYPE_BIT_STRING 6 +# define ASN1_ETYPE_OCTET_STRING 7 +# define ASN1_ETYPE_TAG 8 +# define ASN1_ETYPE_DEFAULT 9 +# define ASN1_ETYPE_SIZE 10 +# define ASN1_ETYPE_SEQUENCE_OF 11 +# define ASN1_ETYPE_OBJECT_ID 12 +# define ASN1_ETYPE_ANY 13 +# define ASN1_ETYPE_SET 14 +# define ASN1_ETYPE_SET_OF 15 +# define ASN1_ETYPE_DEFINITIONS 16 +# define ASN1_ETYPE_CHOICE 18 +# define ASN1_ETYPE_IMPORTS 19 +# define ASN1_ETYPE_NULL 20 +# define ASN1_ETYPE_ENUMERATED 21 +# define ASN1_ETYPE_GENERALSTRING 27 +# define ASN1_ETYPE_NUMERIC_STRING 28 +# define ASN1_ETYPE_IA5_STRING 29 +# define ASN1_ETYPE_TELETEX_STRING 30 +# define ASN1_ETYPE_PRINTABLE_STRING 31 +# define ASN1_ETYPE_UNIVERSAL_STRING 32 +# define ASN1_ETYPE_BMP_STRING 33 +# define ASN1_ETYPE_UTF8_STRING 34 +# define ASN1_ETYPE_VISIBLE_STRING 35 +# define ASN1_ETYPE_UTC_TIME 36 +# define ASN1_ETYPE_GENERALIZED_TIME 37 /** * ASN1_DELETE_FLAG_ZEROIZE: @@ -248,7 +251,7 @@ typedef struct asn1_static_node_st asn1_static_node; * * Zeroize values prior to deinitialization. */ -#define ASN1_DELETE_FLAG_ZEROIZE 1 +# define ASN1_DELETE_FLAG_ZEROIZE 1 /** * ASN1_DECODE_FLAG_ALLOW_PADDING: @@ -257,7 +260,7 @@ typedef struct asn1_static_node_st asn1_static_node; * * This flag would allow arbitrary data past the DER data. */ -#define ASN1_DECODE_FLAG_ALLOW_PADDING 1 +# define ASN1_DECODE_FLAG_ALLOW_PADDING 1 /** * ASN1_DECODE_FLAG_STRICT_DER: * @@ -265,7 +268,7 @@ typedef struct asn1_static_node_st asn1_static_node; * * This flag would ensure that no BER decoding takes place. */ -#define ASN1_DECODE_FLAG_STRICT_DER (1<<1) +# define ASN1_DECODE_FLAG_STRICT_DER (1<<1) /** * ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME: * @@ -273,8 +276,9 @@ typedef struct asn1_static_node_st asn1_static_node; * * This flag will tolerate Time encoding errors when in strict DER. */ -#define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2) +# define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2) + /* *INDENT-OFF* */ /** * asn1_data_node_st: @@ -285,14 +289,17 @@ typedef struct asn1_static_node_st asn1_static_node; * * Data node inside a #asn1_node structure. */ -struct asn1_data_node_st -{ - const char *name; /* Node name */ - const void *value; /* Node value */ - unsigned int value_len; /* Node value size */ - unsigned int type; /* Node value type (ASN1_ETYPE_*) */ + struct asn1_data_node_st + { + const char *name; /* Node name */ + const void *value; /* Node value */ + unsigned int value_len; /* Node value size */ + unsigned int type; /* Node value type (ASN1_ETYPE_*) */ }; -typedef struct asn1_data_node_st asn1_data_node_st; + + /* *INDENT-ON* */ + + typedef struct asn1_data_node_st asn1_data_node_st; /***********************************/ /* Fixed constants */ @@ -305,175 +312,183 @@ typedef struct asn1_data_node_st asn1_data_node_st; * of a description message * (null character included). */ -#define ASN1_MAX_ERROR_DESCRIPTION_SIZE 128 +# define ASN1_MAX_ERROR_DESCRIPTION_SIZE 128 /***********************************/ /* Functions definitions */ /***********************************/ -extern ASN1_API int - asn1_parser2tree (const char *file, + extern ASN1_API int + asn1_parser2tree (const char *file, asn1_node * definitions, char *error_desc); -extern ASN1_API int - asn1_parser2array (const char *inputFileName, + extern ASN1_API int + asn1_parser2array (const char *inputFileName, const char *outputFileName, const char *vectorName, char *error_desc); -extern ASN1_API int - asn1_array2tree (const asn1_static_node * array, + extern ASN1_API int + asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, char *errorDescription); -extern ASN1_API void - asn1_print_structure (FILE * out, asn1_node_const structure, + extern ASN1_API void + asn1_print_structure (FILE * out, asn1_node_const structure, const char *name, int mode); -extern ASN1_API int - asn1_create_element (asn1_node_const definitions, + extern ASN1_API int + asn1_create_element (asn1_node_const definitions, const char *source_name, asn1_node * element); -extern ASN1_API int asn1_delete_structure (asn1_node * structure); + extern ASN1_API int asn1_delete_structure (asn1_node * structure); -extern ASN1_API int asn1_delete_structure2 (asn1_node * structure, unsigned int flags); + extern ASN1_API int asn1_delete_structure2 (asn1_node * structure, + unsigned int flags); -extern ASN1_API int - asn1_delete_element (asn1_node structure, const char *element_name); + extern ASN1_API int + asn1_delete_element (asn1_node structure, const char *element_name); -extern ASN1_API int - asn1_write_value (asn1_node node_root, const char *name, + extern ASN1_API int + asn1_write_value (asn1_node node_root, const char *name, const void *ivalue, int len); -extern ASN1_API int - asn1_read_value (asn1_node_const root, const char *name, + extern ASN1_API int + asn1_read_value (asn1_node_const root, const char *name, void *ivalue, int *len); -extern ASN1_API int - asn1_read_value_type (asn1_node_const root, const char *name, + extern ASN1_API int + asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, int *len, unsigned int *etype); -extern ASN1_API int - asn1_read_node_value (asn1_node_const node, asn1_data_node_st * data); + extern ASN1_API int + asn1_read_node_value (asn1_node_const node, asn1_data_node_st * data); -extern ASN1_API int - asn1_number_of_elements (asn1_node_const element, const char *name, int *num); + extern ASN1_API int + asn1_number_of_elements (asn1_node_const element, const char *name, + int *num); -extern ASN1_API int - asn1_der_coding (asn1_node_const element, const char *name, + extern ASN1_API int + asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len, char *ErrorDescription); -extern ASN1_API int - asn1_der_decoding2 (asn1_node *element, const void *ider, + extern ASN1_API int + asn1_der_decoding2 (asn1_node * element, const void *ider, int *max_ider_len, unsigned int flags, char *errorDescription); -extern ASN1_API int - asn1_der_decoding (asn1_node * element, const void *ider, + extern ASN1_API int + asn1_der_decoding (asn1_node * element, const void *ider, int ider_len, char *errorDescription); /* Do not use. Use asn1_der_decoding() instead. */ -extern ASN1_API int - asn1_der_decoding_element (asn1_node * structure, + extern ASN1_API int + asn1_der_decoding_element (asn1_node * structure, const char *elementName, const void *ider, int len, - char *errorDescription) _ASN1_GCC_ATTR_DEPRECATED; + char *errorDescription) + _ASN1_GCC_ATTR_DEPRECATED; -extern ASN1_API int - asn1_der_decoding_startEnd (asn1_node element, + extern ASN1_API int + asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len, const char *name_element, int *start, int *end); -extern ASN1_API int - asn1_expand_any_defined_by (asn1_node_const definitions, asn1_node * element); + extern ASN1_API int + asn1_expand_any_defined_by (asn1_node_const definitions, + asn1_node * element); -extern ASN1_API int - asn1_expand_octet_string (asn1_node_const definitions, + extern ASN1_API int + asn1_expand_octet_string (asn1_node_const definitions, asn1_node * element, const char *octetName, const char *objectName); -extern ASN1_API int - asn1_read_tag (asn1_node_const root, const char *name, + extern ASN1_API int + asn1_read_tag (asn1_node_const root, const char *name, int *tagValue, int *classValue); -extern ASN1_API const char *asn1_find_structure_from_oid (asn1_node_const + extern ASN1_API const char *asn1_find_structure_from_oid (asn1_node_const definitions, const char *oidValue); -extern ASN1_API const char *asn1_check_version (const char *req_version); + __LIBTASN1_PURE__ + extern ASN1_API const char *asn1_check_version (const char *req_version); -extern ASN1_API const char *asn1_strerror (int error); + __LIBTASN1_PURE__ extern ASN1_API const char *asn1_strerror (int error); -extern ASN1_API void asn1_perror (int error); + extern ASN1_API void asn1_perror (int error); -#define ASN1_MAX_TAG_SIZE 4 -#define ASN1_MAX_LENGTH_SIZE 9 -#define ASN1_MAX_TL_SIZE (ASN1_MAX_TAG_SIZE+ASN1_MAX_LENGTH_SIZE) -extern ASN1_API long - asn1_get_length_der (const unsigned char *der, int der_len, int *len); +# define ASN1_MAX_TAG_SIZE 4 +# define ASN1_MAX_LENGTH_SIZE 9 +# define ASN1_MAX_TL_SIZE (ASN1_MAX_TAG_SIZE+ASN1_MAX_LENGTH_SIZE) + extern ASN1_API long + asn1_get_length_der (const unsigned char *der, int der_len, int *len); -extern ASN1_API long - asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len); + extern ASN1_API long + asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len); -extern ASN1_API void - asn1_length_der (unsigned long int len, unsigned char *der, int *der_len); + extern ASN1_API void + asn1_length_der (unsigned long int len, unsigned char *der, int *der_len); /* Other utility functions. */ -extern ASN1_API - int asn1_decode_simple_der (unsigned int etype, const unsigned char *der, + extern ASN1_API + int asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned int _der_len, const unsigned char **str, unsigned int *str_len); -extern ASN1_API - int asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, + extern ASN1_API + int asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, unsigned int _der_len, unsigned char **str, - unsigned int *str_len, - unsigned int *ber_len); + unsigned int *str_len, unsigned int *ber_len); -extern ASN1_API int - asn1_encode_simple_der (unsigned int etype, const unsigned char *str, + extern ASN1_API int + asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned int str_len, unsigned char *tl, unsigned int *tl_len); -extern ASN1_API asn1_node - asn1_find_node (asn1_node_const pointer, const char *name); + extern ASN1_API asn1_node + asn1_find_node (asn1_node_const pointer, const char *name); -extern ASN1_API int - asn1_copy_node (asn1_node dst, const char *dst_name, + extern ASN1_API int + asn1_copy_node (asn1_node dst, const char *dst_name, asn1_node_const src, const char *src_name); -extern ASN1_API asn1_node - asn1_dup_node (asn1_node_const src, const char *src_name); + extern ASN1_API asn1_node + asn1_dup_node (asn1_node_const src, const char *src_name); /* Internal and low-level DER utility functions. */ -extern ASN1_API int - asn1_get_tag_der (const unsigned char *der, int der_len, + extern ASN1_API int + asn1_get_tag_der (const unsigned char *der, int der_len, unsigned char *cls, int *len, unsigned long *tag); -extern ASN1_API void - asn1_octet_der (const unsigned char *str, int str_len, + extern ASN1_API void + asn1_octet_der (const unsigned char *str, int str_len, unsigned char *der, int *der_len); -extern ASN1_API int - asn1_get_octet_der (const unsigned char *der, int der_len, + extern ASN1_API int + asn1_get_octet_der (const unsigned char *der, int der_len, int *ret_len, unsigned char *str, int str_size, int *str_len); -extern ASN1_API void asn1_bit_der (const unsigned char *str, int bit_len, + extern ASN1_API void asn1_bit_der (const unsigned char *str, int bit_len, unsigned char *der, int *der_len); -extern ASN1_API int - asn1_get_bit_der (const unsigned char *der, int der_len, + extern ASN1_API int + asn1_get_bit_der (const unsigned char *der, int der_len, int *ret_len, unsigned char *str, int str_size, int *bit_len); -extern ASN1_API int - asn1_get_object_id_der (const unsigned char *der, - int der_len, int *ret_len, - char *str, int str_size); + extern ASN1_API int + asn1_get_object_id_der (const unsigned char *der, + int der_len, int *ret_len, + char *str, int str_size); + + extern ASN1_API int + asn1_object_id_der (const char *str, unsigned char *der, int *der_len, + unsigned flags); /* Compatibility types */ @@ -484,7 +499,7 @@ extern ASN1_API int * * Deprecated: 3.0: Use int instead. */ -typedef int asn1_retCode; + typedef int asn1_retCode _ASN1_GCC_ATTR_DEPRECATED; /** * node_asn_struct: @@ -493,7 +508,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_node instead. */ -#define node_asn_struct asn1_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define node_asn_struct _Pragma ("GCC warning \"'node_asn_struct' macro is deprecated, use 'asn1_node' instead.\"") asn1_node_st +# else +# define node_asn_struct asn1_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * node_asn: @@ -502,7 +523,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_node instead. */ -#define node_asn asn1_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define node_asn _Pragma ("GCC warning \"'node_asn' macro is deprecated, use 'asn1_node' instead.\"") asn1_node_st +# else +# define node_asn asn1_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_TYPE: @@ -511,7 +538,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_node instead. */ -#define ASN1_TYPE asn1_node +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_TYPE _Pragma ("GCC warning \"'ASN1_TYPE' macro is deprecated, use 'asn1_node' instead.\"") asn1_node +# else +# define ASN1_TYPE asn1_node +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_TYPE_EMPTY: @@ -520,7 +553,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use NULL instead. */ -#define ASN1_TYPE_EMPTY NULL +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_TYPE_EMPTY _Pragma ("GCC warning \"'ASN1_TYPE_EMPTY' macro is deprecated, use 'NULL' instead.\"") NULL +# else +# define ASN1_TYPE_EMPTY NULL +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * static_struct_asn: @@ -529,7 +568,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_static_node instead. */ -#define static_struct_asn asn1_static_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define static_struct_asn _Pragma ("GCC warning \"'static_struct_asn' macro is deprecated, use 'asn1_static_node_st' instead.\"") asn1_static_node_st +# else +# define static_struct_asn asn1_static_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_ARRAY_TYPE: @@ -538,7 +583,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_static_node instead. */ -#define ASN1_ARRAY_TYPE asn1_static_node +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_ARRAY_TYPE _Pragma ("GCC warning \"'ASN1_ARRAY_TYPE' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_static_node +# else +# define ASN1_ARRAY_TYPE asn1_static_node +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * asn1_static_node_t: @@ -547,7 +598,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_static_node instead. */ -#define asn1_static_node_t asn1_static_node +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define asn1_static_node_t _Pragma ("GCC warning \"'asn1_static_node_t' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_static_node +# else +# define asn1_static_node_t asn1_static_node +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * node_data_struct: @@ -556,7 +613,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_data_node_st instead. */ -#define node_data_struct asn1_data_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define node_data_struct _Pragma ("GCC warning \"'node_data_struct' macro is deprecated, use 'asn1_data_node_st' instead.\"") asn1_data_node_st +# else +# define node_data_struct asn1_data_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_DATA_NODE: @@ -565,10 +628,16 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_data_node_st instead. */ -#define ASN1_DATA_NODE asn1_data_node_st - -#ifdef __cplusplus +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_DATA_NODE _Pragma ("GCC warning \"'asn1_static_node_t' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_data_node_st +# else +# define ASN1_DATA_NODE asn1_data_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ + +# ifdef __cplusplus } -#endif +# endif #endif /* LIBTASN1_H */ diff --git a/lib/includes/libtasn1.h.in b/lib/includes/libtasn1.h.in index 6fb11ca..b5703ab 100644 --- a/lib/includes/libtasn1.h.in +++ b/lib/includes/libtasn1.h.in @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -21,12 +21,8 @@ */ /** - * libtasn1:Short_Description: - * - * GNU ASN.1 library - */ -/** - * libtasn1:Long_Description: + * SECTION:libtasn1 + * @short_description: GNU ASN.1 library * * The Libtasn1 library provides Abstract Syntax Notation One (ASN.1, as * specified by the X.680 ITU-T recommendation) parsing and structures @@ -36,140 +32,148 @@ #ifndef LIBTASN1_H -#define LIBTASN1_H - -#ifndef ASN1_API -#if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY -#define ASN1_API __attribute__((__visibility__("default"))) -#elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC -#define ASN1_API __declspec(dllexport) -#elif defined _MSC_VER && ! defined ASN1_STATIC -#define ASN1_API __declspec(dllimport) -#else -#define ASN1_API -#endif -#endif - -#include <sys/types.h> -#include <time.h> -#include <stdio.h> /* for FILE* */ - -#ifdef __cplusplus +# define LIBTASN1_H + +# ifndef ASN1_API +# if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY +# define ASN1_API __attribute__((__visibility__("default"))) +# elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC +# define ASN1_API __declspec(dllexport) +# elif defined _MSC_VER && ! defined ASN1_STATIC +# define ASN1_API __declspec(dllimport) +# else +# define ASN1_API +# endif +# endif + +# ifdef __GNUC__ +# define __LIBTASN1_CONST__ __attribute__((const)) +# define __LIBTASN1_PURE__ __attribute__((pure)) +# else +# define __LIBTASN1_CONST__ +# define __LIBTASN1_PURE__ +# endif + +# include <sys/types.h> +# include <time.h> +# include <stdio.h> /* for FILE* */ + +# ifdef __cplusplus extern "C" { -#endif +# endif /** * ASN1_VERSION: * * Version of the library as a string. */ -#define ASN1_VERSION "@VERSION@" +# define ASN1_VERSION "@VERSION@" /** * ASN1_VERSION_MAJOR: * * Major version number of the library. */ -#define ASN1_VERSION_MAJOR @ASN1_VERSION_MAJOR@ +# define ASN1_VERSION_MAJOR @MAJOR_VERSION@ /** * ASN1_VERSION_MINOR: * * Minor version number of the library. */ -#define ASN1_VERSION_MINOR @ASN1_VERSION_MINOR@ +# define ASN1_VERSION_MINOR @MINOR_VERSION@ /** * ASN1_VERSION_PATCH: * * Patch version number of the library. */ -#define ASN1_VERSION_PATCH @ASN1_VERSION_PATCH@ +# define ASN1_VERSION_PATCH @PATCH_VERSION@ /** * ASN1_VERSION_NUMBER: * * Version number of the library as a number. */ -#define ASN1_VERSION_NUMBER @ASN1_VERSION_NUMBER@ +# define ASN1_VERSION_NUMBER @NUMBER_VERSION@ -#if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD -# define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -# if _ASN1_GCC_VERSION >= 30100 -# define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +# if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD +# define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +# if _ASN1_GCC_VERSION >= 30100 +# define _ASN1_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +# endif # endif -#endif -#ifndef _ASN1_GCC_ATTR_DEPRECATED -#define _ASN1_GCC_ATTR_DEPRECATED -#endif +# ifndef _ASN1_GCC_ATTR_DEPRECATED +# define _ASN1_GCC_ATTR_DEPRECATED +# endif /*****************************************/ /* Errors returned by libtasn1 functions */ /*****************************************/ -#define ASN1_SUCCESS 0 -#define ASN1_FILE_NOT_FOUND 1 -#define ASN1_ELEMENT_NOT_FOUND 2 -#define ASN1_IDENTIFIER_NOT_FOUND 3 -#define ASN1_DER_ERROR 4 -#define ASN1_VALUE_NOT_FOUND 5 -#define ASN1_GENERIC_ERROR 6 -#define ASN1_VALUE_NOT_VALID 7 -#define ASN1_TAG_ERROR 8 -#define ASN1_TAG_IMPLICIT 9 -#define ASN1_ERROR_TYPE_ANY 10 -#define ASN1_SYNTAX_ERROR 11 -#define ASN1_MEM_ERROR 12 -#define ASN1_MEM_ALLOC_ERROR 13 -#define ASN1_DER_OVERFLOW 14 -#define ASN1_NAME_TOO_LONG 15 -#define ASN1_ARRAY_ERROR 16 -#define ASN1_ELEMENT_NOT_EMPTY 17 -#define ASN1_TIME_ENCODING_ERROR 18 -#define ASN1_RECURSION 19 +# define ASN1_SUCCESS 0 +# define ASN1_FILE_NOT_FOUND 1 +# define ASN1_ELEMENT_NOT_FOUND 2 +# define ASN1_IDENTIFIER_NOT_FOUND 3 +# define ASN1_DER_ERROR 4 +# define ASN1_VALUE_NOT_FOUND 5 +# define ASN1_GENERIC_ERROR 6 +# define ASN1_VALUE_NOT_VALID 7 +# define ASN1_TAG_ERROR 8 +# define ASN1_TAG_IMPLICIT 9 +# define ASN1_ERROR_TYPE_ANY 10 +# define ASN1_SYNTAX_ERROR 11 +# define ASN1_MEM_ERROR 12 +# define ASN1_MEM_ALLOC_ERROR 13 +# define ASN1_DER_OVERFLOW 14 +# define ASN1_NAME_TOO_LONG 15 +# define ASN1_ARRAY_ERROR 16 +# define ASN1_ELEMENT_NOT_EMPTY 17 +# define ASN1_TIME_ENCODING_ERROR 18 +# define ASN1_RECURSION 19 /*************************************/ /* Constants used in asn1_visit_tree */ /*************************************/ -#define ASN1_PRINT_NAME 1 -#define ASN1_PRINT_NAME_TYPE 2 -#define ASN1_PRINT_NAME_TYPE_VALUE 3 -#define ASN1_PRINT_ALL 4 +# define ASN1_PRINT_NAME 1 +# define ASN1_PRINT_NAME_TYPE 2 +# define ASN1_PRINT_NAME_TYPE_VALUE 3 +# define ASN1_PRINT_ALL 4 /*****************************************/ /* Constants returned by asn1_read_tag */ /*****************************************/ -#define ASN1_CLASS_UNIVERSAL 0x00 /* old: 1 */ -#define ASN1_CLASS_APPLICATION 0x40 /* old: 2 */ -#define ASN1_CLASS_CONTEXT_SPECIFIC 0x80 /* old: 3 */ -#define ASN1_CLASS_PRIVATE 0xC0 /* old: 4 */ -#define ASN1_CLASS_STRUCTURED 0x20 +# define ASN1_CLASS_UNIVERSAL 0x00 /* old: 1 */ +# define ASN1_CLASS_APPLICATION 0x40 /* old: 2 */ +# define ASN1_CLASS_CONTEXT_SPECIFIC 0x80 /* old: 3 */ +# define ASN1_CLASS_PRIVATE 0xC0 /* old: 4 */ +# define ASN1_CLASS_STRUCTURED 0x20 /*****************************************/ /* Constants returned by asn1_read_tag */ /*****************************************/ -#define ASN1_TAG_BOOLEAN 0x01 -#define ASN1_TAG_INTEGER 0x02 -#define ASN1_TAG_SEQUENCE 0x10 -#define ASN1_TAG_SET 0x11 -#define ASN1_TAG_OCTET_STRING 0x04 -#define ASN1_TAG_BIT_STRING 0x03 -#define ASN1_TAG_UTCTime 0x17 -#define ASN1_TAG_GENERALIZEDTime 0x18 -#define ASN1_TAG_OBJECT_ID 0x06 -#define ASN1_TAG_ENUMERATED 0x0A -#define ASN1_TAG_NULL 0x05 -#define ASN1_TAG_GENERALSTRING 0x1B -#define ASN1_TAG_NUMERIC_STRING 0x12 -#define ASN1_TAG_IA5_STRING 0x16 -#define ASN1_TAG_TELETEX_STRING 0x14 -#define ASN1_TAG_PRINTABLE_STRING 0x13 -#define ASN1_TAG_UNIVERSAL_STRING 0x1C -#define ASN1_TAG_BMP_STRING 0x1E -#define ASN1_TAG_UTF8_STRING 0x0C -#define ASN1_TAG_VISIBLE_STRING 0x1A +# define ASN1_TAG_BOOLEAN 0x01 +# define ASN1_TAG_INTEGER 0x02 +# define ASN1_TAG_SEQUENCE 0x10 +# define ASN1_TAG_SET 0x11 +# define ASN1_TAG_OCTET_STRING 0x04 +# define ASN1_TAG_BIT_STRING 0x03 +# define ASN1_TAG_UTCTime 0x17 +# define ASN1_TAG_GENERALIZEDTime 0x18 +# define ASN1_TAG_OBJECT_ID 0x06 +# define ASN1_TAG_ENUMERATED 0x0A +# define ASN1_TAG_NULL 0x05 +# define ASN1_TAG_GENERALSTRING 0x1B +# define ASN1_TAG_NUMERIC_STRING 0x12 +# define ASN1_TAG_IA5_STRING 0x16 +# define ASN1_TAG_TELETEX_STRING 0x14 +# define ASN1_TAG_PRINTABLE_STRING 0x13 +# define ASN1_TAG_UNIVERSAL_STRING 0x1C +# define ASN1_TAG_BMP_STRING 0x1E +# define ASN1_TAG_UTF8_STRING 0x0C +# define ASN1_TAG_VISIBLE_STRING 0x1A /** * asn1_node: @@ -177,10 +181,10 @@ extern "C" * Structure definition used for the node of the tree * that represents an ASN.1 DEFINITION. */ -typedef struct asn1_node_st asn1_node_st; + typedef struct asn1_node_st asn1_node_st; -typedef asn1_node_st *asn1_node; -typedef const asn1_node_st *asn1_node_const; + typedef asn1_node_st *asn1_node; + typedef const asn1_node_st *asn1_node_const; /** * ASN1_MAX_NAME_SIZE: @@ -188,7 +192,7 @@ typedef const asn1_node_st *asn1_node_const; * Maximum number of characters of a name * inside a file with ASN1 definitions. */ -#define ASN1_MAX_NAME_SIZE 64 +# define ASN1_MAX_NAME_SIZE 64 /** @@ -199,47 +203,46 @@ typedef const asn1_node_st *asn1_node_const; * * For the on-disk format of ASN.1 trees, created by asn1_parser2array(). */ -struct asn1_static_node_st -{ - const char *name; /* Node name */ - unsigned int type; /* Node type */ - const void *value; /* Node value */ -}; -typedef struct asn1_static_node_st asn1_static_node; - -/* List of constants for field type of node_asn */ -#define ASN1_ETYPE_INVALID 0 -#define ASN1_ETYPE_CONSTANT 1 -#define ASN1_ETYPE_IDENTIFIER 2 -#define ASN1_ETYPE_INTEGER 3 -#define ASN1_ETYPE_BOOLEAN 4 -#define ASN1_ETYPE_SEQUENCE 5 -#define ASN1_ETYPE_BIT_STRING 6 -#define ASN1_ETYPE_OCTET_STRING 7 -#define ASN1_ETYPE_TAG 8 -#define ASN1_ETYPE_DEFAULT 9 -#define ASN1_ETYPE_SIZE 10 -#define ASN1_ETYPE_SEQUENCE_OF 11 -#define ASN1_ETYPE_OBJECT_ID 12 -#define ASN1_ETYPE_ANY 13 -#define ASN1_ETYPE_SET 14 -#define ASN1_ETYPE_SET_OF 15 -#define ASN1_ETYPE_DEFINITIONS 16 -#define ASN1_ETYPE_CHOICE 18 -#define ASN1_ETYPE_IMPORTS 19 -#define ASN1_ETYPE_NULL 20 -#define ASN1_ETYPE_ENUMERATED 21 -#define ASN1_ETYPE_GENERALSTRING 27 -#define ASN1_ETYPE_NUMERIC_STRING 28 -#define ASN1_ETYPE_IA5_STRING 29 -#define ASN1_ETYPE_TELETEX_STRING 30 -#define ASN1_ETYPE_PRINTABLE_STRING 31 -#define ASN1_ETYPE_UNIVERSAL_STRING 32 -#define ASN1_ETYPE_BMP_STRING 33 -#define ASN1_ETYPE_UTF8_STRING 34 -#define ASN1_ETYPE_VISIBLE_STRING 35 -#define ASN1_ETYPE_UTC_TIME 36 -#define ASN1_ETYPE_GENERALIZED_TIME 37 + typedef struct asn1_static_node_st + { + const char *name; /* Node name */ + unsigned int type; /* Node type */ + const void *value; /* Node value */ + } asn1_static_node; + +/* List of constants for field type of asn1_static_node */ +# define ASN1_ETYPE_INVALID 0 +# define ASN1_ETYPE_CONSTANT 1 +# define ASN1_ETYPE_IDENTIFIER 2 +# define ASN1_ETYPE_INTEGER 3 +# define ASN1_ETYPE_BOOLEAN 4 +# define ASN1_ETYPE_SEQUENCE 5 +# define ASN1_ETYPE_BIT_STRING 6 +# define ASN1_ETYPE_OCTET_STRING 7 +# define ASN1_ETYPE_TAG 8 +# define ASN1_ETYPE_DEFAULT 9 +# define ASN1_ETYPE_SIZE 10 +# define ASN1_ETYPE_SEQUENCE_OF 11 +# define ASN1_ETYPE_OBJECT_ID 12 +# define ASN1_ETYPE_ANY 13 +# define ASN1_ETYPE_SET 14 +# define ASN1_ETYPE_SET_OF 15 +# define ASN1_ETYPE_DEFINITIONS 16 +# define ASN1_ETYPE_CHOICE 18 +# define ASN1_ETYPE_IMPORTS 19 +# define ASN1_ETYPE_NULL 20 +# define ASN1_ETYPE_ENUMERATED 21 +# define ASN1_ETYPE_GENERALSTRING 27 +# define ASN1_ETYPE_NUMERIC_STRING 28 +# define ASN1_ETYPE_IA5_STRING 29 +# define ASN1_ETYPE_TELETEX_STRING 30 +# define ASN1_ETYPE_PRINTABLE_STRING 31 +# define ASN1_ETYPE_UNIVERSAL_STRING 32 +# define ASN1_ETYPE_BMP_STRING 33 +# define ASN1_ETYPE_UTF8_STRING 34 +# define ASN1_ETYPE_VISIBLE_STRING 35 +# define ASN1_ETYPE_UTC_TIME 36 +# define ASN1_ETYPE_GENERALIZED_TIME 37 /** * ASN1_DELETE_FLAG_ZEROIZE: @@ -248,7 +251,7 @@ typedef struct asn1_static_node_st asn1_static_node; * * Zeroize values prior to deinitialization. */ -#define ASN1_DELETE_FLAG_ZEROIZE 1 +# define ASN1_DELETE_FLAG_ZEROIZE 1 /** * ASN1_DECODE_FLAG_ALLOW_PADDING: @@ -257,7 +260,7 @@ typedef struct asn1_static_node_st asn1_static_node; * * This flag would allow arbitrary data past the DER data. */ -#define ASN1_DECODE_FLAG_ALLOW_PADDING 1 +# define ASN1_DECODE_FLAG_ALLOW_PADDING 1 /** * ASN1_DECODE_FLAG_STRICT_DER: * @@ -265,7 +268,7 @@ typedef struct asn1_static_node_st asn1_static_node; * * This flag would ensure that no BER decoding takes place. */ -#define ASN1_DECODE_FLAG_STRICT_DER (1<<1) +# define ASN1_DECODE_FLAG_STRICT_DER (1<<1) /** * ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME: * @@ -273,8 +276,9 @@ typedef struct asn1_static_node_st asn1_static_node; * * This flag will tolerate Time encoding errors when in strict DER. */ -#define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2) +# define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2) + /* *INDENT-OFF* */ /** * asn1_data_node_st: @@ -285,14 +289,17 @@ typedef struct asn1_static_node_st asn1_static_node; * * Data node inside a #asn1_node structure. */ -struct asn1_data_node_st -{ - const char *name; /* Node name */ - const void *value; /* Node value */ - unsigned int value_len; /* Node value size */ - unsigned int type; /* Node value type (ASN1_ETYPE_*) */ + struct asn1_data_node_st + { + const char *name; /* Node name */ + const void *value; /* Node value */ + unsigned int value_len; /* Node value size */ + unsigned int type; /* Node value type (ASN1_ETYPE_*) */ }; -typedef struct asn1_data_node_st asn1_data_node_st; + + /* *INDENT-ON* */ + + typedef struct asn1_data_node_st asn1_data_node_st; /***********************************/ /* Fixed constants */ @@ -305,175 +312,183 @@ typedef struct asn1_data_node_st asn1_data_node_st; * of a description message * (null character included). */ -#define ASN1_MAX_ERROR_DESCRIPTION_SIZE 128 +# define ASN1_MAX_ERROR_DESCRIPTION_SIZE 128 /***********************************/ /* Functions definitions */ /***********************************/ -extern ASN1_API int - asn1_parser2tree (const char *file, + extern ASN1_API int + asn1_parser2tree (const char *file, asn1_node * definitions, char *error_desc); -extern ASN1_API int - asn1_parser2array (const char *inputFileName, + extern ASN1_API int + asn1_parser2array (const char *inputFileName, const char *outputFileName, const char *vectorName, char *error_desc); -extern ASN1_API int - asn1_array2tree (const asn1_static_node * array, + extern ASN1_API int + asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, char *errorDescription); -extern ASN1_API void - asn1_print_structure (FILE * out, asn1_node_const structure, + extern ASN1_API void + asn1_print_structure (FILE * out, asn1_node_const structure, const char *name, int mode); -extern ASN1_API int - asn1_create_element (asn1_node_const definitions, + extern ASN1_API int + asn1_create_element (asn1_node_const definitions, const char *source_name, asn1_node * element); -extern ASN1_API int asn1_delete_structure (asn1_node * structure); + extern ASN1_API int asn1_delete_structure (asn1_node * structure); -extern ASN1_API int asn1_delete_structure2 (asn1_node * structure, unsigned int flags); + extern ASN1_API int asn1_delete_structure2 (asn1_node * structure, + unsigned int flags); -extern ASN1_API int - asn1_delete_element (asn1_node structure, const char *element_name); + extern ASN1_API int + asn1_delete_element (asn1_node structure, const char *element_name); -extern ASN1_API int - asn1_write_value (asn1_node node_root, const char *name, + extern ASN1_API int + asn1_write_value (asn1_node node_root, const char *name, const void *ivalue, int len); -extern ASN1_API int - asn1_read_value (asn1_node_const root, const char *name, + extern ASN1_API int + asn1_read_value (asn1_node_const root, const char *name, void *ivalue, int *len); -extern ASN1_API int - asn1_read_value_type (asn1_node_const root, const char *name, + extern ASN1_API int + asn1_read_value_type (asn1_node_const root, const char *name, void *ivalue, int *len, unsigned int *etype); -extern ASN1_API int - asn1_read_node_value (asn1_node_const node, asn1_data_node_st * data); + extern ASN1_API int + asn1_read_node_value (asn1_node_const node, asn1_data_node_st * data); -extern ASN1_API int - asn1_number_of_elements (asn1_node_const element, const char *name, int *num); + extern ASN1_API int + asn1_number_of_elements (asn1_node_const element, const char *name, + int *num); -extern ASN1_API int - asn1_der_coding (asn1_node_const element, const char *name, + extern ASN1_API int + asn1_der_coding (asn1_node_const element, const char *name, void *ider, int *len, char *ErrorDescription); -extern ASN1_API int - asn1_der_decoding2 (asn1_node *element, const void *ider, + extern ASN1_API int + asn1_der_decoding2 (asn1_node * element, const void *ider, int *max_ider_len, unsigned int flags, char *errorDescription); -extern ASN1_API int - asn1_der_decoding (asn1_node * element, const void *ider, + extern ASN1_API int + asn1_der_decoding (asn1_node * element, const void *ider, int ider_len, char *errorDescription); /* Do not use. Use asn1_der_decoding() instead. */ -extern ASN1_API int - asn1_der_decoding_element (asn1_node * structure, + extern ASN1_API int + asn1_der_decoding_element (asn1_node * structure, const char *elementName, const void *ider, int len, - char *errorDescription) _ASN1_GCC_ATTR_DEPRECATED; + char *errorDescription) + _ASN1_GCC_ATTR_DEPRECATED; -extern ASN1_API int - asn1_der_decoding_startEnd (asn1_node element, + extern ASN1_API int + asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len, const char *name_element, int *start, int *end); -extern ASN1_API int - asn1_expand_any_defined_by (asn1_node_const definitions, asn1_node * element); + extern ASN1_API int + asn1_expand_any_defined_by (asn1_node_const definitions, + asn1_node * element); -extern ASN1_API int - asn1_expand_octet_string (asn1_node_const definitions, + extern ASN1_API int + asn1_expand_octet_string (asn1_node_const definitions, asn1_node * element, const char *octetName, const char *objectName); -extern ASN1_API int - asn1_read_tag (asn1_node_const root, const char *name, + extern ASN1_API int + asn1_read_tag (asn1_node_const root, const char *name, int *tagValue, int *classValue); -extern ASN1_API const char *asn1_find_structure_from_oid (asn1_node_const + extern ASN1_API const char *asn1_find_structure_from_oid (asn1_node_const definitions, const char *oidValue); -extern ASN1_API const char *asn1_check_version (const char *req_version); + __LIBTASN1_PURE__ + extern ASN1_API const char *asn1_check_version (const char *req_version); -extern ASN1_API const char *asn1_strerror (int error); + __LIBTASN1_PURE__ extern ASN1_API const char *asn1_strerror (int error); -extern ASN1_API void asn1_perror (int error); + extern ASN1_API void asn1_perror (int error); -#define ASN1_MAX_TAG_SIZE 4 -#define ASN1_MAX_LENGTH_SIZE 9 -#define ASN1_MAX_TL_SIZE (ASN1_MAX_TAG_SIZE+ASN1_MAX_LENGTH_SIZE) -extern ASN1_API long - asn1_get_length_der (const unsigned char *der, int der_len, int *len); +# define ASN1_MAX_TAG_SIZE 4 +# define ASN1_MAX_LENGTH_SIZE 9 +# define ASN1_MAX_TL_SIZE (ASN1_MAX_TAG_SIZE+ASN1_MAX_LENGTH_SIZE) + extern ASN1_API long + asn1_get_length_der (const unsigned char *der, int der_len, int *len); -extern ASN1_API long - asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len); + extern ASN1_API long + asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len); -extern ASN1_API void - asn1_length_der (unsigned long int len, unsigned char *der, int *der_len); + extern ASN1_API void + asn1_length_der (unsigned long int len, unsigned char *der, int *der_len); /* Other utility functions. */ -extern ASN1_API - int asn1_decode_simple_der (unsigned int etype, const unsigned char *der, + extern ASN1_API + int asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned int _der_len, const unsigned char **str, unsigned int *str_len); -extern ASN1_API - int asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, + extern ASN1_API + int asn1_decode_simple_ber (unsigned int etype, const unsigned char *der, unsigned int _der_len, unsigned char **str, - unsigned int *str_len, - unsigned int *ber_len); + unsigned int *str_len, unsigned int *ber_len); -extern ASN1_API int - asn1_encode_simple_der (unsigned int etype, const unsigned char *str, + extern ASN1_API int + asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned int str_len, unsigned char *tl, unsigned int *tl_len); -extern ASN1_API asn1_node - asn1_find_node (asn1_node_const pointer, const char *name); + extern ASN1_API asn1_node + asn1_find_node (asn1_node_const pointer, const char *name); -extern ASN1_API int - asn1_copy_node (asn1_node dst, const char *dst_name, + extern ASN1_API int + asn1_copy_node (asn1_node dst, const char *dst_name, asn1_node_const src, const char *src_name); -extern ASN1_API asn1_node - asn1_dup_node (asn1_node_const src, const char *src_name); + extern ASN1_API asn1_node + asn1_dup_node (asn1_node_const src, const char *src_name); /* Internal and low-level DER utility functions. */ -extern ASN1_API int - asn1_get_tag_der (const unsigned char *der, int der_len, + extern ASN1_API int + asn1_get_tag_der (const unsigned char *der, int der_len, unsigned char *cls, int *len, unsigned long *tag); -extern ASN1_API void - asn1_octet_der (const unsigned char *str, int str_len, + extern ASN1_API void + asn1_octet_der (const unsigned char *str, int str_len, unsigned char *der, int *der_len); -extern ASN1_API int - asn1_get_octet_der (const unsigned char *der, int der_len, + extern ASN1_API int + asn1_get_octet_der (const unsigned char *der, int der_len, int *ret_len, unsigned char *str, int str_size, int *str_len); -extern ASN1_API void asn1_bit_der (const unsigned char *str, int bit_len, + extern ASN1_API void asn1_bit_der (const unsigned char *str, int bit_len, unsigned char *der, int *der_len); -extern ASN1_API int - asn1_get_bit_der (const unsigned char *der, int der_len, + extern ASN1_API int + asn1_get_bit_der (const unsigned char *der, int der_len, int *ret_len, unsigned char *str, int str_size, int *bit_len); -extern ASN1_API int - asn1_get_object_id_der (const unsigned char *der, - int der_len, int *ret_len, - char *str, int str_size); + extern ASN1_API int + asn1_get_object_id_der (const unsigned char *der, + int der_len, int *ret_len, + char *str, int str_size); + + extern ASN1_API int + asn1_object_id_der (const char *str, unsigned char *der, int *der_len, + unsigned flags); /* Compatibility types */ @@ -484,7 +499,7 @@ extern ASN1_API int * * Deprecated: 3.0: Use int instead. */ -typedef int asn1_retCode; + typedef int asn1_retCode _ASN1_GCC_ATTR_DEPRECATED; /** * node_asn_struct: @@ -493,7 +508,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_node instead. */ -#define node_asn_struct asn1_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define node_asn_struct _Pragma ("GCC warning \"'node_asn_struct' macro is deprecated, use 'asn1_node' instead.\"") asn1_node_st +# else +# define node_asn_struct asn1_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * node_asn: @@ -502,7 +523,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_node instead. */ -#define node_asn asn1_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define node_asn _Pragma ("GCC warning \"'node_asn' macro is deprecated, use 'asn1_node' instead.\"") asn1_node_st +# else +# define node_asn asn1_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_TYPE: @@ -511,7 +538,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_node instead. */ -#define ASN1_TYPE asn1_node +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_TYPE _Pragma ("GCC warning \"'ASN1_TYPE' macro is deprecated, use 'asn1_node' instead.\"") asn1_node +# else +# define ASN1_TYPE asn1_node +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_TYPE_EMPTY: @@ -520,7 +553,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use NULL instead. */ -#define ASN1_TYPE_EMPTY NULL +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_TYPE_EMPTY _Pragma ("GCC warning \"'ASN1_TYPE_EMPTY' macro is deprecated, use 'NULL' instead.\"") NULL +# else +# define ASN1_TYPE_EMPTY NULL +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * static_struct_asn: @@ -529,7 +568,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_static_node instead. */ -#define static_struct_asn asn1_static_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define static_struct_asn _Pragma ("GCC warning \"'static_struct_asn' macro is deprecated, use 'asn1_static_node_st' instead.\"") asn1_static_node_st +# else +# define static_struct_asn asn1_static_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_ARRAY_TYPE: @@ -538,7 +583,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_static_node instead. */ -#define ASN1_ARRAY_TYPE asn1_static_node +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_ARRAY_TYPE _Pragma ("GCC warning \"'ASN1_ARRAY_TYPE' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_static_node +# else +# define ASN1_ARRAY_TYPE asn1_static_node +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * asn1_static_node_t: @@ -547,7 +598,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_static_node instead. */ -#define asn1_static_node_t asn1_static_node +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define asn1_static_node_t _Pragma ("GCC warning \"'asn1_static_node_t' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_static_node +# else +# define asn1_static_node_t asn1_static_node +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * node_data_struct: @@ -556,7 +613,13 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_data_node_st instead. */ -#define node_data_struct asn1_data_node_st +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define node_data_struct _Pragma ("GCC warning \"'node_data_struct' macro is deprecated, use 'asn1_data_node_st' instead.\"") asn1_data_node_st +# else +# define node_data_struct asn1_data_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ /** * ASN1_DATA_NODE: @@ -565,10 +628,16 @@ typedef int asn1_retCode; * * Deprecated: 3.0: Use #asn1_data_node_st instead. */ -#define ASN1_DATA_NODE asn1_data_node_st - -#ifdef __cplusplus +# ifndef ASN1_DISABLE_DEPRECATED +# if _ASN1_GCC_VERSION >= 30100 +# define ASN1_DATA_NODE _Pragma ("GCC warning \"'asn1_static_node_t' macro is deprecated, use 'asn1_static_node' instead.\"") asn1_data_node_st +# else +# define ASN1_DATA_NODE asn1_data_node_st +# endif +# endif /* !ASN1_DISABLE_DEPRECATED */ + +# ifdef __cplusplus } -#endif +# endif #endif /* LIBTASN1_H */ @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -20,25 +20,24 @@ */ #ifndef INT_H -#define INT_H +# define INT_H -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif +# ifdef HAVE_CONFIG_H +# include <config.h> +# endif -#include <string.h> -#include <stdlib.h> -#include <stdio.h> -#include <ctype.h> -#include <stdint.h> +# include <string.h> +# include <stdlib.h> +# include <stdio.h> +# include <stdint.h> -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif +# ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +# endif -#include <libtasn1.h> +# include <libtasn1.h> -#define ASN1_SMALL_VALUE_SIZE 16 +# define ASN1_SMALL_VALUE_SIZE 16 /* This structure is also in libtasn1.h, but then contains less fields. You cannot make any modifications to these first fields @@ -59,8 +58,8 @@ struct asn1_node_st /* values used during decoding/coding */ int tmp_ival; - unsigned start; /* the start of the DER sequence - if decoded */ - unsigned end; /* the end of the DER sequence - if decoded */ + unsigned start; /* the start of the DER sequence - if decoded */ + unsigned end; /* the end of the DER sequence - if decoded */ }; typedef struct tag_and_class_st @@ -71,7 +70,7 @@ typedef struct tag_and_class_st } tag_and_class_st; /* the types that are handled in _asn1_tags */ -#define CASE_HANDLED_ETYPES \ +# define CASE_HANDLED_ETYPES \ case ASN1_ETYPE_NULL: \ case ASN1_ETYPE_BOOLEAN: \ case ASN1_ETYPE_INTEGER: \ @@ -95,13 +94,13 @@ typedef struct tag_and_class_st case ASN1_ETYPE_GENERALIZED_TIME: \ case ASN1_ETYPE_SET_OF -#define ETYPE_TAG(etype) (_asn1_tags[etype].tag) -#define ETYPE_CLASS(etype) (_asn1_tags[etype].class) -#define ETYPE_OK(etype) (((etype) != ASN1_ETYPE_INVALID && \ - (etype) <= _asn1_tags_size && \ +# define ETYPE_TAG(etype) (_asn1_tags[etype].tag) +# define ETYPE_CLASS(etype) (_asn1_tags[etype].class) +# define ETYPE_OK(etype) (((etype) != ASN1_ETYPE_INVALID && \ + (etype) < _asn1_tags_size && \ _asn1_tags[(etype)].desc != NULL)?1:0) -#define ETYPE_IS_STRING(etype) ((etype == ASN1_ETYPE_GENERALSTRING || \ +# define ETYPE_IS_STRING(etype) ((etype == ASN1_ETYPE_GENERALSTRING || \ etype == ASN1_ETYPE_NUMERIC_STRING || etype == ASN1_ETYPE_IA5_STRING || \ etype == ASN1_ETYPE_TELETEX_STRING || etype == ASN1_ETYPE_PRINTABLE_STRING || \ etype == ASN1_ETYPE_UNIVERSAL_STRING || etype == ASN1_ETYPE_BMP_STRING || \ @@ -111,66 +110,66 @@ typedef struct tag_and_class_st extern unsigned int _asn1_tags_size; extern const tag_and_class_st _asn1_tags[]; -#define _asn1_strlen(s) strlen((const char *) s) -#define _asn1_strtol(n,e,b) strtol((const char *) n, e, b) -#define _asn1_strtoul(n,e,b) strtoul((const char *) n, e, b) -#define _asn1_strcmp(a,b) strcmp((const char *)a, (const char *)b) -#define _asn1_strcpy(a,b) strcpy((char *)a, (const char *)b) -#define _asn1_strcat(a,b) strcat((char *)a, (const char *)b) +# define _asn1_strlen(s) strlen((const char *) s) +# define _asn1_strtol(n,e,b) strtol((const char *) n, e, b) +# define _asn1_strtoul(n,e,b) strtoul((const char *) n, e, b) +# define _asn1_strcmp(a,b) strcmp((const char *)a, (const char *)b) +# define _asn1_strcpy(a,b) strcpy((char *)a, (const char *)b) +# define _asn1_strcat(a,b) strcat((char *)a, (const char *)b) -#if SIZEOF_UNSIGNED_LONG_INT == 8 -# define _asn1_strtou64(n,e,b) strtoul((const char *) n, e, b) -#else -# define _asn1_strtou64(n,e,b) strtoull((const char *) n, e, b) -#endif +# if SIZEOF_UNSIGNED_LONG_INT == 8 +# define _asn1_strtou64(n,e,b) strtoul((const char *) n, e, b) +# else +# define _asn1_strtou64(n,e,b) strtoull((const char *) n, e, b) +# endif -#define MAX_LOG_SIZE 1024 /* maximum number of characters of a log message */ +# define MAX_LOG_SIZE 1024 /* maximum number of characters of a log message */ /* Define used for visiting trees. */ -#define UP 1 -#define RIGHT 2 -#define DOWN 3 +# define UP 1 +# define RIGHT 2 +# define DOWN 3 /***********************************************************************/ /* List of constants to better specify the type of typedef asn1_node_st. */ /***********************************************************************/ /* Used with TYPE_TAG */ -#define CONST_UNIVERSAL (1<<8) -#define CONST_PRIVATE (1<<9) -#define CONST_APPLICATION (1<<10) -#define CONST_EXPLICIT (1<<11) -#define CONST_IMPLICIT (1<<12) +# define CONST_UNIVERSAL (1U<<8) +# define CONST_PRIVATE (1U<<9) +# define CONST_APPLICATION (1U<<10) +# define CONST_EXPLICIT (1U<<11) +# define CONST_IMPLICIT (1U<<12) -#define CONST_TAG (1<<13) /* Used in ASN.1 assignement */ -#define CONST_OPTION (1<<14) -#define CONST_DEFAULT (1<<15) -#define CONST_TRUE (1<<16) -#define CONST_FALSE (1<<17) +# define CONST_TAG (1U<<13) /* Used in ASN.1 assignement */ +# define CONST_OPTION (1U<<14) +# define CONST_DEFAULT (1U<<15) +# define CONST_TRUE (1U<<16) +# define CONST_FALSE (1U<<17) -#define CONST_LIST (1<<18) /* Used with TYPE_INTEGER and TYPE_BIT_STRING */ -#define CONST_MIN_MAX (1<<19) +# define CONST_LIST (1U<<18) /* Used with TYPE_INTEGER and TYPE_BIT_STRING */ +# define CONST_MIN_MAX (1U<<19) -#define CONST_1_PARAM (1<<20) +# define CONST_1_PARAM (1U<<20) -#define CONST_SIZE (1<<21) +# define CONST_SIZE (1U<<21) -#define CONST_DEFINED_BY (1<<22) +# define CONST_DEFINED_BY (1U<<22) /* Those two are deprecated and used for backwards compatibility */ -#define CONST_GENERALIZED (1<<23) -#define CONST_UTC (1<<24) +# define CONST_GENERALIZED (1U<<23) +# define CONST_UTC (1U<<24) -/* #define CONST_IMPORTS (1<<25) */ +/* #define CONST_IMPORTS (1U<<25) */ -#define CONST_NOT_USED (1<<26) -#define CONST_SET (1<<27) -#define CONST_ASSIGN (1<<28) +# define CONST_NOT_USED (1U<<26) +# define CONST_SET (1U<<27) +# define CONST_ASSIGN (1U<<28) -#define CONST_DOWN (1<<29) -#define CONST_RIGHT (1<<30) +# define CONST_DOWN (1U<<29) +# define CONST_RIGHT (1U<<30) -#define ASN1_ETYPE_TIME 17 +# define ASN1_ETYPE_TIME 17 /****************************************/ /* Returns the first 8 bits. */ /* Used with the field type of asn1_node_st */ @@ -203,18 +202,18 @@ convert_old_type (unsigned int ntype) return ntype; } -static inline -void *_asn1_realloc(void *ptr, size_t size) +static inline void * +_asn1_realloc (void *ptr, size_t size) { void *ret; if (size == 0) return ptr; - ret = realloc(ptr, size); + ret = realloc (ptr, size); if (ret == NULL) { - free(ptr); + free (ptr); } return ret; } diff --git a/lib/libtasn1.map b/lib/libtasn1.map index 007925c..a78db52 100644 --- a/lib/libtasn1.map +++ b/lib/libtasn1.map @@ -1,19 +1,21 @@ -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2022 Free Software Foundation, Inc. # # This file is part of LIBTASN1. # -# 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. +# The LIBTASN1 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. # -# 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. +# This 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 General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA LIBTASN1_0_3 { @@ -61,3 +63,8 @@ LIBTASN1_0_3 local: *; }; + +LIBTASN1_4_16_0 { + global: + asn1_object_id_der; +} LIBTASN1_0_3; diff --git a/lib/libtasn1.pc.in b/lib/libtasn1.pc.in index 41e7584..f480de7 100644 --- a/lib/libtasn1.pc.in +++ b/lib/libtasn1.pc.in @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2014 Free Software Foundation, Inc. +# Copyright (C) 2005-2022 Free Software Foundation, Inc. # # This file is part of LIBTASN1. # @@ -24,7 +24,7 @@ includedir=@includedir@ Name: libtasn1 Description: Library for ASN.1 and DER manipulation -URL: http://www.gnu.org/software/libtasn1/ +URL: https://www.gnu.org/software/libtasn1/ Version: @VERSION@ Libs: -L${libdir} -ltasn1 Cflags: -I${includedir} diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 095204e..c05bd23 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2016 Free Software Foundation, Inc. + * Copyright (C) 2000-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -19,15 +19,37 @@ * 02110-1301, USA */ -#include <int.h> -#include <hash-pjw-bare.h> +#include <limits.h> /* WORD_BIT */ + +#include "int.h" #include "parser_aux.h" #include "gstr.h" #include "structure.h" #include "element.h" +#include "c-ctype.h" char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not found */ +/* Return a hash of the N bytes of X using the method described by + Bruno Haible in https://www.haible.de/bruno/hashfunc.html. + Note that while many hash functions reduce their result via modulo + to a 0..table_size-1 range, this function does not do that. + + This implementation has been changed from size_t -> unsigned int. */ + +#ifdef __clang__ +__attribute__((no_sanitize ("integer"))) +#endif + _GL_ATTRIBUTE_PURE static unsigned int _asn1_hash_name (const char *x) +{ + const unsigned char *s = (unsigned char *) x; + unsigned h = 0; + + while (*s) + h = (*s++) + ((h << 9) | (h >> (WORD_BIT - 9))); + + return h; +} /******************************************************/ /* Function : _asn1_add_static_node */ @@ -40,7 +62,7 @@ char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not fou /* Return: pointer to the new element. */ /******************************************************/ asn1_node -_asn1_add_static_node (list_type **e_list, unsigned int type) +_asn1_add_static_node (list_type ** e_list, unsigned int type) { list_type *p; asn1_node punt; @@ -65,6 +87,24 @@ _asn1_add_static_node (list_type **e_list, unsigned int type) return punt; } +static int +_asn1_add_static_node2 (list_type ** e_list, asn1_node node) +{ + list_type *p; + + p = malloc (sizeof (list_type)); + if (p == NULL) + { + return -1; + } + + p->node = node; + p->next = *e_list; + *e_list = p; + + return 0; +} + /** * asn1_find_node: * @pointer: NODE_ASN element pointer. @@ -96,10 +136,10 @@ asn1_find_node (asn1_node_const pointer, const char *name) n_start = name; if (name[0] == '?' && name[1] == 'C' && p->name[0] == '?') - { /* ?CURRENT */ - n_start = strchr(n_start, '.'); + { /* ?CURRENT */ + n_start = strchr (n_start, '.'); if (n_start) - n_start++; + n_start++; } else if (p->name[0] != 0) { /* has *pointer got a name ? */ @@ -107,20 +147,20 @@ asn1_find_node (asn1_node_const pointer, const char *name) if (n_end) { nsize = n_end - n_start; - if (nsize >= sizeof(n)) - return NULL; + if (nsize >= sizeof (n)) + return NULL; memcpy (n, n_start, nsize); n[nsize] = 0; n_start = n_end; n_start++; - nhash = hash_pjw_bare (n, nsize); + nhash = _asn1_hash_name (n); } else { - nsize = _asn1_str_cpy (n, sizeof (n), n_start); - nhash = hash_pjw_bare (n, nsize); + _asn1_str_cpy (n, sizeof (n), n_start); + nhash = _asn1_hash_name (n); n_start = NULL; } @@ -148,20 +188,20 @@ asn1_find_node (asn1_node_const pointer, const char *name) if (n_end) { nsize = n_end - n_start; - if (nsize >= sizeof(n)) - return NULL; + if (nsize >= sizeof (n)) + return NULL; memcpy (n, n_start, nsize); n[nsize] = 0; n_start = n_end; n_start++; - nhash = hash_pjw_bare (n, nsize); + nhash = _asn1_hash_name (n); } else { - nsize = _asn1_str_cpy (n, sizeof (n), n_start); - nhash = hash_pjw_bare (n, nsize); + _asn1_str_cpy (n, sizeof (n), n_start); + nhash = _asn1_hash_name (n); n_start = NULL; } @@ -170,11 +210,11 @@ asn1_find_node (asn1_node_const pointer, const char *name) p = p->down; if (p == NULL) - return NULL; + return NULL; /* The identifier "?LAST" indicates the last element in the right chain. */ - if (n[0] == '?' && n[1] == 'L') /* ?LAST */ + if (n[0] == '?' && n[1] == 'L') /* ?LAST */ { while (p->right) p = p->right; @@ -190,7 +230,7 @@ asn1_find_node (asn1_node_const pointer, const char *name) } } if (p == NULL) - return NULL; + return NULL; } /* while */ return (asn1_node) p; @@ -329,13 +369,13 @@ _asn1_append_value (asn1_node node, const void *value, unsigned int len) } if (prev_len > 0) - memcpy (node->value, node->small_value, prev_len); + memcpy (node->value, node->small_value, prev_len); memcpy (&node->value[prev_len], value, len); return node; } - else /* if (node->value != NULL && node->value != node->small_value) */ + else /* if (node->value != NULL && node->value != node->small_value) */ { /* value is allocated */ int prev_len = node->value_len; @@ -367,20 +407,11 @@ _asn1_append_value (asn1_node node, const void *value, unsigned int len) asn1_node _asn1_set_name (asn1_node node, const char *name) { - unsigned int nsize; - if (node == NULL) return node; - if (name == NULL) - { - node->name[0] = 0; - node->name_hash = hash_pjw_bare (node->name, 0); - return node; - } - - nsize = _asn1_str_cpy (node->name, sizeof (node->name), name); - node->name_hash = hash_pjw_bare (node->name, nsize); + _asn1_str_cpy (node->name, sizeof (node->name), name ? name : ""); + node->name_hash = _asn1_hash_name (node->name); return node; } @@ -402,7 +433,7 @@ _asn1_cpy_name (asn1_node dst, asn1_node_const src) if (src == NULL) { dst->name[0] = 0; - dst->name_hash = hash_pjw_bare (dst->name, 0); + dst->name_hash = _asn1_hash_name (dst->name); return dst; } @@ -470,12 +501,12 @@ _asn1_remove_node (asn1_node node, unsigned int flags) if (node->value != NULL) { if (flags & ASN1_DELETE_FLAG_ZEROIZE) - { - safe_memset(node->value, 0, node->value_len); - } + { + safe_memset (node->value, 0, node->value_len); + } if (node->value != node->small_value) - free (node->value); + free (node->value); } free (node); } @@ -503,19 +534,39 @@ _asn1_find_up (asn1_node_const node) return p->left; } +static unsigned +_asn1_is_up (asn1_node_const up_cand, asn1_node_const down) +{ + asn1_node_const d, u; + + if (up_cand == NULL || down == NULL) + return 0; + + d = down; + + while ((u = _asn1_find_up (d)) != NULL && u != d) + { + if (u == up_cand) + return 1; + d = u; + } + + return 0; +} + /******************************************************************/ /* Function : _asn1_delete_node_from_list */ /* Description: deletes the list element given */ /******************************************************************/ -static void -_asn1_delete_node_from_list (list_type *list, asn1_node node) +void +_asn1_delete_node_from_list (list_type * list, asn1_node node) { list_type *p = list; while (p) { if (p->node == node) - p->node = NULL; + p->node = NULL; p = p->next; } } @@ -526,7 +577,7 @@ _asn1_delete_node_from_list (list_type *list, asn1_node node) /* pointed by them). */ /******************************************************************/ void -_asn1_delete_list (list_type *e_list) +_asn1_delete_list (list_type * e_list) { list_type *p; @@ -544,7 +595,7 @@ _asn1_delete_list (list_type *e_list) /* pointed by them. */ /******************************************************************/ void -_asn1_delete_list_and_nodes (list_type *e_list) +_asn1_delete_list_and_nodes (list_type * e_list) { list_type *p; @@ -570,7 +621,7 @@ _asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE]) { str[0] = '-'; start = 1; - val = -((uint64_t)v); + val = -((uint64_t) v); } else { @@ -587,7 +638,7 @@ _asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE]) count++; val = d; } - while (val && ((start+count) < LTOSTR_MAX_SIZE-1)); + while (val && ((start + count) < LTOSTR_MAX_SIZE - 1)); for (k = 0; k < count; k++) str[k + start] = temp[start + count - k - 1]; @@ -664,7 +715,7 @@ _asn1_change_integer_value (asn1_node node) return ASN1_SUCCESS; } - +#define MAX_CONSTANTS 1024 /******************************************************************/ /* Function : _asn1_expand_object_id */ /* Description: expand the IDs of an OBJECT IDENTIFIER constant. */ @@ -676,11 +727,12 @@ _asn1_change_integer_value (asn1_node node) /* otherwise ASN1_SUCCESS */ /******************************************************************/ int -_asn1_expand_object_id (list_type *list, asn1_node node) +_asn1_expand_object_id (list_type ** list, asn1_node node) { asn1_node p, p2, p3, p4, p5; char name_root[ASN1_MAX_NAME_SIZE], name2[2 * ASN1_MAX_NAME_SIZE + 1]; int move, tlen, tries; + unsigned max_constants; if (node == NULL) return ASN1_ELEMENT_NOT_FOUND; @@ -701,35 +753,45 @@ _asn1_expand_object_id (list_type *list, asn1_node node) p2 = p->down; if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) { - if (p2->value && !isdigit (p2->value[0])) + if (p2->value && !c_isdigit (p2->value[0])) { _asn1_str_cpy (name2, sizeof (name2), name_root); _asn1_str_cat (name2, sizeof (name2), "."); _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); p3 = asn1_find_node (node, name2); - if (!p3 - || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) - || !(p3->type & CONST_ASSIGN)) + if (!p3 || _asn1_is_up (p2, p3) || + (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) || + !(p3->type & CONST_ASSIGN)) return ASN1_ELEMENT_NOT_FOUND; + _asn1_set_down (p, p2->right); - _asn1_delete_node_from_list(list, p2); + if (p2->down) + _asn1_delete_structure (*list, &p2->down, 0); + _asn1_delete_node_from_list (*list, p2); _asn1_remove_node (p2, 0); p2 = p; p4 = p3->down; + max_constants = 0; while (p4) { if (type_field (p4->type) == ASN1_ETYPE_CONSTANT) { + max_constants++; + if (max_constants == MAX_CONSTANTS) + return ASN1_RECURSION; + p5 = _asn1_add_single_node (ASN1_ETYPE_CONSTANT); _asn1_set_name (p5, p4->name); if (p4->value) - { - tlen = _asn1_strlen (p4->value); - if (tlen > 0) - _asn1_set_value (p5, p4->value, tlen + 1); - } + { + tlen = _asn1_strlen (p4->value); + if (tlen > 0) + _asn1_set_value (p5, p4->value, tlen + 1); + } + _asn1_add_static_node2 (list, p5); + if (p2 == p) { _asn1_set_right (p5, p->down); @@ -747,8 +809,8 @@ _asn1_expand_object_id (list_type *list, asn1_node node) move = DOWN; tries++; - if (tries >= EXPAND_OBJECT_ID_MAX_RECURSION) - return ASN1_RECURSION; + if (tries >= EXPAND_OBJECT_ID_MAX_RECURSION) + return ASN1_RECURSION; continue; } @@ -785,7 +847,6 @@ _asn1_expand_object_id (list_type *list, asn1_node node) p = _asn1_find_up (p); } - /*******************************/ /* expand DEFAULT */ /*******************************/ @@ -804,7 +865,8 @@ _asn1_expand_object_id (list_type *list, asn1_node node) { _asn1_str_cpy (name2, sizeof (name2), name_root); _asn1_str_cat (name2, sizeof (name2), "."); - _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); + if (p2->value) + _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); p3 = asn1_find_node (node, name2); if (!p3 || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) || !(p3->type & CONST_ASSIGN)) @@ -968,7 +1030,9 @@ _asn1_check_identifier (asn1_node_const node) if (p2 == NULL) { if (p->value) - _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p->value); + _asn1_str_cpy (_asn1_identifierMissing, + sizeof (_asn1_identifierMissing), + (char *) p->value); else _asn1_strcpy (_asn1_identifierMissing, "(null)"); return ASN1_IDENTIFIER_NOT_FOUND; @@ -982,11 +1046,13 @@ _asn1_check_identifier (asn1_node_const node) { _asn1_str_cpy (name2, sizeof (name2), node->name); if (p2->value) - { - _asn1_str_cat (name2, sizeof (name2), "."); - _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); - _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value); - } + { + _asn1_str_cat (name2, sizeof (name2), "."); + _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); + _asn1_str_cpy (_asn1_identifierMissing, + sizeof (_asn1_identifierMissing), + (char *) p2->value); + } else _asn1_strcpy (_asn1_identifierMissing, "(null)"); @@ -1004,12 +1070,14 @@ _asn1_check_identifier (asn1_node_const node) p2 = p->down; if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) { - if (p2->value && !isdigit (p2->value[0])) + if (p2->value && !c_isdigit (p2->value[0])) { _asn1_str_cpy (name2, sizeof (name2), node->name); _asn1_str_cat (name2, sizeof (name2), "."); _asn1_str_cat (name2, sizeof (name2), (char *) p2->value); - _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value); + _asn1_str_cpy (_asn1_identifierMissing, + sizeof (_asn1_identifierMissing), + (char *) p2->value); p2 = asn1_find_node (node, name2); if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) diff --git a/lib/parser_aux.h b/lib/parser_aux.h index c21d20d..3eac1fa 100644 --- a/lib/parser_aux.h +++ b/lib/parser_aux.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2014 Free Software Foundation, Inc. + * Copyright (C) 2000-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -20,7 +20,7 @@ */ #ifndef _PARSER_AUX_H -#define _PARSER_AUX_H +# define _PARSER_AUX_H /***********************************************/ /* Type: list_type */ @@ -36,12 +36,13 @@ typedef struct list_struct /***************************************/ /* Functions used by ASN.1 parser */ /***************************************/ -asn1_node _asn1_add_static_node (list_type **e_list, unsigned int type); +asn1_node _asn1_add_static_node (list_type ** e_list, unsigned int type); -void _asn1_delete_list (list_type *e_list); +void _asn1_delete_list (list_type * e_list); -void _asn1_delete_list_and_nodes (list_type *e_list); +void _asn1_delete_list_and_nodes (list_type * e_list); +void _asn1_delete_node_from_list (list_type * list, asn1_node node); asn1_node _asn1_set_value (asn1_node node, const void *value, unsigned int len); @@ -65,15 +66,15 @@ asn1_node _asn1_get_last_right (asn1_node_const node); void _asn1_remove_node (asn1_node node, unsigned int flags); /* Max 64-bit integer length is 20 chars + 1 for sign + 1 for null termination */ -#define LTOSTR_MAX_SIZE 22 +# define LTOSTR_MAX_SIZE 22 char *_asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE]); asn1_node _asn1_find_up (asn1_node_const node); int _asn1_change_integer_value (asn1_node node); -#define EXPAND_OBJECT_ID_MAX_RECURSION 16 -int _asn1_expand_object_id (list_type *list, asn1_node node); +# define EXPAND_OBJECT_ID_MAX_RECURSION 16 +int _asn1_expand_object_id (list_type ** list, asn1_node node); int _asn1_type_set_config (asn1_node node); diff --git a/lib/structure.c b/lib/structure.c index 0545025..512dd60 100644 --- a/lib/structure.c +++ b/lib/structure.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -78,8 +78,8 @@ _asn1_find_left (asn1_node_const node) int -_asn1_create_static_structure (asn1_node_const pointer, char *output_file_name, - char *vector_name) +_asn1_create_static_structure (asn1_node_const pointer, + char *output_file_name, char *vector_name) { FILE *file; asn1_node_const p; @@ -192,8 +192,7 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, move = UP; - k = 0; - while (array[k].value || array[k].type || array[k].name) + for (k = 0; array[k].value || array[k].type || array[k].name; k++) { type = convert_old_type (array[k].type); @@ -207,9 +206,17 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, *definitions = p; if (move == DOWN) - _asn1_set_down (p_last, p); + { + if (p_last && p_last->down) + _asn1_delete_structure (e_list, &p_last->down, 0); + _asn1_set_down (p_last, p); + } else if (move == RIGHT) - _asn1_set_right (p_last, p); + { + if (p_last && p_last->right) + _asn1_delete_structure (e_list, &p_last->right, 0); + _asn1_set_right (p_last, p); + } p_last = p; @@ -219,11 +226,8 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, move = RIGHT; else { - while (1) + while (p_last != *definitions) { - if (p_last == *definitions) - break; - p_last = _asn1_find_up (p_last); if (p_last == NULL) @@ -237,7 +241,6 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, } } /* while */ } - k++; } /* while */ if (p_last == *definitions) @@ -246,7 +249,7 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, if (result == ASN1_SUCCESS) { _asn1_change_integer_value (*definitions); - result = _asn1_expand_object_id (e_list, *definitions); + result = _asn1_expand_object_id (&e_list, *definitions); } } else @@ -290,13 +293,13 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions, int asn1_delete_structure (asn1_node * structure) { - return asn1_delete_structure2(structure, 0); + return _asn1_delete_structure (NULL, structure, 0); } /** * asn1_delete_structure2: * @structure: pointer to the structure that you want to delete. - * @flags: additional flags (see %ASN1_DELETE_FLAG) + * @flags: additional flags (see %ASN1_DELETE_FLAG_ZEROIZE) * * Deletes the structure *@structure. At the end, *@structure is set * to NULL. @@ -307,6 +310,13 @@ asn1_delete_structure (asn1_node * structure) int asn1_delete_structure2 (asn1_node * structure, unsigned int flags) { + return _asn1_delete_structure (NULL, structure, flags); +} + +int +_asn1_delete_structure (list_type * e_list, asn1_node * structure, + unsigned int flags) +{ asn1_node p, p2, p3; if (*structure == NULL) @@ -326,6 +336,8 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int flags) { p3 = _asn1_find_up (p); _asn1_set_down (p3, p2); + if (e_list) + _asn1_delete_node_from_list (e_list, p); _asn1_remove_node (p, flags); p = p3; } @@ -345,6 +357,8 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int flags) } else _asn1_set_right (p3, p2); + if (e_list) + _asn1_delete_node_from_list (e_list, p); _asn1_remove_node (p, flags); p = NULL; } @@ -356,7 +370,6 @@ asn1_delete_structure2 (asn1_node * structure, unsigned int flags) } - /** * asn1_delete_element: * @structure: pointer to the structure that contains the element you @@ -398,7 +411,6 @@ asn1_delete_element (asn1_node structure, const char *element_name) asn1_node _asn1_copy_structure3 (asn1_node_const source_node) { -/* FIXME: there may be a leak here */ asn1_node_const p_s; asn1_node dest_node, p_d, p_d_prev; int move; @@ -407,6 +419,8 @@ _asn1_copy_structure3 (asn1_node_const source_node) return NULL; dest_node = _asn1_add_single_node (source_node->type); + if (dest_node == NULL) + return dest_node; p_s = source_node; p_d = dest_node; @@ -879,7 +893,8 @@ asn1_print_structure (FILE * out, asn1_node_const structure, const char *name, fprintf (out, " value(%i):", (len - 1) * 8 - (p->value[len2])); for (k = 1; k < len; k++) - fprintf (out, "%02x", (unsigned) (p->value)[k + len2]); + fprintf (out, "%02x", + (unsigned) (p->value)[k + len2]); } } break; @@ -1101,7 +1116,8 @@ asn1_number_of_elements (asn1_node_const element, const char *name, int *num) * the OID. **/ const char * -asn1_find_structure_from_oid (asn1_node_const definitions, const char *oidValue) +asn1_find_structure_from_oid (asn1_node_const definitions, + const char *oidValue) { char name[2 * ASN1_MAX_NAME_SIZE + 2]; char value[ASN1_MAX_NAME_SIZE]; @@ -1122,7 +1138,7 @@ asn1_find_structure_from_oid (asn1_node_const definitions, const char *oidValue) if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID) && (p->type & CONST_ASSIGN)) { - snprintf(name, sizeof(name), "%s.%s", definitionsName, p->name); + snprintf (name, sizeof (name), "%s.%s", definitionsName, p->name); len = ASN1_MAX_NAME_SIZE; result = asn1_read_value (definitions, name, value, &len); @@ -1205,5 +1221,5 @@ asn1_copy_node (asn1_node dst, const char *dst_name, asn1_node asn1_dup_node (asn1_node_const src, const char *src_name) { - return _asn1_copy_structure2(src, src_name); + return _asn1_copy_structure2 (src, src_name); } diff --git a/lib/structure.h b/lib/structure.h index 4993146..b973ce9 100644 --- a/lib/structure.h +++ b/lib/structure.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2014 Free Software Foundation, Inc. + * Copyright (C) 2002-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -26,7 +26,9 @@ /*************************************************/ #ifndef _STRUCTURE_H -#define _STRUCTURE_H +# define _STRUCTURE_H + +# include "parser_aux.h" /* list_type */ int _asn1_create_static_structure (asn1_node_const pointer, char *output_file_name, char *vector_name); @@ -37,4 +39,8 @@ asn1_node _asn1_add_single_node (unsigned int type); asn1_node _asn1_find_left (asn1_node_const node); +int +_asn1_delete_structure (list_type * e_list, asn1_node * structure, + unsigned int flags); + #endif diff --git a/lib/version.c b/lib/version.c index 25f8a8f..bd493bf 100644 --- a/lib/version.c +++ b/lib/version.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2014 Free Software Foundation, Inc. + * Copyright (C) 2000-2022 Free Software Foundation, Inc. * * This file is part of LIBTASN1. * @@ -20,7 +20,7 @@ */ #ifdef HAVE_CONFIG_H -#include <config.h> +# include <config.h> #endif #include <string.h> /* for strverscmp */ |